Enables importing and browsing OpenAPI/Swagger specifications to explore API endpoints, request schemas, and parameter details for local testing and documentation.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@API Testing MCPtest the /api/users endpoint using the dev environment"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@cocaxcode/api-testing-mcp
MCP server for API testing. Lightweight, local, zero cloud dependencies.
Test your APIs directly from Claude Code, Claude Desktop, Cursor, or any MCP client — without leaving your workflow.
Features
HTTP requests — GET, POST, PUT, PATCH, DELETE with headers, body, query params
Authentication — Bearer token, API Key, Basic Auth built-in
Collections — Save, organize, and reuse requests locally
Environments — Manage variables per environment (dev/staging/prod)
Variable interpolation — Use
{{VARIABLE}}in URLs, headers, and bodyResponse metrics — Timing (ms) and response size for every request
Zero cloud dependencies — Everything stored locally as JSON files
Installation
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"api-testing": {
"command": "npx",
"args": ["-y", "@cocaxcode/api-testing-mcp"]
}
}
}Claude Code
claude mcp add api-testing -- npx -y @cocaxcode/api-testing-mcpCustom storage directory
{
"mcpServers": {
"api-testing": {
"command": "npx",
"args": ["-y", "@cocaxcode/api-testing-mcp"],
"env": {
"API_TESTING_DIR": "/path/to/your/.api-testing"
}
}
}
}Tools
request
Execute an HTTP request with optional authentication and variable interpolation.
Relative URLs (starting with /) automatically use BASE_URL from the active environment — no need to write {{BASE_URL}} every time.
// Relative URL — auto-prepends BASE_URL from active environment
request({ method: "GET", url: "/api/users" })
// Equivalent to:
request({ method: "GET", url: "{{BASE_URL}}/api/users" })
// Full example with all options
request({
method: "GET",
url: "/api/users",
headers: { "Authorization": "Bearer {{TOKEN}}" },
query: { "page": "1" },
timeout: 5000
})Auth examples:
// Bearer token
request({ method: "GET", url: "...", auth: { type: "bearer", token: "abc123" } })
// API Key
request({ method: "GET", url: "...", auth: { type: "api-key", key: "mykey", header: "X-API-Key" } })
// Basic Auth
request({ method: "GET", url: "...", auth: { type: "basic", username: "user", password: "pass" } })Response format:
{
"status": 200,
"statusText": "OK",
"headers": { "content-type": "application/json" },
"body": { "users": [] },
"timing": { "total_ms": 142.35 },
"size_bytes": 1024
}collection_save
Save a request to your local collection for reuse.
collection_save({
name: "get-users",
request: { method: "GET", url: "https://api.example.com/users" },
tags: ["users", "read"]
})collection_list
List all saved requests. Optionally filter by tag.
collection_list({ tag: "users" })collection_get
Get the full details of a saved request.
collection_get({ name: "get-users" })collection_delete
Delete a saved request from the collection.
collection_delete({ name: "get-users" })env_create
Create a new environment with optional initial variables.
env_create({
name: "dev",
variables: { "BASE_URL": "http://localhost:3000", "TOKEN": "dev-token" }
})env_list
List all environments and which one is active.
env_set
Set a variable in an environment (defaults to active environment).
env_set({ key: "TOKEN", value: "new-token-value" })env_get
Get a specific variable or all variables from an environment.
env_get({ key: "BASE_URL" })
env_get({}) // returns all variablesenv_switch
Switch the active environment. Active environment variables are used for {{interpolation}}.
env_switch({ name: "prod" })api_import
Import an OpenAPI/Swagger spec from a URL or local file. Endpoints and schemas are stored locally for browsing.
api_import({
name: "my-backend",
source: "http://localhost:3001/api-docs-json"
})
// Or from a local file:
api_import({ name: "my-backend", source: "./openapi.json" })api_endpoints
List endpoints from an imported API. Filter by tag, method, or path.
api_endpoints({ name: "my-backend" })
api_endpoints({ name: "my-backend", tag: "users" })
api_endpoints({ name: "my-backend", method: "POST" })
api_endpoints({ name: "my-backend", path: "/blog" })api_endpoint_detail
Get full details of an endpoint: parameters, request body schema, and responses. Useful to know what data to send.
api_endpoint_detail({ name: "my-backend", method: "POST", path: "/blog" })Storage
All data is stored locally as JSON files in .api-testing/ (in your current working directory by default):
.api-testing/
├── active-env # Name of the active environment
├── collections/
│ ├── get-users.json
│ └── create-post.json
├── environments/
│ ├── dev.json
│ └── prod.json
└── specs/
└── my-backend.json # Imported OpenAPI specsYou can version these files in git if you want to share collections and environments with your team.
Development
git clone https://github.com/cocaxcode/api-testing-mcp.git
cd api-testing-mcp
npm install
npm test
npm run buildTest with MCP Inspector
npx @modelcontextprotocol/inspector node dist/index.jsLicense
MIT
This server cannot be installed
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.