Skip to main content
Glama
API Contract MCP

API Contract MCP

by Mhdd-24

@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 tools

Related MCP server: LockSpec

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-mcp

Option B — npx

npx @mhdd_24/api-contract-mcp

Option 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.js

Configure 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

PROJECT_ROOT

Default project/repository root


Tools

Tool

Description

apicontract_status

Health check for API Contract MCP.

apicontract_validate

Validate a response against an expected schema/JSON.

apicontract_endpoints

List endpoints from OpenAPI JSON.


License

ISC

Available Tools

3 tools
apicontract_endpointsB

List endpoints from OpenAPI JSON.

Inputs: spec (required).

apicontract_statusB

Health check for API Contract MCP.

Inputs: no named parameters.

apicontract_validateB

Validate a response against an expected schema/JSON.

Inputs: actual (required), expected (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a distinct purpose: health check, response validation, and endpoint listing. There is no overlap or ambiguity between them.

    Naming Consistency4/5

    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.

    Tool Count4/5

    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.

    Completeness3/5

    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.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers