Self-Hosted MCP
The self-hosted MCP server runs entirely on your machine, connecting to Scout’s API with your API key. It’s available as a Docker image or Python package.
Source code and full documentation are on GitHub.
Prerequisites
- A Scout APM account with the agent installed in your application
- A Scout API key (not your Agent Key) — create one at scoutapm.com/settings
- Docker installed (if using the Docker image)
Setup Wizard
The fastest way to get started. The wizard auto-detects your platform and walks you through configuration:
npx @scout_apm/wizard
It supports Cursor, Claude Code, Claude Desktop, and other MCP clients.
Manual Configuration
Claude Code
claude mcp add scoutmcp -e SCOUT_API_KEY=your_scout_api_key_here -- docker run --rm -i -e SCOUT_API_KEY scoutapp/scout-mcp-local
Other Clients (Cursor, Claude Desktop, VS Code Copilot)
Add the following to your MCP configuration:
{
"mcpServers": {
"scout-apm": {
"command": "docker",
"args": ["run", "--rm", "-i", "--env", "SCOUT_API_KEY", "scoutapp/scout-mcp-local"],
"env": { "SCOUT_API_KEY": "your_scout_api_key_here" }
}
}
}
Available Tools
- list_apps — List your Scout applications, with optional filtering by last active date
- get_app_metrics — Get metric data (response time, throughput, etc.) for an application
- get_app_endpoints — List all endpoints with aggregated performance metrics
- get_endpoint_metrics — Get timeseries metrics for a specific endpoint
- get_app_endpoint_traces — Get recent traces filtered to a specific endpoint
- get_app_trace — Get a full trace with all spans and execution details
- get_app_error_groups — Get recent error groups, optionally filtered by endpoint
- get_app_insights — Get N+1 queries, memory bloat, and slow query insights
Resources
The local server also provides configuration templates your agent can read:
- scoutapm://config-resources/{framework} — Setup instructions for supported frameworks (Rails, Django, Flask, FastAPI, and more)
- scoutapm://config-resources/list — List all available configuration templates
- scoutapm://metrics — List of available metric types
Useful Prompts
Once connected, try asking your agent:
- “Find the slowest endpoints for my app in the last 7 days”
- “Show me the highest-frequency errors in the last 24 hours and suggest a fix”
- “Get any recent N+1 insights and help me optimize them”
- “Help me set up Scout monitoring for my Rails application”