使用说明
TRUSS API Testing MCP
API testing and documentation tools for Claude Code. Test endpoints, parse OpenAPI specs, validate responses, generate clients, and more — all from your AI assistant.
Tools
Free Tier
| Tool | Description |
|---|---|
test_endpoint |
Send HTTP request and get structured response (status, headers, body, timing, size) |
parse_openapi |
Parse an OpenAPI 3.x or Swagger 2.0 spec and list all endpoints |
validate_response |
Validate API response against expected status and JSON Schema |
Pro Tier ($25/mo)
| Tool | Description |
|---|---|
generate_openapi |
Auto-generate OpenAPI spec from example requests/responses |
generate_tests |
Generate API test suite (Jest, Vitest, or Pytest) |
mock_server |
Generate mock server config from OpenAPI spec |
compare_specs |
Diff two specs and find breaking changes |
generate_client |
Generate typed API client (TypeScript, Python, Go) |
Installation
Claude Desktop / Claude Code
Add to your MCP configuration:
{
"mcpServers": {
"truss-api-testing": {
"command": "npx",
"args": ["-y", "truss-api-mcp"],
"env": {
"TRUSS_LICENSE_KEY": "your-key-here"
}
}
}
}
From Source
git clone https://github.com/claw-factory/truss-api-mcp.git
cd truss-api-mcp
npm install
npm run build
npm start
Usage Examples
Test an endpoint
Use test_endpoint to send a GET request to https://api.example.com/users
Parse an OpenAPI spec
Use parse_openapi to analyze this spec: <paste your spec>
Generate a TypeScript client
Use generate_client with this OpenAPI spec to create a TypeScript fetch client
Compare API versions
Use compare_specs with the old and new OpenAPI specs to find breaking changes
Environment Variables
| Variable | Required | Description |
|---|---|---|
TRUSS_LICENSE_KEY |
No | Pro license key for premium features |
License
MIT
A2A Discovery
This server publishes a Google A2A Protocol Agent Card, making it discoverable by any A2A-compatible agent framework (LangGraph, CrewAI, Google ADK, AutoGen, and others).
Agent Card: agent-card.json
The agent card describes this server's skills, capabilities, input/output modalities, and authentication requirements in a machine-readable format. A2A clients can use it to discover and invoke tools automatically without manual configuration.
# Fetch the agent card
curl https://raw.githubusercontent.com/claw-factory/truss-api-mcp/main/agent-card.json
