Skip to main content

mcp-api-test

pipeline PyPI License PyPI Python Version

An AI-native API testing engine that enables LLM agents to execute, validate, and reason about REST APIs using natural language or cURL inputs.

Unlike traditional testing frameworks, mcp-api-test exposes API testing as a first-class capability for AI agents rather than a developer-facing tool. LLM-powered clients invoke the run_test_api tool directly, making API validation a building block for autonomous coding agents, not a separate human-driven workflow.

It complements (rather than replaces) tools like pytest, Postman, and Playwright.

Breaking changes in v0.2.0. The server now runs on mcp 2.x, and the package layout moved from flat top-level modules to a proper mcp_api_test package. If you import internals directly, you may update to from mcp_api_test.server import .... MCP client configuration (OpenCode, Claude Desktop, Claude Code) is unaffected. See the changelog for details.

Use cases

  • QA & test engineering: prompt an agent with natural language instead of crafting Postman requests
  • Post-deployment regression: have an agent smoke-test critical paths after a deploy
  • Quick validation: test an endpoint inline during a coding session
  • CI/CD automation: agents validate deployments autonomously in pipelines

Token efficiency. Agents get deterministic, structured results in a single tool call instead of parsing raw curl output. Fewer tokens, fewer hallucinations.

Install

pip install mcp-api-test

Or from source:

git clone git@gitlab.com:ryaneatfood/mcp-api-testing.git
cd mcp-api-testing
pip install -e .

Requires Python >= 3.10.

Quick start

Configure your MCP client to use the server. For OpenCode, add to opencode.json:

{
  "mcp": {
    "mcp-api-test": {
      "type": "local",
      "command": ["mcp-api-test"],
      "enabled": true
    }
  }
}

For Claude Desktop, add to claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-api-test": {
      "command": "mcp-api-test"
    }
  }
}

Then prompt your agent:

"Test this API: curl -X POST https://api.example.com/v1/users -H 'Authorization: Bearer xxx' -d '{"name":"test"}', ensure status code is 201 and response contains 'id'"

The agent invokes run_test_api, validates against the expected contract, and returns structured pass/fail results.

Documentation

Full documentation is hosted on this page, and another way to navigate the docs:

  • Getting Started: installation and client setup
  • Usage: cURL mode, structured mode, assertions, response format
  • Guides: troubleshooting, development, configuration
  • Reference: full parameter reference

License

MIT

Metadata

Release files for mcp-api-test 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-api-test 0.2.0
File Size Uploaded Provenance Actions
mcp_api_test-0.2.0.tar.gz 14.3 kB Without provenance Details for mcp_api_test-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcp-api-test 0.2.0
File Interpreter ABI Platform Actions
mcp_api_test-0.2.0-py3-none-any.whl Python 3 none any Details for mcp_api_test-0.2.0-py3-none-any.whl

Total release size: 26.0 kB

Release files / mcp_api_test-0.2.0.tar.gz

Download URL mcp_api_test-0.2.0.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1b99119ac81fc5c70e9cda46de9b5353abdd77e8341caa95cfa39d443c736fe0
BLAKE2b-256 checksum
How to use checksums
8ebb13e4ef1099e5f00e433e8c7eb3e116951ab6f5c8a4206538e078445e5b92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / mcp_api_test-0.2.0-py3-none-any.whl

Download URL mcp_api_test-0.2.0-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc82d42c6f947876034dadaab9499e01d36e7bd2e8324e952988c1206812e0fc
BLAKE2b-256 checksum
How to use checksums
42907d7ceb7e58fe872322e2b391b240dfe66d82366be397d34138efff478cee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for mcp-api-test 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page