Scouter MCP Server
Click on "Deploy 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 Server What'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-kafka-observer
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.
Available Tools
25 toolsdiagnose_performanceDiagnose PerformanceARead-onlyIdempotent
Perform automated multi-step performance diagnosis. Checks system counters, active services, error patterns, slow SQL, and service hotspots. Returns a structured diagnostic report with findings ranked by severity (CRITICAL/WARNING/INFO) and suggested actions.
Inputs: obj_type, time_range_minutes.
get_agent_infoGet Agent InfoARead-onlyIdempotent
Get detailed agent runtime information: thread list with states and active services, environment variables, and socket connections. Thread list shows live thread states (unlike thread dump which captures stack traces). Use for deep agent-level investigation.
Inputs: obj_hash (required), include_env, include_sockets, include_threads.
get_alert_scriptingGet Alert ScriptingARead-onlyIdempotent
[HTTP mode only] Read alert scripting configuration for a specific counter (read-only). Shows the current alert script, threshold rules, and configuration. Use get_server_info with include_counter_model to discover available counter names.
Inputs: counter_name (required), log_loop, log_index, include_compile_log.
get_alert_summaryGet Alert SummaryARead-onlyIdempotent
Get aggregated alert statistics within a time range. Shows which alert types fired most frequently. Use alongside get_system_overview (which shows recent real-time alerts) for historical alert pattern analysis.
Inputs: end_time, obj_hash, obj_type, max_count, +1 more.
get_configureGet ConfigureARead-onlyIdempotent
[HTTP mode only] Read server or agent configuration (read-only). Without obj_hash, returns the collector server's scouter.conf. With obj_hash, returns that specific agent's configuration. Use get_system_overview to find agent hashes.
Inputs: obj_hash.
get_counter_trendGet Counter TrendARead-onlyIdempotent
Get historical counter values over a time range for trend analysis. Supports TPS, ElapsedTime, HeapUsed, ProcCpu, GcCount, Cpu, Mem, and more. Use latest_sec for quick recent data (e.g., last 60s), or start_time/end_time for custom ranges. Auto-selects precision: 2-second for <=2h, 5-minute for >2h. Large datasets are auto-sampled.
Inputs: counter (required), end_time, obj_type, latest_sec, +2 more.
get_distributed_traceGet Distributed TraceARead-onlyIdempotent
Trace a distributed transaction across multiple services using GXID, or fetch multiple transactions by txid list. Essential for MSA environments to follow a request across service boundaries. Use after finding a GXID in get_transaction_detail.
Inputs: date, gxid, txids, include_profiles.
get_error_summaryGet Error SummaryARead-onlyIdempotent
Analyze errors within a time range. Returns error types ranked by frequency with error messages, stack traces, and sample transaction IDs for drill-down. Also shows per-service error rates for context.
Inputs: end_time, obj_hash, obj_type, start_time.
get_host_infoGet Host InfoARead-onlyIdempotent
Get host-level system information: top processes (by CPU/memory) and disk usage. Requires a host agent obj_hash, or specify obj_type (e.g., 'linux') to auto-discover host agents. Use get_system_overview to find host agent hashes.
Inputs: obj_hash, obj_type, include_top, include_disk.
get_interaction_countersGet Interaction CountersARead-onlyIdempotent
Get real-time service-to-service call relationships. Shows which services call which other services, with call counts, error counts, and latency. Useful for understanding service dependencies and topology.
Inputs: obj_type, obj_hashes.
get_ip_summaryGet IP SummaryARead-onlyIdempotent
Analyze request distribution by client IP address. Shows which IPs generate the most traffic. Useful for identifying heavy users, bots, or potential DDoS sources.
Inputs: end_time, obj_hash, obj_type, max_count, +1 more.
get_raw_profileGet Raw ProfileARead-onlyIdempotent
Get raw (non-decoded) profile steps for a transaction. Unlike get_transaction_detail which returns decoded/human-readable profile data, this returns the raw Step objects with hash IDs. Use lookup_text to resolve hash IDs to text. Useful when you need the raw step structure for programmatic analysis.
Inputs: date (required), txid (required).
get_raw_xlogGet Raw XLogARead-onlyIdempotent
Get raw (non-decoded) XLog transaction data. Unlike search_transactions which returns decoded data, this returns raw XLog objects with hash IDs. Supports five modes: single lookup, GXID distributed trace, filtered search, pageable list, and real-time streaming. Use lookup_text to resolve hash IDs.
Inputs: mode (required), ip, date, gxid, +14 more.
get_realtime_xlogsGet Realtime XLogsARead-only
Get recent real-time transaction data (XLogs) produced since the given offsets. Returns decoded XLog entries with loop/index offsets for subsequent polling. Use offset 0/0 for the first call, then pass returned offsets to get newer data.
Inputs: obj_type, xlog_loop, obj_hashes, xlog_index.
get_server_infoGet Server InfoARead-onlyIdempotent
Get Scouter collector server metadata: version, ID, connection status. Optionally includes counter model (all available performance counter definitions with display names and units). Use this to discover what counters exist before querying get_counter_trend. Counter model requires HTTP mode.
Inputs: include_counter_model.
get_service_summaryGet Service SummaryARead-onlyIdempotent
Get aggregated service-level performance statistics. Shows which services are called most, have highest error rates, or consume most resources. Includes external API call summary for dependency analysis.
Inputs: sort_by, end_time, obj_hash, obj_type, +3 more.
get_sql_analysisGet SQL AnalysisARead-onlyIdempotent
Analyze SQL performance within a time range. Returns SQL statements ranked by total elapsed time, showing execution counts, error counts, and average execution time. Use when investigating database-related performance issues.
Inputs: sort_by, end_time, obj_hash, obj_type, +2 more.
get_system_overviewGet System OverviewARead-onlyIdempotent
Get a comprehensive snapshot of current system status: agents, real-time counters (TPS, response time, heap, CPU), active service counts, and recent alerts. Use this as the starting point for any investigation.
Inputs: obj_type.
get_thread_dumpGet Thread DumpARead-onlyIdempotent
Capture a thread dump from a specific JVM agent. Use for diagnosing deadlocks, thread contention, or understanding thread activity. Optionally includes heap histogram for memory analysis. Stack traces require HTTP mode; TCP mode returns thread states only.
Inputs: obj_hash (required), include_heap_histogram.
get_transaction_detailGet Transaction DetailARead-onlyIdempotent
Get full detail of a specific transaction including execution profile (SQL queries with bind params, API calls, method traces). Use after identifying a problematic transaction from search_transactions or list_active_services.
Inputs: txid (required), date, max_steps.
get_user_agent_summaryGet User Agent SummaryARead-onlyIdempotent
Analyze request distribution by browser/user-agent. Shows which clients (browsers, bots, mobile apps) generate the most traffic. Useful for understanding client demographics and detecting crawlers.
Inputs: end_time, obj_hash, obj_type, max_count, +1 more.
get_visitor_statsGet Visitor StatsARead-onlyIdempotent
Get unique visitor (user) statistics. Supports real-time current visitor count, daily totals, or hourly breakdown. Useful for understanding traffic patterns and user activity.
Inputs: date, mode, end_time, obj_hash, +3 more.
list_active_servicesList Active ServicesARead-onlyIdempotent
Show all currently executing requests (in-flight transactions). Use when investigating hangs, slow conditions, or asking 'what is running right now'. Returns active services sorted by elapsed time descending.
Inputs: obj_hash, obj_type, thread_id, min_elapsed_ms.
lookup_textLookup TextARead-onlyIdempotent
Resolve hash IDs to their original text values. Scouter stores SQL queries, service names, error messages, etc. as integer hashes for efficiency. Use this to get the actual text for a hash ID seen in other tool outputs.
Inputs: type (required), hashes (required), date.
search_transactionsSearch TransactionsARead-onlyIdempotent
Search for transactions (XLogs) within a time range. Find slow transactions, error transactions, or filter by service name/IP/login. Returns list sorted by elapsed time descending with summary statistics. Primary tool for 'why is it slow?' investigations.
Inputs: ip, date, login, service, +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 25 tools
Most tools have clearly distinct purposes, but a few pairs like get_realtime_xlogs vs get_raw_xlog and get_agent_info vs get_thread_dump could be confused at first glance. Descriptions are detailed enough to separate them, but the boundaries are not perfectly crisp.
The vast majority of tools follow a get_<noun> pattern (e.g., get_system_overview, get_transaction_detail). Two tools deviate: diagnose_performance and lookup_text. This is a minor inconsistency, but the overall naming is predictable and readable.
25 tools is on the heavier side, but the server covers a broad APM domain: transactions, services, SQL, errors, alerts, configuration, and raw data access. Each tool addresses a legitimate need, so the count feels justified rather than bloated.
The tool surface is remarkably complete for a performance monitoring server. It covers system overview, automated diagnosis, counter trends, transaction search and detail, distributed tracing, service analysis, SQL analysis, error analysis, visitor statistics, alerts, configuration reading, host/agent info, thread dumps, and raw data access. There are no obvious dead ends or missing core operations.
Maintenance
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
AI-powered incident management and server monitoring via MCP.
Tigris MCP Server seamlessly connects AI agents to Tigris bucket and object management.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Related MCP Servers
- -licenseNot gradedqualityDmaintenanceAn MCP server that bridges AI assistants with SQL databases, enabling natural language querying across multiple database types with built-in optimization and security.3-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives AI agents real-time observability into Apache Kafka clusters, enabling natural language queries for broker health, consumer lag, and diagnostics.MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server that enables AI assistants to query and manage Microsoft SQL Server databases using natural language.117 npm5MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that gives AI assistants direct access to SAP HANA performance data — query plans, execution stats, memory usage.MIT