Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scout APM Plugin for Claude Code

Surface production performance issues and fix them directly in your editor. This plugin connects Claude Code to Scout APM, giving you access to real-time performance data, error tracking, and actionable insights — all without leaving your development workflow.

What it does

  • /perf skill — Interactive performance review that fetches N+1 queries, slow endpoints, background job issues, anomaly events, and errors, then helps you investigate and fix them in your codebase.
  • /scout-errors skill — Triages production errors: groups by frequency and recency, maps backtraces to code, and proposes fixes.
  • /endpoint-deep-dive skill — Given an endpoint, pulls metrics, traces, and related insights, then locates the controller code and identifies hotspots.
  • Performance Investigator agent — Autonomous agent that takes a performance problem end-to-end: gathers data, forms hypotheses, examines traces, locates the code, and proposes fixes.
  • /scout-setup skill — Guided setup for connecting Scout APM to Claude Code.

Skills can be invoked explicitly via /skill-name, or Claude may auto-invoke them when your request matches (e.g., "why is /checkout slow?" naturally triggers endpoint-deep-dive).

Prerequisites

Installation

Step 1: Install the plugin

In a Claude Code session, add the Scout marketplace and install the plugin:

/plugin marketplace add scoutapp/claude-code-plugin
/plugin install scout-apm@scout-apm

Or browse available plugins interactively:

/plugin

Step 2: Authorize Scout

The plugin bundles Scout's hosted MCP server — there's nothing to install. Authorize it once:

/mcp

Select scout-apm, authenticate, and approve the read-only access request in your browser. That's it.

Tip: Run /scout-setup at any point for interactive guidance, including creating a Scout account and installing the agent in your app.

Prefer API-key auth over OAuth?

You can run the local MCP server instead. Get your read-only API key from Scout → Settings → API Keys, then:

# via uvx (https://docs.astral.sh/uv/)
claude mcp add scout-apm-local -e SCOUT_API_KEY=your_key_here -- uvx scout-mcp-local

# or via Docker
claude mcp add scout-apm-local -e SCOUT_API_KEY=your_key_here -- docker run --rm -i -e SCOUT_API_KEY scoutapp/scout-mcp-local:latest

npx @scout_apm/wizard automates the same thing. Restart Claude Code afterward, and disable the bundled server via /mcp so the same tools aren't exposed twice.

Usage

/perf — Performance review

Run /perf to get a prioritized summary of production performance issues. Claude will:

  1. Fetch insights (N+1 queries, slow queries, memory bloat), endpoint performance, background job metrics, anomaly events, and errors
  2. Present findings organized by impact
  3. Offer to drill into traces for root cause analysis
  4. Locate the relevant code in your repo and propose fixes

You can optionally pass an app name or ID: /perf my-app

/scout-errors — Error triage

Run /scout-errors to triage production errors. Claude will rank error groups by impact, pull backtraces for the top candidates, map the first in-repo frame to code, and propose a fix at the root cause.

/endpoint-deep-dive — Single-endpoint investigation

Run /endpoint-deep-dive <endpoint> to investigate one endpoint end-to-end. Claude will pull recent metrics, pick representative traces, identify the top spans by time, find the related controller/handler in your repo, and summarize where time is going.

/scout-setup — Setup help

Run /scout-setup if you need help connecting Scout APM to Claude Code. It will detect your current setup state and walk you through whatever is needed.

Performance Investigator agent

For autonomous investigation, ask Claude to investigate a performance issue and it can use the Performance Investigator agent to drive the investigation end-to-end without manual steps.

Available data

The plugin gives Claude access to the following Scout APM data via MCP tools:

Tool Description
list_apps List your monitored applications
list_orgs List your organizations
get_app_insights N+1 queries, slow queries, memory bloat (live snapshot of recent traffic)
get_app_insights_history Historical insights over a date range — retained indefinitely, for past months and reports
get_app_endpoints Endpoint performance rankings (sortable, paginated)
get_app_jobs Background job performance
get_app_metrics Time-series metrics (apdex, response time, throughput, errors, queue time)
get_endpoint_metrics Metrics for a specific endpoint
get_job_metrics Metrics for a specific background job
get_app_endpoint_traces Recent traces for an endpoint
get_app_job_traces Recent traces for a background job
get_app_trace Full trace with span-level detail
get_app_error_groups Error groups and exception patterns
get_app_anomaly_events Anomaly events over a timeframe — metric, direction, severity, baseline vs. current, deploy/monitor associations
get_app_anomaly_event Full detail for a single anomaly event, with joined smart-monitor and deploy context
get_usage Account usage and billing data
get_scout_setup_instructions Framework-specific setup guides

All data access is read-only.

How it works

The plugin has two layers:

  • Data access — the bundled Scout hosted MCP server (https://scoutapm.com/mcp), declared in .mcp.json and authenticated over OAuth. Installing the plugin registers it automatically.
  • Workflows and expertise — the skills and agent, which teach Claude how to read that data: which tools to combine, how to rank issues by impact, and how to map traces back to code.

The skills check for Scout tools by name rather than by transport, so they also work against the scout-mcp-local server if you'd rather authenticate with an API key.

Links

License

MIT

About

Official Scout APM Plugin for Claude

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors