# k11 API Contract QA

> k11 API Contract QA is an open-source MCP server for legal and government. MCP server that shows which services an API change breaks, across five contract formats. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, macOS, Windows, Linux
- **Repository:** https://github.com/k11-software-solutions/k11techlab-api-contract-qa-mcp
- **MCP Registry name:** io.github.K11-Software-Solutions/api-contract-qa
- **Categories:** [legal and government](https://ai-powered.com/categories/legal-and-government), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

Spec-diff tools say a change is breaking but not who it breaks. This server reads a consumers file, `.qa-mcp/consumers.yaml`, listing each consuming service with an owner, a criticality and the fields it reads or sends. A removed field then counts only against consumers that use it, and the verdict is one of breaking, breaking with no known consumer, or compatible. It recommends a human decision when two or more consumers break or a critical one does.

It handles OpenAPI 3.x, Swagger 2.0, GraphQL, gRPC/protobuf, AsyncAPI 2.x and 3.x, and SOAP/WSDL 1.1, with rules specific to each, such as protobuf field-number reuse or GraphQL argument removal. Specs can be files or git refs like `origin/main:openapi.yaml`. Consumer discovery scans source code in Python, Java, TypeScript, Go and others for calls to your API, with file and line.

Checks are deterministic with no LLM calls. A `contract-ci` command writes a pull-request comment listing affected consumers and sets a failing exit code according to `--fail-on`. Live conformance checks and test generation are for REST only. Python 3.10 or newer is required.

## Features

- **Consumer-aware impact:** Counts a breaking change only against the consumers that use the affected field.
- **Six contract formats:** OpenAPI, Swagger, GraphQL, gRPC, AsyncAPI and SOAP/WSDL.
- **Consumer discovery:** Scans consumer code for API calls and drafts consumers.yaml entries.
- **Deployed drift check:** Compares a running service's published contract with the spec.
- **Contract test generation:** Writes pytest with httpx or REST Assured tests for REST.
- **Pull-request CI report:** contract-ci comments with every affected consumer and the reason.

## Good for

- Review whether a pull request breaks other services
- Find who calls an endpoint before removing it
- Detect drift between a deployed GraphQL schema and its spec
- Generate contract tests for a REST API
- Fail CI only when a known consumer breaks

## Install

### Claude Code (Terminal)

```sh
claude mcp add api-contract-qa -- uvx k11-api-contract-qa-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "api-contract-qa": {
      "command": "uvx",
      "args": [
        "k11-api-contract-qa-mcp"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "api-contract-qa": {
      "command": "uvx",
      "args": [
        "k11-api-contract-qa-mcp"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "api-contract-qa": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "k11-api-contract-qa-mcp"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "api-contract-qa": {
      "command": "uvx",
      "args": [
        "k11-api-contract-qa-mcp"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "api-contract-qa": {
      "command": "uvx",
      "args": [
        "k11-api-contract-qa-mcp"
      ]
    }
  }
}
```

## Tools

- `list_operations`: List a contract's operations and detected format.
- `diff_contracts`: Classify every change between two contract versions.
- `assess_impact`: Show which consumers a change breaks and the verdict.
- `discover_consumer_usage`: Find a consumer's calls to your API in its source.
- `check_deployed_contract`: Compare a running service's contract with the spec.
- `check_live_conformance`: Call a running REST endpoint and check the response against the spec.
- `generate_api_tests`: Generate REST contract tests.
- `write_test`: Write generated test files under tests/ or src/test/.

## FAQ

### Does it use an LLM to decide?

No. The README says the rules are deterministic and give the same result every run.

### How does it know who my consumers are?

From a consumers.yaml file; discover_consumer_usage can draft entries from consumer code.

### Which CI exit modes exist?

--fail-on accepts breaking, needs-human, any-breaking and never.

### What runtime does it need?

Python 3.10 or newer; it installs as k11-api-contract-qa-mcp from PyPI.

### Can the generated tests overwrite files?

write_test only writes under tests/ or src/test/ and does not overwrite unless asked.

### Is k11 API Contract QA free?

Yes. k11 API Contract QA is open source, so you can use and self-host it for free.

### How do I add k11 API Contract QA to Claude Code?

Run this command in your terminal: claude mcp add api-contract-qa -- uvx k11-api-contract-qa-mcp

### What are the best alternatives to k11 API Contract QA?

The closest alternatives to k11 API Contract QA are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/k11-api-contract-qa
