Skip to content

AI-agentic quality gate

In a CI/CD pipeline, missing frontmatter can cause build failures or SEO degradation. Human writers and LLMs can sometimes forget to include or properly format all required frontmatter fields.

I used Claude Code to create a custom MCP Server in TypeScript that allows a Claude AI agent to programmatically validate local markdown files. In this example, the MCP server looks for two fields: title: and description:. If the frontmatter is missing one or both fields, the MCP server returns a structured error message to the AI agent.

  • Local Filesystem Access: Securely bridges the gap between the LLM and the local repository.
  • Automated Metadata Audits: Instantly identifies missing required YAML fields.
  • Shift-Left Methodology: Catches errors during the authoring phase, before they hit CI/CD.

The auditor is built as a Node.js server using @modelcontextprotocol/sdk. It implements a tool called audit_metadata which handles path normalization and regex-based frontmatter scanning.

// Example of the validation logic I implemented
const hasTitle = content.includes("title:");
const hasDescription = content.includes("description:");