MCP server for API testing. 35 tools: HTTP, assertions, flows, OpenAPI, collections.
io.github.cocaxcode/api-testing-mcp MCP Server
The Model Context Protocol (MCP) server io.github.cocaxcode/api-testing-mcp provides API testing capabilities through MCP tools. It supports HTTP operations plus testing constructs such as assertions and flows, with additional support for OpenAPI and collections.
๐ ๏ธ Key Features
API testing tools (HTTP, assertions, flows)
OpenAPI support
Collections support
Tooling count: 35 tools (per provided metadata)
๐ Use Cases
Test REST APIs using HTTP tool support
Validate responses with assertions
Execute multi-step test logic using flows
Work from OpenAPI definitions and collections
โก Developer Benefits
Integrates with MCP clients via Model Context Protocol
Categories of tools cover common API testing needs (HTTP, assertions, flows)
Includes topics aligned to API testing and tooling workflows
โ ๏ธ Limitations
Provided excerpt also references โ42 MCP tools,โ which conflicts with the 35 tools metadata. Further source detail is not included.
The most complete MCP server for API testing โ 42 tools, zero config, nothing else comes close. This is not just a request sender. It is a full testing workbench: HTTP requests with assertions, multi-step flows with variable extraction, OpenAPI import with schema-aware mock data, load testing with percentile metrics, response diffing across environments, bulk test runners, reusable collections, environment groups with directory scoping and persistent defaults, Postman import/export, and cURL export. All from natural conversation. No accounts, no cloud, no generated files. Everything runs inline and stores as plain JSON you own.
Just Talk to It
You don't need to learn tool names or parameters. Describe what you want and the AI picks the right tool.
code
"Create a group called my-project and add this directory as scope"
"Set up a dev environment with BASE_URL http://localhost:3000"
"Switch to prod for this session"
"Set dev as the default environment"
"Import my API spec from /api-docs-json"
"Show me all user endpoints"
"GET /users"
"Create a user with random data"
"Verify that DELETE /users/5 returns 204"
"Login as admin, extract the token, then fetch dashboard stats"
"How fast is /health with 50 concurrent requests?"
"Run all my saved smoke tests"
"Compare the users endpoint between dev and prod"
"Export the create-user request as curl"
"Export my collection to Postman"
If you've imported an OpenAPI spec, the AI already knows every endpoint, every required field, every valid enum value. When you say "create a blog post", it reads the schema and builds the request correctly โ no guessing.
Installation
Claude Code
bash
claude mcp add --scope user api-testing -- npx -y @cocaxcode/api-testing-mcp@latest
Claude Desktop
Add to your config file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):
Once installed, set up an environment so relative paths resolve automatically:
code
"Create an environment called dev with BASE_URL http://localhost:3000"
If your API has a Swagger/OpenAPI spec, import it:
code
"Import my API spec from http://localhost:3000/api-docs-json"
Verify with: "List my environments" โ you should see the one you just created.
Features
HTTP Requests
Send any HTTP method with headers, query params, JSON body, auth, and {{variable}} interpolation. Relative URLs auto-resolve against BASE_URL.
code
"POST to /api/users with name Jane and email jane@company.com using my bearer token"
Supports: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS โ Bearer / API Key / Basic auth โ custom timeouts.
Compression modes (v0.13+)
AI agents pay for every byte that lands in their context window. By default, request now returns a compressed response that cuts 70-95% of those tokens without losing debugging value. Three optional parameters control it:
Param
Values
What it does
verbosity
'minimal' / 'normal' (default) / 'full'
Controls detail level
only_fields
['user.id', 'items[*].name']
Returns only these body paths (dot-notation + wildcards)
max_body_bytes
number (default 2048)
Body size cap for 'normal'
Modes:
minimal โ only status, timing, size_bytes, first 200 chars of body. Perfect for health checks, polling loops, or fire-and-forget calls. Saves ~95% tokens.
normal(default) โ filtered headers (drops Date, Server, CF-*, Set-Cookie, etc.) + body truncated to max_body_bytes. Covers ~80% of debugging use cases. Saves ~75% tokens.
full โ complete response untouched. Use when you explicitly need every header or the full body.
Typical savings on a 5 KB JSON response (โ1,500 tokens):
Mode
Tokens consumed
Savings
full
~1,500
0% (baseline)
normal
~300-400
~75%
minimal
~50-80
~95%
only_fields: ['data.id']
~30
~98%
For a head-to-head comparison against curl, WebFetch and other native alternatives with measured numbers, see Native alternatives below.
Recovering full responses: every compressed response includes a call_id. If you need the full body later, call inspect_last_response({ call_id }) โ no need to re-execute the request. This works for request, assert, and each step of flow_run. Responses are kept in a 20-slot ring buffer and persisted to .api-testing/last-responses/ with a 1-hour TTL.
json
// Example: normal (default) response{"call_id":"k3m9a2xp","status":200,"statusText":"OK","method":"GET","url":"https://api.example.com/users/1","timing":{"total_ms":142},"size_bytes":5324,"headers":{"content-type":"application/json"},"body":{"id":1,"email":"...","...":"..."},"body_truncated":true,"hint":"Body truncated to 2048 bytes (full size: 5324B). Call inspect_last_response({ call_id: \"k3m9a2xp\" }) for the full body.","tokens_saved_estimate":820}
Native alternatives: real token cost
How this MCP compares against the native options Claude Code has when api-testing is not available (Bash + curl, WebFetch, etc.).
TL;DR: compared to raw curl, request saves between 65% and 97% of context tokens depending on the mode, with no loss of debugging information. Measured on a real call to GET /api/v1/blog returning 8 posts (~8.7 KB of JSON, 19 response headers):
How the agent calls it
Uses MCP?
Tokens consumed
Delta vs curl
Bash + curl (raw stdout)
โ native
~2,170
baseline
WebFetch (LLM summary)
โ native
~400-800
โ65%, but no auth / no envs / no inspect
request verbosity=full
โ MCP
~2,170
0% (same as curl, no compression)
request verbosity=normal(default)
โ MCP
~750
โ65%
request verbosity=minimal
โ MCP
~50
โ97%
request with only_fields: ["data[*].id","data[*].title"]
โ MCP
~190
โ91%
Why this table's numbers differ slightly from the "Compression modes" section above: these come from a single real-world response, while the previous table shows typical savings on a synthetic 5 KB response. Trend and order of magnitude are the same.
Notes:
The default mode (normal) already saves 65% without any configuration: it filters out noisy headers (Date, Server, CF-*, Set-Cookieโฆ) and caps the body at 2048 bytes.
only_fields accepts dot-paths with array index and wildcard support (items[*].name) โ returns only the fields you ask for.
The MCP also adds features that have no direct native equivalent: {{variable}} interpolation, stored environments, auth schemas, flows, Postman import/export, and inspect_last_response to recover the full body without re-hitting the server.
Every registered MCP adds a fixed overhead of ~300-600 tokens per session (its instructions block + tool names). Typical break-even: 1-2 real calls per session.
Assertions
Validate responses with structured pass/fail results:
code
"Verify that GET /api/health returns 200, body.status is ok, and responds in under 500ms"
Execute two requests and compare their responses field by field. Detect regressions or compare environments.
code
"Compare the users endpoint between dev and prod"
Bulk Testing
Run every saved request in a collection (or filter by tag) and get a summary:
code
"Run all my saved smoke tests"
code
BULK TEST โ 8/8 passed | 1.2s total
health โ GET /health โ 200 (45ms)
list-users โ GET /users โ 200 (123ms)
create-post โ POST /blog โ 201 (89ms)
login โ POST /auth/login โ 200 (156ms)
Collections
Save requests for reuse with tags. Build regression suites.
code
"Save this request as create-user with tags auth, smoke"
"List all requests tagged smoke"
Environments
Environments hold your variables โ BASE_URL, tokens, API keys โ and keep them separated by context. The system has three core concepts:
Group. A group organizes environments and binds them to directories. A group has N scopes (directories) that share its environments, and exactly one default environment. When you create an environment inside a group, it belongs to that group. When you cd into a directory that is a scope of a group, its environments become available automatically.
Default. The default environment activates automatically when you enter a scope of its group. It persists between sessions โ restart your editor, reopen your terminal, and the default is still there. Set it once and forget about it.
Active. The active environment is what is being used right now for variable resolution. It starts as the default when you enter a scope, but you can switch it at any time. The active selection is session-only โ it resets to the default on restart.
Global environments (not associated with any group) still exist. They require explicit activation with env_switch and do not persist between sessions.
Practical example:
code
"Create a group called my-api"
"Add this directory as scope to my-api"
"Create a dev environment with BASE_URL http://localhost:3000" <- auto-joins group, auto-default
"Create a prod environment with BASE_URL https://api.example.com"
"List environments" <- shows dev (active, default) and prod
"Switch to prod" <- session only
"Set prod as default" <- persists
Automatic interpolation. Any {{variable}} in URLs, headers, query params, or request bodies is resolved against the active environment before the request fires. Set BASE_URL once and every relative path just works.
Your credentials never leave your machine. Environment files are plain JSON stored in ~/.api-testing/. Nothing syncs to any cloud. Nothing gets embedded in exports. Nothing gets tracked by git. Your tokens and secrets stay exactly where they should: on your disk, under your control.
Postman Import & Export
Bidirectional Postman support. Migrate seamlessly between Postman and your AI workflow.
code
"Import my Postman collection from ./exported.postman_collection.json"
"Export my collection to Postman"
"Export the dev environment for Postman"
Import details
Collection: Postman v2.1 format. Folders become tags. Auth inherited from folders/collection level. Supports raw JSON, x-www-form-urlencoded, form-data bodies.
Tip: You don't need to call tools directly. Describe what you want and the AI picks the right one.
Storage
Everything is local. No database, no cloud sync, no telemetry. All data lives in ~/.api-testing/ as plain JSON files you can read, back up, or delete at any time.
code
~/.api-testing/
โโโ groups/ # Environment groups with scopes and defaults
โโโ environments/ # Environment variables โ tokens, keys, passwords
โโโ collections/ # Saved requests (shareable, no secrets)
โโโ specs/ # Imported OpenAPI specs
โโโ project-envs.json # Session-only active environments (cleared on restart)
Global storage vs project exports. The ~/.api-testing/ directory is your private, global store โ this is where credentials live and they never leave. When you export a collection or environment, it goes to .atm/ in your project root. That folder is auto-added to .gitignore on first export, but even if you choose to commit it, your credentials stay in ~/.api-testing/ and are never copied into .atm/. You can safely share .atm/ exports with your team without leaking secrets.