Transform your API testing with the MCP server, use Claude to test, debug, authenticate, validate responses, and measure performance via natural conversation.
API Lab MCP is an MCP-compatible server that brings conversational API testing to Claude Desktop and Claude Code. Once installed and registered as an MCP tool, it allows developers and QA engineers to interact with APIs through natural language—asking Claude to make requests, validate responses, simulate authentication flows, collect performance metrics, and generate tests or documentation from conversations.
The server removes repetitive scripting for common API tasks and centralizes testing workflows inside the assistant environment. Instead of switching to Postman, terminal scripts, or separate test runners, you can ask Claude to exercise endpoints, analyze failures, run batch tests, and output structured reports or OpenAPI-based test suites.
Features
AI-driven conversational testing (works with Claude Desktop and Claude Code)
Set cookies like JSESSIONID for authenticated flows
CSRF tokens
Read and submit CSRF tokens from responses
Installation / Configuration
Install via npm (global recommended):
# Global installnpm install -g api-lab-mcp
Add to Claude Code:
# Add installed MCP to Claude Codeclaude mcp add api-lab-mcp api-lab-mcp# Or use npx without installingclaude mcp add api-lab-mcp "npx -y api-lab-mcp"
Local development workflow:
git clone https://github.com/atototo/api-lab-mcp.gitcd api-lab-mcpnpm installnpm run build# Register a local server binary with Claudeclaude mcp add api-lab-local "node $(pwd)/dist/mcp/server.js"
Claude Desktop configuration (macOS / Linux example):
Validate responses, suggest fixes for failures, extract fields
Reporter
Produce performance and test result reports
Use Cases (concrete examples)
Development: “Test GET http://localhost:3000/api/users and show me JSONPath $.data[0].id” Claude will run the request, check the path, and return the extracted value or an assertion error.
Debugging authentication: “Why is my login endpoint returning 401?” The Analyzer inspects request headers, body, and expected auth flow and suggests missing tokens, cookie issues, or CSRF failures.
Spec-driven test creation: “Create tests from my OpenAPI spec at http://localhost:3000/openapi.json” The server fetches the spec, generates test cases for common response codes, parameter combinations, and optional schema validations.
Performance validation: “Verify all endpoints respond under 200ms in staging” Batch Runner executes endpoints against the staging base URL and returns a performance report with response times and any violations.
Session flows: “Use cookie JSESSIONID=ABC123 and test /account and /transactions” Auth Manager sets the cookie and runs the requested sequence, preserving session state between requests.
Tips and Best Practices
Provide base URLs and environment variables in your prompt or via the server UI to make testing reproducible across environments.
Use OpenAPI specs where available to get more comprehensive, schema-based validations.
Export generated tests to integrate with CI pipelines or to reproduce scenarios outside the assistant.
When debugging, ask Claude to show raw request and response headers to spot mismatches quickly.
Where to get help
Open issues or feature requests on the GitHub repo: https://github.com/atototo/api-lab-mcp
Consult example folders in the repo for common workflows and configuration snippets.
This tool is intended for developers and QA engineers who want to centralize API testing inside a conversational assistant workflow while retaining the ability to export, reproduce, and automate tests in CI.