mcp-api-test
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
curloutput. 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 GitLab Pages (or build locally with mkdocs serve).
- Getting Started: installation and client setup
- Usage: cURL mode, structured mode, assertions, response format
- Guides: troubleshooting, development, configuration
- Reference: full parameter reference
License
MIT
Release files for mcp-api-test 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mcp_api_test-0.1.3.tar.gz | 9.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_api_test-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.6 kB
Release files / mcp_api_test-0.1.3.tar.gz
| Download URL | mcp_api_test-0.1.3.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
205a404c82cef5201920caf1c30a506b52b8a68000c9988eb013c37a88084cc7
|
|
BLAKE2b-256 checksum How to use checksums |
743367182751d52632a9e59d5271b544a03b24951cba58baa81af90779841fc5
|
| 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.3-py3-none-any.whl
| Download URL | mcp_api_test-0.1.3-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
66eea3cd0729c3752d19279556413def0dca0c1ac29cc2f1035746a122282d72
|
|
BLAKE2b-256 checksum How to use checksums |
c91ae07c5dc34cf8b5a5d631c78c6190c9465136caf9ed58799ab60e86fb8d5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|