Skip to main content

MCP server for testing REST API with built-in assertions

Project description

mcp-api-test

pipeline

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_api_test-0.1.3.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_api_test-0.1.3-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file mcp_api_test-0.1.3.tar.gz.

File metadata

  • Download URL: mcp_api_test-0.1.3.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for mcp_api_test-0.1.3.tar.gz
Algorithm Hash digest
SHA256 205a404c82cef5201920caf1c30a506b52b8a68000c9988eb013c37a88084cc7
MD5 9f0911d8f8e48d9fcd8d01d5409d6f11
BLAKE2b-256 743367182751d52632a9e59d5271b544a03b24951cba58baa81af90779841fc5

See more details on using hashes here.

File details

Details for the file mcp_api_test-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: mcp_api_test-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for mcp_api_test-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 66eea3cd0729c3752d19279556413def0dca0c1ac29cc2f1035746a122282d72
MD5 0903ed6f3941940ecb6a7af23cc1293a
BLAKE2b-256 c91ae07c5dc34cf8b5a5d631c78c6190c9465136caf9ed58799ab60e86fb8d5e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page