API Contract MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@API Contract MCPValidate the payments API response against the contract schema"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@mhdd_24/api-contract-mcp
Validate API contracts between services.
Same architecture as @mhdd_24/sublime-mcp.
Full documentation: docs/WIKI.md
How it works (30 seconds)
You (chat) → MCP client → api-contract-mcp → API Contract APIs / CLIs / local toolsRelated MCP server: OpenAPI Contracts MCP Server
Prerequisites
Requirement | Notes |
Node.js 18+ | ESM TypeScript MCP server |
Credentials / CLIs | See environment variables below |
Install
Option A — npm (after publish)
npm install -g @mhdd_24/api-contract-mcpOption B — npx
npx @mhdd_24/api-contract-mcpOption C — clone and build
git clone https://github.com/Mhdd-24/API-Contract-MCP.git
cd API-Contract-MCP
npm install
npm run build
node dist/index.jsConfigure Cursor
Edit ~/.cursor/mcp.json:
{
"mcpServers": {
"apicontract": {
"command": "npx",
"args": ["-y", "@mhdd_24/api-contract-mcp"],
"env": {
"PROJECT_ROOT": "..."
}
}
}
}Local development:
{
"command": "node",
"args": ["/absolute/path/to/API-Contract-MCP/dist/index.js"]
}Environment variables
Variable | Description |
| Default project/repository root |
Tools
Tool | Description |
| Health check for API Contract MCP. |
| Validate a response against an expected schema/JSON. |
| List endpoints from OpenAPI JSON. |
License
ISC
Available Tools
3 toolsapicontract_endpointsB
List endpoints from OpenAPI JSON.
| Name | Required | Description | Default |
|---|---|---|---|
| spec | Yes | OpenAPI JSON or path |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden for behavioral disclosure. It implies a read-only listing operation but does not mention return format, error behavior, handling of paths, or any limitations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clean sentence with no filler. The verb and object are front-loaded, and every word contributes to the meaning.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter list operation, the description plus schema cover the basic input and action. However, with no output schema and no annotations, the agent is left without details on the returned endpoint structure or when to choose this tool over its siblings.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema fully documents the single 'spec' parameter with 100% coverage, so the baseline is 3. The description adds no parameter detail beyond the schema and even uses the narrower phrase 'OpenAPI JSON' where the schema says 'OpenAPI JSON or path'.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('List') and resource ('endpoints') scoped to 'OpenAPI JSON', making the tool's purpose immediately clear. It is distinguishable from the sibling tools like apicontract_validate and apicontract_status by the listing action.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given about when to use this tool versus apicontract_validate or apicontract_status. The description only says what it does, not when it should be preferred or excluded.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
apicontract_statusB
Health check for API Contract MCP.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It says 'Health check' but does not explain what it returns, whether it performs any side effects, or any error behavior. For a tool with zero annotation safety signals, this is insufficient detail.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with zero waste. It clearly communicates the tool's purpose in the minimum possible space.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple status/health-check tool with no parameters and no output schema, the description is nearly sufficient. However, it doesn't mention what the health check returns (e.g., HTTP status, JSON payload) or conditions under which it might report failure. Minor gap, but acceptable for a trivial tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, and the schema is empty (100% coverage). Per calibration, a 0-parameter tool warrants a baseline of 4. The description adds no parameter information, but none is needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Health check') and resource ('API Contract MCP'), clearly indicating what the tool does. It distinguishes from siblings by concept (status vs. validate/endpoints), though it doesn't explicitly name them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to use this tool versus the sibling tools apicontract_validate or apicontract_endpoints. The description only states what it does, not when it should be selected over alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
apicontract_validateB
Validate a response against an expected schema/JSON.
| Name | Required | Description | Default |
|---|---|---|---|
| actual | Yes | Actual JSON | |
| expected | Yes | Expected JSON/schema |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states that the tool validates a response against a schema, but does not describe the outcome (e.g., whether it returns a boolean, a detailed report, or throws on mismatch), any side effects, or limitations. This is a significant gap for a validation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that front-loads the core action and target. Every word earns its place, with no redundant phrasing or unnecessary detail. This is an efficient and well-structured description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with no output schema, the description should explain what the validation result looks like (e.g., success/failure, error format). It also lacks any usage context or alternative guidance. Given the tool's simplicity, the description is incomplete because it omits critical return-value information that an agent needs to interpret the result correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already provides 100% coverage for both parameters ('expected' and 'actual') with clear descriptions and types. The tool description adds no additional meaning beyond what the schema already states, so it meets the baseline for high schema coverage but does not enhance it.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a clear action ('validate') on a specific resource ('a response') against an expected schema/JSON. It is immediately distinguishable from the sibling tools 'status' and 'endpoints', which serve different purposes. The verb and object are specific enough for an agent to understand the core functionality.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus the sibling tools (apicontract_status, apicontract_endpoints). It does not mention any context, prerequisites, or exclusions. An agent would have to infer usage from the name alone, which is insufficient for a tool with distinct siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v1.0.0- First observed
apicontract_endpoints - First observed
apicontract_status - First observed
apicontract_validate
TDQS
Scored across 3 tools
Each tool has a distinct purpose: health check, response validation, and endpoint listing. There is no overlap or ambiguity between them.
All tools share a consistent 'apicontract_' prefix and use lowercase names. There is minor inconsistency between nouns ('status', 'endpoints') and verbs ('validate'), but the pattern is still predictable.
Three tools is on the smaller side but appropriate for a focused API contract utility. Each tool serves a clear, non-redundant function, and the count does not feel artificially inflated or overly thin.
The tool set covers core health check, validation, and endpoint discovery, but lacks broader contract lifecycle operations like importing, diffing, or managing multiple contracts. Agents can perform basic tasks but may need external tooling for full contract workflows.
Related MCP Connectors
Deterministic validation for AI-generated artifacts: JSON Schema, OpenAPI response, SQL syntax.
API monitoring from your editor. Checks the JSON your endpoints return, not just the status code.
Monitor MCP servers, API contracts and AI outputs for schema drift. Alerts on breaking changes.
End-to-end API testing — generate and run tests from OpenAPI, curl, Postman, or real user traffic.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables reading and parsing Swagger/OpenAPI specifications to list API endpoints, get detailed endpoint info, search APIs, and generate TypeScript types for request/response.9-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to browse, read, compare, and validate OpenAPI contracts for providers and consumers.1MIT
- AlicenseBqualityDmaintenanceEnables natural language exploration of OpenAPI/Swagger specs, allowing users to register APIs, browse endpoints, describe schemas, and detect breaking changes through conversational queries.9191 npmMIT
- AlicenseNot gradedqualityCmaintenanceProvides AI coding agents with accurate OpenAPI contract details to prevent hallucinated API calls, supporting multi-version pinning, endpoint discovery, and request validation.33 npmApache 2.0