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.1

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.1
File Size Uploaded Provenance Actions
mcp_api_test-0.2.1.tar.gz 17.9 kB Without provenance Details for mcp_api_test-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 30.6 kB

Release files / mcp_api_test-0.2.1.tar.gz

Download URL mcp_api_test-0.2.1.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cdf9dff59369ab471653fbbaf06cd40d62289b1375da88ccc8dc19b1255d1612
BLAKE2b-256 checksum
How to use checksums
66045d886a63d3292443c290b705cb687c224c2543ef25b96c5bbe08646c4597
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.1-py3-none-any.whl

Download URL mcp_api_test-0.2.1-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d5f0aa424d30ec414617175f93f554b6b5e0fdb7a1c4c532f3fd7d83ed0a2a8
BLAKE2b-256 checksum
How to use checksums
a5b0e092aee372a3f54a9b5a6e4bfa26fda0886483544c41de4bbceb4bd61611
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.1

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