SigNoz
STDIOSigNoz可观测性数据AI访问MCP服务器
SigNoz可观测性数据AI访问MCP服务器
A Model Context Protocol (MCP) server that provides seamless access to SigNoz observability data through AI assistants and LLMs. This server enables natural language queries for metrics, traces, logs, alerts, dashboards, and service performance data.
┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│   MCP Client    │───▶│  MCP Server      │───▶│   SigNoz API    │
│  (AI Assistant) │    │  (Go)            │    │  (Observability)│
└─────────────────┘    └──────────────────┘    └─────────────────┘
                              │
                              ▼
                       ┌──────────────────┐
                       │   Tool Handlers  │
                       │  (HTTP Client)   │
                       └──────────────────┘
Use this mcp-server with MCP-compatible clients like Claude Desktop and Cursor.
signoz-mcp-server (for example: .../signoz-mcp-server/bin/signoz-mcp-server).edit configclaude_desktop_config.json Add shown config with your signoz url, api key and path to signoz-mcp-server binary.{ "mcpServers": { "signoz": { "command": "/absolute/path/to/signoz-mcp-server/bin/signoz-mcp-server", "args": [], "env": { "SIGNOZ_URL": "https://your-signoz-instance.com", "SIGNOZ_API_KEY": "your-api-key-here", "LOG_LEVEL": "info" } } } }
signoz server load in the developer console and its tools become available.Notes:
command path with your actual binary location.Option A — GUI:
+ New MCP ServerOption B — Project config file:
Create .cursor/mcp.json in your project root:
For Both options use same json struct
{ "mcpServers": { "signoz": { "command": "/absolute/path/to/signoz-mcp-server/bin/signoz-mcp-server", "args": [], "env": { "SIGNOZ_URL": "https://your-signoz-instance.com", "SIGNOZ_API_KEY": "your-api-key-here", "LOG_LEVEL": "info" } } } }
Once added, restart Cursor to use the SigNoz tools.
edit configclaude_desktop_config.json Add shown config with your signoz url, api key and path to signoz-mcp-server binary.{ "mcpServers": { "signoz": { "url": "http://localhost:8000/mcp", "headers": { "Authorization": "Bearer your-api-key-here" } } } }
Note: You can pass the SigNoz API key either as:
SIGNOZ_API_KEY) when starting the server, orAuthorization header in the client configuration as shown abovesignoz server load in the developer console and its tools become available.Build and run signoz-mcp-server with envs - SIGNOZ_URL=signoz_url SIGNOZ_API_KEY=signoz_apikey TRANSPORT_MODE=http MCP_SERVER_PORT=8000 LOG_LEVEL=log_level ./signoz-mcp-server - or use docker-compose
Option A — GUI:
+ New MCP ServerOption B — Project config file:
Create .cursor/mcp.json in your project root:
For Both options use same json struct
{ "mcpServers": { "signoz": { "url": "http://localhost:8000/mcp", "headers": { "Authorization": "Bearer signoz-api-key-here" } } } }
Note: You can pass the SigNoz API key either as:
SIGNOZ_API_KEY) when starting the server, orAuthorization header in the client configuration as shown aboveNote: By default, the server logs at info level. If you need detailed debugging information, set LOG_LEVEL=debug in your environment. For production use, consider using LOG_LEVEL=warn to reduce log verbosity.
signoz-mcp-server/
├── cmd/server/           # Main application entry point
├── internal/
│   ├── client/          # SigNoz API client
│   ├── config/          # Configuration management
│   ├── handler/tools/   # MCP tool implementations
│   ├── logger/          # Logging utilities
│   └── mcp-server/      # MCP server core
├── go.mod               # Go module dependencies
├── Makefile             # Build automation
└── README.md            
# Clone the repository git clone https://github.com/SigNoz/signoz-mcp-server.git cd signoz-mcp-server # Build the binary make build # Or build directly with Go go build -o bin/signoz-mcp-server ./cmd/server/
Set the following environment variables:
export SIGNOZ_URL="https://your-signoz-instance.com" export SIGNOZ_API_KEY="your-api-key-here" export LOG_LEVEL="info" # Optional: debug, info, error (default: info)
In SigNoz Cloud, SIGNOZ_URL is typically - https://ingest.
You can access API Key by going to Settings -> Workspace Settings -> API Key in SigNoz UI
# Run the built binary ./bin/signoz-mcp-server
internal/handler/tools/internal/client/client.goThe MCP server provides the following tools that can be used through natural language:
"Show me all available metrics"
"Search for CPU-related metrics"
"List all active alerts"
"Get details for alert rule ID abc123"
"Show me the history for alert rule abc123 from the last 24 hours"
"Get logs related to alert abc456"
"List all dashboards"
"Show me the Host Metrics dashboard details"
"List all services from the last 24 hours"
"What are the top operations for the paymentservice?"
"List all saved log views"
"Show me error logs for the paymentservice from the last hour"
"Search paymentservice logs for 'connection timeout' errors"
"Get error logs with FATAL severity"
"Show me all available trace fields"
"Search traces for the apple service from the last hour"
"Get details for trace ID ball123"
"Check for  error patterns in traces from the randomservice"
"Show me the span hierarchy for trace xyz789"
"Find traces with errors in the last 2 hours"
"Give me flow of this trace"
list_metric_keysLists all available metric keys from SigNoz.
search_metric_keysSearches for metrics by text query.
searchText (required) - Text to search forlist_alertsLists all active alerts from SigNoz.
get_alertGets details of a specific alert rule.
ruleId (required) - Alert rule IDlist_dashboardsLists all dashboards with summaries (name, UUID, description, tags).
get_dashboardGets complete dashboard configuration.
uuid (required) - Dashboard UUIDlist_servicesLists all services within a time range.
timeRange (optional) - Time range like '2h', '6h', '2d', '7d'start (optional) - Start time in nanoseconds (defaults to 24 hours ago)end (optional) - End time in nanoseconds (defaults to now)get_service_top_operationsGets top operations for a specific service.
service (required) - Service nametimeRange (optional) - Time range like '2h', '6h', '2d', '7d'start (optional) - Start time in nanoseconds (defaults to 24 hours ago)end (optional) - End time in nanoseconds (defaults to now)tags (optional) - JSON array of tagsget_alert_historyGets alert history timeline for a specific rule.
ruleId (required) - Alert rule IDtimeRange (optional) - Time range like '2h', '6h', '2d', '7d'start (optional) - Start timestamp in milliseconds (defaults to 24 hours ago)end (optional) - End timestamp in milliseconds (defaults to now)offset (optional) - Offset for pagination (default: 0)limit (optional) - Limit number of results (default: 20)order (optional) - Sort order: 'asc' or 'desc' (default: 'asc')list_log_viewsLists all saved log views from SigNoz.
get_log_viewGets full details of a specific log view by ID.
viewId (required) - Log view IDget_logs_for_alertGets logs related to a specific alert automatically.
alertId (required) - Alert rule IDtimeRange (optional) - Time range around alert (e.g., '1h', '30m', '2h') - default: '1h'limit (optional) - Maximum number of logs to return (default: 100)get_error_logsGets logs with ERROR or FATAL severity within a time range.
timeRange (optional) - Time range like '2h', '6h', '2d', '7d'start (optional) - Start time in milliseconds (defaults to 24 hours ago)end (optional) - End time in milliseconds (defaults to now)service (optional) - Service name to filter bylimit (optional) - Maximum number of logs to return (default: 100)search_logs_by_serviceSearches logs for a specific service within a time range.
service (required) - Service name to search logs fortimeRange (optional) - Time range like '2h', '6h', '2d', '7d'start (optional) - Start time in milliseconds (defaults to 24 hours ago)end (optional) - End time in milliseconds (defaults to now)severity (optional) - Log severity filter (DEBUG, INFO, WARN, ERROR, FATAL)searchText (optional) - Text to search for in log bodylimit (optional) - Maximum number of logs to return (default: 100)get_trace_field_valuesGets available field values for trace.
fieldName (required) - Field name to get values for (e.g., 'service.name', 'http.method')searchText (optional) - Search text to filter valuessearch_traces_by_serviceSearches traces for a specific service.
service (required) - Service name to search traces fortimeRange (optional) - Time range like '2h', '6h', '2d', '7d'start (optional) - Start time in milliseconds (defaults to 24 hours ago)end (optional) - End time in milliseconds (defaults to now)operation (optional) - Operation name to filter byerror (optional) - Filter by error status (true/false)minDuration (optional) - Minimum duration in nanosecondsmaxDuration (optional) - Maximum duration in nanosecondslimit (optional) - Maximum number of traces to return (default: 100)get_trace_detailsGets trace information including all spans and metadata.
traceId (required) - Trace ID to get details fortimeRange (optional) - Time range like '2h', '6h', '2d', '7d'start (optional) - Start time in milliseconds (defaults to 24 hours ago)end (optional) - End time in milliseconds (defaults to now)includeSpans (optional) - Include detailed span information (true/false, default: true)get_trace_error_analysisAnalyzes error patterns in traces.
timeRange (optional) - Time range like '2h', '6h', '2d', '7d'start (optional) - Start time in milliseconds (defaults to 24 hours ago)end (optional) - End time in milliseconds (defaults to now)service (optional) - Service name to filter byget_trace_span_hierarchyGets trace span relationships and hierarchy.
traceId (required) - Trace ID to get span hierarchy fortimeRange (optional) - Time range like '2h', '6h', '2d', '7d'start (optional) - Start time in milliseconds (defaults to 24 hours ago)end (optional) - End time in milliseconds (defaults to now)signoz_execute_builder_queryExecutes a SigNoz Query Builder v5 query.
query (required) - Complete SigNoz Query Builder v5 JSON objectsignoz_query_helperHelper tool for building SigNoz queries.
signal (optional) - Signal type: traces, logs, or metricsquery_type (optional) - Type of help: fields, structure, examples, or allMost tools support flexible time parameters:
Use the timeRange parameter with formats:
'30m' - Last 30 minutes'2h' - Last 2 hours'6h' - Last 6 hours'2d' - Last 2 days'7d' - Last 7 daysThe timeRange parameter automatically calculates the time window from now backwards. If not specified, most tools default to the last 24 hours. You can also specify time in milliseconds and nanoseconds
All tools return JSON responses that are optimized for LLM consumption:
| Variable | Description | Required | 
|---|---|---|
SIGNOZ_URL | SigNoz instance URL | Yes | 
SIGNOZ_API_KEY | SigNoz API key (get from Settings → Workspace Settings → API Key in SigNoz UI) | Yes | 
LOG_LEVEL | Logging level: info(default), debug, warn, error | No | 
TRANSPORT_MODE | MCP transport mode: stdio(default) or http | No | 
MCP_SERVER_PORT | Port for HTTP transport mode | Yes only when `TRANSPORT_MODE=http | 
We welcome contributions!
Made with ❤️ for the observability community