MCP Integration
MiniAPM includes a built-in Model Context Protocol (MCP) server that allows AI assistants like Claude to query your application’s performance data and errors.
What is MCP?
Section titled “What is MCP?”The Model Context Protocol is a standard for connecting AI models to external data sources and tools. With MCP, you can ask Claude questions like:
- “What errors happened in production today?”
- “Which routes are slowest?”
- “Show me details about this error”
- “What’s the system status?”
Features
Section titled “Features”- list_errors - Find recent errors with filtering
- error_details - Get full error information with stack traces
- slow_routes - Identify performance bottlenecks
- system_status - Overview of system health
Deployment Modes
Section titled “Deployment Modes”Stdio Mode (Local)
Section titled “Stdio Mode (Local)”For local development with Claude Desktop:
miniapm mcpThis starts MCP in stdio mode, reading from stdin and writing to stdout.
HTTP Mode (Remote)
Section titled “HTTP Mode (Remote)”For remote or shared access:
miniapm server # MCP is available at /mcpThe MCP endpoint is available at POST /mcp with API key authentication.
Quick Start
Section titled “Quick Start”- Start MiniAPM with MCP enabled
- Configure your AI assistant (see Setup)
- Ask questions about your application
Example Interactions
Section titled “Example Interactions”You: “What errors happened in the last hour?”
Claude: “I found 3 errors in the last hour:
RuntimeError: Connection timeout- 5 occurrencesActiveRecord::RecordNotFound- 2 occurrencesNoMethodError: undefined method 'name'- 1 occurrence
Would you like me to show details for any of these?”
You: “Which routes are slowest?”
Claude: “Here are the slowest routes by P95 latency:
POST /api/reports- 2.3s P95GET /api/users/:id/history- 1.1s P95GET /api/search- 890ms P95
The reports endpoint seems unusually slow. Should I investigate further?”
What’s Next?
Section titled “What’s Next?”- Setup - Configure Claude Desktop or HTTP mode
- Available Tools - Full reference for all MCP tools