Skip to main content
Glama
Mhdd-24

API Contract MCP

by Mhdd-24
README.md
# @mhdd_24/api-contract-mcp

Validate API contracts between services.

Same architecture as [@mhdd_24/sublime-mcp](https://github.com/Mhdd-24/Sublime-MCP).

**Full documentation:** [docs/WIKI.md](./docs/WIKI.md)

---

## How it works (30 seconds)

```
You (chat) → MCP client → api-contract-mcp → API Contract APIs / CLIs / local tools
```

---

## Prerequisites

| Requirement | Notes |
|-------------|--------|
| **Node.js 18+** | ESM TypeScript MCP server |
| **Credentials / CLIs** | See environment variables below |

---

## Install

### Option A — npm (after publish)

```bash
npm install -g @mhdd_24/api-contract-mcp
```

### Option B — npx

```bash
npx @mhdd_24/api-contract-mcp
```

### Option C — clone and build

```bash
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`:

```json
{
  "mcpServers": {
    "apicontract": {
      "command": "npx",
      "args": ["-y", "@mhdd_24/api-contract-mcp"],
      "env": {
        "PROJECT_ROOT": "..."
      }
    }
  }
}
```

**Local development:**

```json
{
  "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

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

ActivityMaintained
ResponsivenessNo issues