MCP Server · npm package

AI-Powered API Testing & Documentation

An MCP server that gives AI agents 9 tools to test, validate, and document your APIs. Endpoint discovery, request generation, response validation, contract testing, and OpenAPI generation — all callable programmatically.

Get API Testing MCP — $25/mo See All 9 Tools

$25/mo. No usage limits. Cancel anytime.

9 MCP tools npm: truss-api-mcp REST · OpenAPI 3.0 Claude Code · Cursor TypeScript

APIs break silently in production

Most teams test APIs manually with Postman collections that go stale, or they skip testing altogether and rely on users to find regressions. API documentation is even worse — written once at launch, outdated within weeks, never trusted again.

40%
Of production outages are caused by undetected API contract breakages during deploys
8 hrs
Average time to write a comprehensive Postman test suite for a 20-endpoint API
Developer productivity lift when working from accurate, up-to-date API documentation

9 MCP tools for AI-driven API testing

TRUSS API Testing MCP lets AI agents test any REST API programmatically. From endpoint discovery to contract validation and OpenAPI generation — agents handle the entire testing lifecycle.

discover_endpoints

Endpoint Discovery

Automatically discover API endpoints from an OpenAPI spec, Swagger file, or by crawling a base URL. Returns a structured list of routes, methods, and parameters.

generate_requests

Request Generation

Generate valid and edge-case HTTP request payloads for any endpoint based on schema definitions. Includes boundary values, null fields, and type mismatches.

validate_response

Response Validation

Check HTTP responses against expected schemas, status codes, and headers. Flag missing fields, type mismatches, and unexpected response shapes.

run_contract_tests

Contract Testing

Verify that your API conforms to its OpenAPI contract. Detects breaking changes: removed fields, changed types, new required parameters, altered status codes.

test_auth

Authentication Testing

Test API authentication flows: Bearer tokens, API keys, OAuth2, and cookie-based auth. Verify that protected endpoints reject unauthorized requests correctly.

run_load_test

Load Testing

Send concurrent requests to measure throughput, latency percentiles (p50/p95/p99), and error rates under load. Identify bottlenecks before they hit production.

generate_openapi

OpenAPI Generation

Observe your API endpoints and auto-generate a complete OpenAPI 3.0 specification. Ready for Swagger UI, Postman import, or any API documentation portal.

diff_api_versions

API Version Diffing

Compare two versions of an API or OpenAPI spec and produce a structured diff of breaking vs non-breaking changes. Use in CI to block breaking deploys.

mock_api

API Mocking

Generate a mock server from an OpenAPI spec that returns valid example responses. Lets frontend teams build against APIs before the backend is ready.

From install to tested API in 60 seconds

TRUSS API Testing MCP is a standard MCP server. Install via npm, add to your agent config, and start testing any REST API immediately.

  1. 01

    Install and configure

    Install via npx. Add your target API's base URL and optional OpenAPI spec location to the MCP environment config.

  2. 02

    Add to your MCP client

    Add to Claude Code, Cursor, or any MCP-compatible client. The 9 API testing tools are available immediately in your agent's tool list.

  3. 03

    Let your agent test the API

    Ask your agent to "discover and test all API endpoints" or "check for breaking changes in this deploy." The agent calls the MCP tools, builds a test suite, and reports issues with exact request/response details.

# Claude Code / Cursor MCP config { "mcpServers": { "api-testing": { "command": "npx", "args": ["truss-api-mcp"], "env": { "API_BASE_URL": "https://api.yourservice.com", "OPENAPI_SPEC_URL": "https://api.yourservice.com/openapi.json", "TRUSS_API_KEY": "your-api-key" } } } }

Simple, flat pricing

One plan. Unlimited API testing. $25/mo flat.

Pro
$25/mo

Unlimited API testing for one developer or CI environment.

  • All 9 MCP tools
  • Any REST API
  • OpenAPI 3.0 support
  • Contract testing
  • API version diffing
  • Load testing
  • API mock generation
  • Works with Claude Code & Cursor
Get API Testing MCP

All 9 API testing tools

  1. 01 discover_endpoints — Auto-discover API routes from OpenAPI spec or base URL crawl
  2. 02 generate_requests — Generate valid and edge-case request payloads for any endpoint
  3. 03 validate_response — Check responses against expected schema, status codes, and headers
  4. 04 run_contract_tests — Verify API conforms to its OpenAPI contract, detect breaking changes
  5. 05 test_auth — Test authentication flows and verify access control is enforced
  6. 06 run_load_test — Measure throughput, latency percentiles, and error rates under load
  7. 07 generate_openapi — Auto-generate OpenAPI 3.0 spec from observed API behavior
  8. 08 diff_api_versions — Diff two API specs and classify breaking vs non-breaking changes
  9. 09 mock_api — Spin up a mock server returning valid example responses from spec

Frequently asked questions

What APIs can the API Testing MCP server test?

Any REST API — public or private, local dev server or production. Provide a base URL and optional OpenAPI spec. The agent uses discover_endpoints to map all available routes before testing.

How does AI API testing differ from Postman or manual testing?

Postman requires you to manually build and maintain test collections. With MCP, your AI agent actively reasons about what to test, generates edge cases you'd miss manually, and can update its test suite based on API changes automatically.

Can it generate OpenAPI documentation automatically?

Yes. The generate_openapi tool observes your API, infers request/response schemas, and produces a standards-compliant OpenAPI 3.0 specification ready for Swagger UI, Postman, or any API portal.

Does it work with Claude Code and Cursor?

Yes. TRUSS API Testing MCP is a standard MCP server. Add it to your mcpServers config in Claude Code, Cursor, or any MCP-compatible client and the 9 tools appear immediately.

Stop writing Postman collections by hand

Give your AI agents the tools to discover, test, and document any API automatically. Install in 60 seconds.

Get API Testing MCP — $25/mo

Flat $25/mo. No usage limits. Cancel anytime.