API Reference
All 28 REST API endpoints exposed by the MCP Lens backend.
All endpoints return JSON. When
MCP_LENS_API_KEY is set in .env, all routes require an X-API-Key header.
Server Management
Base path: /api/servers
| Method | Path | Description |
|---|---|---|
| GET | /api/servers | List all configured MCP servers |
| GET | /api/servers/{name} | Get a single server config |
| POST | /api/servers | Add a new server |
| PUT | /api/servers/{name} | Update server config |
| DELETE | /api/servers/{name} | Remove a server |
Tools & Evaluation
Base path: /api/servers
| Method | Path | Description |
|---|---|---|
| POST | /api/servers/{name}/test | Test MCP connection |
| POST | /api/servers/{name}/fetch-tools | Fetch tools from MCP server |
| GET | /api/servers/{name}/tools | Get cached tool definitions |
| POST | /api/servers/{name}/tools/upload | Upload tool definitions via YAML |
| GET | /api/servers/{name}/tools/template | Download YAML template |
| DELETE | /api/servers/{name}/tools/uploaded | Delete uploaded tools |
| GET | /api/servers/{name}/evaluate | Quick compatibility evaluation |
| GET | /api/servers/{name}/evaluate/full | Full multi-layer evaluation report |
| GET | /api/servers/{name}/evaluate/report | Get cached evaluation report |
| GET | /api/servers/{name}/evaluate/llm?llms=name1,name2 | Run LLM-assisted evaluation |
| POST | /api/servers/{name}/evaluate/false-positive | Mark/unmark false positive (body: check_key, justification) |
| POST | /api/servers/{name}/ground-truth | Upload ground truth YAML |
| GET | /api/servers/{name}/ground-truth | Get ground truth data |
| DELETE | /api/servers/{name}/ground-truth | Delete ground truth |
| GET | /api/servers/{name}/ground-truth/template | Download ground truth template |
LLM Configuration
Base path: /api
| Method | Path | Description |
|---|---|---|
| GET | /api/llm-configs | List available LLM configurations from llm.json |
Authentication
Base path: /api/auth
| Method | Path | Description |
|---|---|---|
| GET | /api/auth/status/{name} | Check auth status for a server |
| POST | /api/auth/bearer-token/{name} | Store a bearer token |
| POST | /api/auth/api-key/{name} | Store an API key |
| POST | /api/auth/discover | Discover OAuth/DCR endpoints |
| POST | /api/auth/start/{name} | Start OAuth authorization flow |
| GET | /api/auth/callback | OAuth callback handler |