Skip to main content
Glama

MCP Code Validator (TypeScript, Gemini compatible)

This project provides a TypeScript MCP server (JSON-RPC over stdio) with a validate_codebase tool.

What the server does

  1. Loads a JSON rules file.

  2. Analyzes a set of files (configurable extensions).

  3. Resets the context between each file.

  4. Writes all violations to a JSON reporting file.

Related MCP server: Edit File Lines MCP Server

Requested logic (your example)

Code example: <###### this is a comment ###> 4<=6

Associated rules:

  • a comment must start with <###

  • <= is forbidden (only < is allowed for this case)

Installation

npm install
npm run build

Running the MCP server

npm start

Running the example validation

npm run validate:example

Generated report: reports/report.json.

Main files

  • src/server.ts: MCP server + rules engine.

  • examples/rules.json: example rules.

  • examples/codebase/*: example code to analyze.

  • scripts/run_validation.ts: demonstration script.

Related MCP Connectors

Related MCP Servers