Scouter MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Scouter MCP ServerWhat's the slowest SQL in the last hour?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Scouter MCP Server
An MCP (Model Context Protocol) server that connects AI agents to Scouter APM, enabling natural-language queries against real-time application performance data.
Ask your AI assistant things like "What's the slowest SQL in the last hour?" or "Why is TPS dropping?" and get answers grounded in live monitoring data.
Features
32 tools covering the full Scouter API surface
Dual protocol — connects via HTTP (REST API) or TCP (binary protocol)
Automatic hash resolution — SQL queries, service names, and error messages are decoded from Scouter's internal hash IDs to human-readable text
Executable SQL — transaction profiles include SQL with bind parameters substituted, ready for
EXPLAIN ANALYZEZero external dependencies — only
@modelcontextprotocol/sdkandzod
Related MCP server: mcp-ohmy-sql
Quick Start
Using npx (no install needed)
npx scouter-mcp-serverOr install from source
cd scouter.mcp
npm install
npm run buildConfigure
Set environment variables to point at your Scouter collector:
Variable | Description | Default |
| Scouter webapp REST API base URL |
|
| API login ID | |
| API login password | |
| TCP direct connection host | |
| TCP direct connection port |
|
| Set to | (disabled) |
| Set to |
|
HTTP mode (recommended) — set SCOUTER_API_URL. Supports all 32 tools (write tools require SCOUTER_ENABLE_WRITE=true).
TCP mode — set SCOUTER_TCP_HOST. Lightweight, no webapp needed, but some admin tools are unavailable.
Note: By default, only read-only tools (25) are registered. To enable write tools (
set_configure,set_alert_scripting,manage_kv_store,manage_shortener,control_thread,remove_inactive_objects), setSCOUTER_ENABLE_WRITE=true.
3. Add to your MCP client
Claude Desktop (claude_desktop_config.json):
HTTP mode:
{
"mcpServers": {
"scouter": {
"command": "npx",
"args": ["-y", "scouter-mcp-server"],
"env": {
"SCOUTER_API_URL": "http://your-scouter-server:6180",
"SCOUTER_API_ID": "admin",
"SCOUTER_API_PASSWORD": "your-password"
}
}
}
}TCP mode:
{
"mcpServers": {
"scouter": {
"command": "npx",
"args": ["-y", "scouter-mcp-server"],
"env": {
"SCOUTER_TCP_HOST": "your-scouter-server",
"SCOUTER_TCP_PORT": "6100",
"SCOUTER_API_ID": "admin",
"SCOUTER_API_PASSWORD": "your-password"
}
}
}
}Claude Code (use -s user to register globally across all projects):
# HTTP mode
claude mcp add scouter -s user \
-e SCOUTER_API_URL=http://your-scouter-server:6180 \
-e SCOUTER_API_ID=admin \
-e SCOUTER_API_PASSWORD=your-password \
-- npx -y scouter-mcp-server
# TCP mode
claude mcp add scouter -s user \
-e SCOUTER_TCP_HOST=your-scouter-server \
-e SCOUTER_TCP_PORT=6100 \
-e SCOUTER_API_ID=admin \
-e SCOUTER_API_PASSWORD=your-password \
-- npx -y scouter-mcp-serverTo update the configuration later, edit ~/.claude.json directly or remove and re-add:
claude mcp remove scouter -s user
claude mcp add scouter -s user \
-e SCOUTER_TCP_HOST=new-host \
-e SCOUTER_TCP_PORT=6100 \
-e SCOUTER_API_ID=admin \
-e SCOUTER_API_PASSWORD=your-password \
-- npx -y scouter-mcp-serverTools
Performance Investigation
Tool | Description |
| Real-time snapshot — TPS, response time, CPU, heap, active services, alerts |
| Automated multi-step diagnosis with severity-ranked findings |
| Historical counter values (TPS, ElapsedTime, CPU, etc.) over time |
| Find slow/error transactions by time range, service, IP, login |
| Full transaction profile with executable SQL and API call traces |
| Currently running requests with thread state |
SQL & Database
Tool | Description |
| SQL performance ranking — count, elapsed, errors, % of total |
| Resolve hash IDs to SQL/service/error text |
Error & Alert Analysis
Tool | Description |
| Errors ranked by frequency with per-service error rates |
| Alert statistics within a time range |
| Read alert rule scripts |
| Create/update alert rules (HTTP only) |
Service & Traffic
Tool | Description |
| Service-level stats with external API call breakdown |
| Request distribution by client IP |
| Request distribution by browser/user-agent |
| Unique visitor counts (realtime, daily, hourly) |
| Service-to-service call relationships |
Infrastructure
Tool | Description |
| Thread dump with stack traces |
| Host-level top processes and disk usage |
| Agent runtime info (threads, env, sockets) |
| Collector server metadata and counter model |
Distributed Tracing
Tool | Description |
| Trace a transaction across services via GXID |
| Real-time transaction stream |
| Raw XLog data (5 query modes) |
| Raw profile steps with hash IDs |
Configuration & Management
Tool | Description |
| Read server/agent configuration |
| Modify configuration (HTTP only) |
| Suspend/resume/interrupt threads |
| Global, namespaced, and private key-value store |
| URL shortener service |
| Clean up dead agents (HTTP only) |
Architecture
┌─────────────────────────────┐
│ AI Agent (Claude, etc.) │
│ "Why is the app slow?" │
└──────────┬──────────────────┘
│ MCP (stdio)
┌──────────▼──────────────────┐
│ Scouter MCP Server │
│ ┌────────────────────────┐ │
│ │ Tool Hub (31 tools) │ │
│ │ Hash Resolution Engine │ │
│ │ SQL Param Binding │ │
│ └────────────────────────┘ │
└──────────┬──────────────────┘
│ HTTP REST or TCP Binary
┌──────────▼──────────────────┐
│ Scouter Collector Server │
│ + Webapp (REST API) │
└──────────┬──────────────────┘
│
┌──────▼──────┐
│ Java Agents │
│ Host Agents │
└─────────────┘Project Structure
scouter.mcp/
├── index.ts # Entry point — stdio transport + SIGINT handler
├── server/
│ └── index.ts # createServer() factory → { server, cleanup }
├── tools/
│ ├── index.ts # registerAllTools() hub — explicit imports of all tools
│ ├── shared-utils.ts # Hash resolution, SQL param binding
│ └── ... (31 tool files)
├── client/
│ ├── index.ts # Client facade — exports client, jsonStringify, catchWarn
│ ├── interface.ts # ScouterClient interface + types
│ ├── http.ts # HTTP/REST implementation
│ └── tcp.ts # TCP binary protocol implementation
├── protocol/
│ ├── tcp-connection.ts # TCP connection with handshake/auth
│ ├── packs.ts # Scouter binary pack definitions
│ ├── values.ts # Value type serialization
│ ├── data-input.ts # Binary deserialization
│ ├── data-output.ts # Binary serialization
│ └── constants.ts # Protocol constants
├── time-utils.ts # Time parsing utilities
├── __tests__/ # Vitest test suites
├── vitest.config.ts # Test config (v8 coverage)
├── tsconfig.json # NodeNext modules
└── package.jsonDevelopment
npm run dev # Watch mode (tsc --watch)
npm test # Run tests
npm run test:coverage # Coverage report
npm run build # Production buildAdding a New Tool
Create
tools/my-tool.tsexportingregister(server: McpServer)withserver.registerTool()Add
import { register as registerMyTool } from "./my-tool.js"totools/index.tsCall
registerMyTool(server)insideregisterAllTools()Use
shared-utils.tsfor hash resolution and SQL binding
Protocol Details
HTTP Mode
Connects to Scouter's webapp REST API (/scouter/v1/*). Supports all 32 tools including write operations (configuration, alert scripting, thread control).
Authentication: username/password login with bearer token auto-refresh on 401.
TCP Mode
Connects directly to the Scouter collector using the binary protocol (port 6100). Handshake uses NetCafe magic number (0xCAFE2001), login with SHA-256 hashed password.
Supports read-only tools. Write operations (config, alerts, KV store, URL shortener) throw UnsupportedOperationError.
Text hash resolution uses GET_TEXT_100 command with per-date caching.
Requirements
Node.js >= 18
Scouter Collector >= 2.x with webapp enabled (for HTTP mode)
License
Apache License 2.0 — same as the Scouter project.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/miningyu/scouter-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server