Skip to content

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.

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?”
  • 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

For local development with Claude Desktop:

Terminal window
miniapm mcp

This starts MCP in stdio mode, reading from stdin and writing to stdout.

For remote or shared access:

Terminal window
miniapm server # MCP is available at /mcp

The MCP endpoint is available at POST /mcp with API key authentication.

  1. Start MiniAPM with MCP enabled
  2. Configure your AI assistant (see Setup)
  3. Ask questions about your application

You: “What errors happened in the last hour?”

Claude: “I found 3 errors in the last hour:

  1. RuntimeError: Connection timeout - 5 occurrences
  2. ActiveRecord::RecordNotFound - 2 occurrences
  3. NoMethodError: 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:

  1. POST /api/reports - 2.3s P95
  2. GET /api/users/:id/history - 1.1s P95
  3. GET /api/search - 890ms P95

The reports endpoint seems unusually slow. Should I investigate further?”