When working with REST APIs that have an OpenAPI/Swagger spec, use the apilot MCP tools to inspect endpoints and send requests — without loading the full spec into context.
- User says "look at the API" / "what endpoints are available" / "check the spec"
- User wants to migrate data between environments ("copy config from dev to test")
- User needs to understand an API's request/response structure before writing code
- User wants to test an API endpoint directly
- The OpenAPI spec is large (1MB+) and would blow context if loaded as text
| Tool | Purpose |
|---|---|
apilot_spec_load |
Load an OpenAPI/Swagger spec from file path or URL |
apilot_route_list |
List endpoints with optional tag/method/keyword filter |
apilot_route_show |
Show full details of one endpoint (params, request body, responses) |
apilot_schema_show |
Show a named model from components/schemas |
apilot_request_send |
Send a real HTTP request to an endpoint on a named environment |
apilot_env_list |
List configured environments from apilot.config.json |
apilot_generate_example |
Generate example request body from schema |
apilot_spec_load({ source: "./openapi.yaml" })
→ "Config Service v1.0.0 — 42 routes, tags: config, users, auth"
apilot_route_list({ tag: "config" })
→ GET /api/configs List all configurations [config]
POST /api/configs Create a configuration [config]
PATCH /api/configs/{id} Update a configuration [config]
apilot_route_show({ method: "GET", path: "/api/configs" })
→ GET /api/configs
Parameters:
page (query): integer — Page number
Responses:
200: array
items: object
id (required): string
key (required): string
value (required): string
apilot_request_send({
method: "GET",
path: "/api/configs",
env: "dev"
})
→ HTTP 200 OK (142ms)
Response Body:
[{"id": "1", "key": "feature_x", "value": "true"}, ...]
apilot_request_send({
method: "POST",
path: "/api/configs",
env: "test",
body: "{\"key\": \"feature_x\", \"value\": \"true\"}"
})
→ HTTP 201 Created (89ms)
Environments are defined in apilot.config.json at the project root:
{
"version": 1,
"defaultSpec": "./openapi.yaml",
"environments": {
"dev": {
"baseUrl": "https://dev-api.example.com",
"stage": "development",
"auth": {
"type": "bearer",
"token": "{{DEV_API_TOKEN}}"
},
"variables": {
"tenantId": "dev-tenant-001"
}
},
"test": {
"baseUrl": "https://test-api.example.com",
"stage": "testing",
"auth": {
"type": "bearer",
"token": "{{TEST_API_TOKEN}}"
}
}
}
}{{VAR}}in auth tokens resolves fromprocess.envat runtimevariablesvalues are substituted into{{var}}placeholders in request bodies and URLsdefaultSpeclets you omit thespecIdparameter from tool calls
- Always
apilot_spec_loadfirst — other tools need a loaded spec - If only one spec is loaded,
specIdis optional in all tools - Use
apilot_route_listwithsearchfor keyword-based discovery ("config", "user", "auth") - Use
apilot_generate_exampleto get a valid request body scaffold before sending apilot_route_showoutput usesformatSchema— compact indented text, not JSON- For data migration: GET from source env, then POST/PUT to target env with the response body