Scout Monitoring MCP
Enables AI assistants to access Scout Monitoring performance and error data through Scout's API. Provides traces, errors, metrics, and insights for Rails, Django, FastAPI, Laravel and other applications to help identify and fix performance issues like N+1 queries, slow endpoints, and memory bloat.
README
Scout Monitoring MCP
This repository contains code to locally run an MCP server that can access Scout Monitoring data via Scout's API. We provide a Docker image that can be pulled and run by your AI Assistant to access Scout Monitoring data.
This puts Scout Monitoring's performance and error data directly in the hands of your AI Assistant. For Rails, Django, FastAPI, Laravel and more. Use it to get traces and errors with line-of-code information that the AI can use to target fixes right in your editor and codebase. N+1 queries, slow endpoints, slow queries, memory bloat, throughput issues - all your favorite performance problems surfaced and explained right where you are working.
If this makes your life a tiny bit better, why not :star: it?!
Prerequisites
You will need to have or create a Scout Monitoring account and obtain an API key.
- Sign up
- Install the Scout Agent in your application and send Scout data!
- Visit settings to get or create an API key
- This is not your "Agent Key"; it's the "API Key" that can be created on the Settings page
- This is a read-only key that can only access data in your account
- Install Docker. Instructions below assume you can start a Docker container
The MCP server will not currently start without an API key set, either in the environment or by a command-line argument on startup.
Installation
We recommend using the provided Docker image to run the MCP server. It is intended to be started by your AI Assistant and configured with your Scout API key. Many local clients allow specifying a command to run the MCP server in some location. A few examples are provided below.
The Docker image is available on Docker Hub.
Of course, you can always clone this repo and run the MCP server directly; uv or other
environment management tools are recommended.
Setup Wizard
The simplest way to configure and start using the Scout MCP is with our interactive setup wizard:
Run via npx:
npx @scout_apm/wizard
Build and run from source:
cd ./wizard
npm install
npm run build
node dist/wizard.js
The wizard will guide you through:
- Selecting your AI coding platform (Cursor, Claude Code, Claude Desktop)
- Entering your Scout API key
- Automatically configuring the MCP server settings
Supported Platforms
The wizard currently supports setup for:
- Cursor - Automatically configures MCP settings
- Claude Code (CLI) - Provides the correct command to run
- Claude Desktop - Updates the configuration file for Windows/Mac
Configure a local Client (e.g. Claude/Cursor/VS Code Copilot)
If you would like to configure the MCP manually, this usually just means supplying a command to run the MCP server with your API key in the environment to your AI Assistant's config. Here is the shape of the JSON (the top-level key varies):
{
"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"}
}
}
}
<details> <summary> Claude Code</summary>
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
</details>
<details> <summary>Cursor</summary>
MAKE SURE to update the SCOUT_API_KEY value to your actual api key in
Arguments in the Cursor Settings > MCP
</details>
<details> <summary>VS Code Copilot</summary>
- VS Code Copilot docs
- We recommend the "Add an MCP server to your workspace" option </details>
<details> <summary>Claude Desktop</summary>
Add the following to your claude config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json
{
"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"}
}
}
}
</details>
Token Usage
We are currently more interested in expanding available information than strictly
controlling response size from our MCP tools. If your AI Assistant has a configurable
token limit (e.g. Claude Code export MAX_MCP_OUTPUT_TOKENS=50000), we recommend
setting it generously high, e.g. 50,000 tokens.
Usage
Scout's MCP is intended to put error and performance data directly in the... hands? of your AI Assistant. Use it to get traces and errors with line-of-code information that the AI can use to target fixes right in your editor.
Most assistants will show you both raw tool calls and perform analysis. Desktop assistants can readily create custom JS applications to explore whatever data you desire. Assistants integrated into code editors can use trace data and error backtraces to make fixes right in your codebase.
Combine Scout's MCP with your AI Assistant's other tools to:
- Create rich GitHub/GitLab issues based on errors and performance data
- Make JIRA fun - have your AI Assistant create tickets with all the details
- Generate PRs that fix specific errors and performance problems
Tool
The Scout MCP provides the following tools for accessing Scout APM data:
list_apps- List available Scout APM applications, with optional filtering by last active dateget_app_metrics- Get individual metric data (response_time, throughput, etc.) for a specific applicationget_app_endpoints- Get all endpoints for an application with aggregated performance metricsget_endpoint_metrics- Get timeseries metrics for a specific endpoint in an applicationget_app_endpoint_traces- Get recent traces for an app filtered to a specific endpointget_app_trace- Get an individual trace with all spans and detailed execution informationget_app_error_groups- Get recent error groups for an app, optionally filtered by endpointget_app_insights- Get performance insights including N+1 queries, memory bloat, and slow queries
Useful Prompts
- "Summarize the available tools in the Scout Monitoring MCP."
- "Find the slowest endpoints for app
my-app-namein the last 7 days. Generate a table with the results including the average response time, throughput, and P95 response time." - "Show me the highest-frequency errors for app
Fooin the last 24 hours. Get the latest error detail, examine the backtrace and suggest a fix." - "Get any recent n+1 insights for app
Bar. Pull the specific trace by id and help me optimize it based on the backtrace data."
Local Development
We use uv and taskipy to manage environments and run tasks for this project.
Run with Inspector
uv run task dev
Connect within inspector to add API key, set to STDIO transport
Build the Docker image
docker build -t scout-mcp-local .
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.