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.

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

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.1.4
File Size Uploaded Provenance Actions
mcp_api_test-0.1.4.tar.gz 11.7 kB Without provenance Details for mcp_api_test-0.1.4.tar.gz

Built distribution (wheel)

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

Total release size: 22.5 kB

Release files / mcp_api_test-0.1.4.tar.gz

Download URL mcp_api_test-0.1.4.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1e8f6c8b404382451dc8b7b31a56db4ed0e5da9a046fe4f3fecbfd8ebbd92ad4
BLAKE2b-256 checksum
How to use checksums
a3b705f379289116e5b3faafa7a4dd419f141913d828f4cb4c4873d25398fd41
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.1.4-py3-none-any.whl

Download URL mcp_api_test-0.1.4-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4d1b8a3a0a93500c039aa8a03bd29c419b25f5cea20bf7d9904fc4dfe687ac09
BLAKE2b-256 checksum
How to use checksums
70bb3a375b95bcca5ecef248da7cf8f598e4f075cfd0f055f73b5c91debc8d8c
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.1.4

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