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.3.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.3.0
File Size Uploaded Provenance Actions
mcp_api_test-0.3.0.tar.gz 25.2 kB Without provenance Details for mcp_api_test-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 41.2 kB

Release files / mcp_api_test-0.3.0.tar.gz

Download URL mcp_api_test-0.3.0.tar.gz
Size 25.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6f5be04f67354802ef8e987cf82e278d7957e27d8317cc300169521bfcf7ec15
BLAKE2b-256 checksum
How to use checksums
1bec75d77b80b393af268250897b3f9b2ceb02d97b12499d937f814227de79f3
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.3.0-py3-none-any.whl

Download URL mcp_api_test-0.3.0-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8fcdb2bb98aa135280bef1734eb59b86f556e2c780dbf3e3c9042c4ae5c6d455
BLAKE2b-256 checksum
How to use checksums
201e1254cf16718e7cad2c6a152210c9df236d5f1ee90076b5045b6bad541956
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.3.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