SS

signoz/signoz-mcp-server

Analytics & monitoring
107 stars 0 forks 品質 90 トレンド 90

A Model Context Protocol (MCP) server that provides seamless access to SigNoz observability data through AI assistants and LLMs.

概要

A Model Context Protocol (MCP) server that provides seamless access to SigNoz observability data through AI assistants and LLMs.

README

SigNoz MCP Server

A Model Context Protocol (MCP) server that provides seamless access to SigNoz observability data through AI assistants and LLMs. Query metrics, traces, logs, alerts, dashboards, and services using natural language.

📖 Full Documentation

Table of Contents

Connect to SigNoz Cloud

Connect your AI tool to SigNoz Cloud’s hosted MCP server. No installation is required; just add the hosted MCP URL and authenticate.

https://mcp..signoz.cloud/mcp

Make sure you select the correct region that matches your SigNoz Cloud account. Using the wrong region will result in authentication failures.

Find your region under Settings → Ingestion in SigNoz, or see the SigNoz Cloud region reference.

GitHub does not reliably make custom-protocol links like cursor:// and vscode: clickable in README rendering.

Use the documentation page for one-click install buttons:

If you prefer, use the manual configuration examples below in this README.

Cursor

Manual Configuration

Add this configuration to .cursor/mcp.json:

{
  "mcpServers": {
    "signoz": {
      "url": "https://mcp..signoz.cloud/mcp"
    }
  }
}

Need help? See the Cursor MCP docs.

VS Code / GitHub Copilot

Manual Configuration

Add this configuration to .vscode/mcp.json:

{
  "servers": {
    "signoz": {
      "type": "http",
      "url": "https://mcp..signoz.cloud/mcp"
    }
  }
}

Need help? See the VS Code MCP docs.

Claude Desktop

Add SigNoz Cloud as a custom connector in Claude Desktop:

  1. Open Claude Desktop.
  2. Go to Settings → Developer (or Features, depending on your version).
  3. Click Add Custom Connector or Add Remote MCP Server.
  4. Enter your SigNoz MCP URL: https://mcp..signoz.cloud/mcp

When prompted, complete the authentication flow.

Claude Code

Run this command to add the hosted SigNoz MCP server:

claude mcp add --scope user --transport http signoz https://mcp..signoz.cloud/mcp

After configuring the MCP server, authenticate in a terminal:

claude /mcp

Select the signoz server and complete the authentication flow.

OpenAI Codex

Run this command to add the hosted SigNoz MCP server:

codex mcp add signoz --url https://mcp..signoz.cloud/mcp

Or add this configuration to config.toml:

[mcp_servers.signoz]
url = "https://mcp..signoz.cloud/mcp"

After adding the server, authenticate:

codex mcp login signoz

Then run /mcp inside Codex to verify the connection.

SigNoz Cloud Authentication

When you add the hosted MCP URL to your client, the client initiates an authentication flow. You will be prompted to enter:

  1. Your SigNoz instance URL (for example, your-instance.signoz.cloud). Protocol-less URLs are accepted; paths, query parameters, and fragments are ignored.
  2. Your API key

Create an API key in Settings → API Keys in SigNoz. Only Admin users can create API keys.

Self-Hosted Installation

Download the latest binary from GitHub Releases:

# macOS (Apple Silicon)
curl -L https://github.com/SigNoz/signoz-mcp-server/releases/latest/download/signoz-mcp-server_darwin_arm64.tar.gz | tar xz

# macOS (Intel)
curl -L https://github.com/SigNoz/signoz-mcp-server/releases/latest/download/signoz-mcp-server_darwin_amd64.tar.gz | tar xz

# Linux (amd64)
curl -L https://github.com/SigNoz/signoz-mcp-server/releases/latest/download/signoz-mcp-server_linux_amd64.tar.gz | tar xz

This extracts a signoz-mcp-server binary in the current directory. Move it somewhere on your PATH or note the absolute path for the config below.

Go Install

go install github.com/SigNoz/signoz-mcp-server/cmd/server@latest

The binary is installed as server to $GOPATH/bin/ (default: $HOME/go/bin/server). You may want to rename it:

mv "$(go env GOPATH)/bin/server" "$(go env GOPATH)/bin/signoz-mcp-server"

Docker

Docker images are available on Docker Hub:

docker pull signoz/signoz-mcp-server:latest

Run in HTTP mode:

docker run -p 8000:8000 \
  -e TRANSPORT_MODE=http \
  -e MCP_SERVER_PORT=8000 \
  -e SIGNOZ_URL=https://your-signoz-instance.com \
  -e SIGNOZ_API_KEY=your-api-key \
  signoz/signoz-mcp-server:latest

Use a specific version tag (e.g. v0.1.0) instead of latest for pinned deployments.

Build from Source

git clone https://github.com/SigNoz/signoz-mcp-server.git
cd signoz-mcp-server
make build

The binary is at ./bin/signoz-mcp-server.

Connect to Self-Hosted SigNoz

Prerequisites

  • A running SigNoz instance
  • SigNoz v0.131.0 or newer for signoz_check_metric_usage
  • SigNoz v0.120.0 or newer for alert-rule list/get/create/update/delete tools, and v0.118.0 or newer for alert history
  • A SigNoz API key (Settings → API Keys in the SigNoz UI)
  • The signoz-mcp-server binary (see Self-Hosted Installation)

Stdio Mode (Claude Desktop / Cursor / Any MCP Client)

Add this to your MCP client config (claude_desktop_config.json, .cursor/mcp.json, etc.). Replace the command path with the absolute path to your signoz-mcp-server binary:

{
    "mcpServers": {
        "signoz": {
            "command": "/absolute/path/to/signoz-mcp-server",
            "args": [],
            "env": {
                "SIGNOZ_URL": "https://your-signoz-instance.com",
                "SIGNOZ_API_KEY": "your-api-key-here",
                "LOG_LEVEL": "info"
            }
        }
    }
}

HTTP Mode

HTTP mode listens on all interfaces by default. Set MCP_SERVER_HOST=127.0.0.1 when the server should accept loopback connections only.

With OAuth (Multi-Tenant / Cloud)

Start the server:

TRANSPORT_MODE=http \
MCP_SERVER_PORT=8000 \
OAUTH_ENABLED=true \
OAUTH_TOKEN_SECRET=$(openssl rand -base64 32) \
OAUTH_ISSUER_URL=https://your-public-mcp-url.com \
./signoz-mcp-server

Client config — just the URL, no keys needed:

{
    "mcpServers": {
        "signoz": {
            "url": "https://your-public-mcp-url.com/mcp"
        }
    }
}

The client discovers OAuth endpoints automatically, opens a browser for credentials, and handles token exchange.

Without OAuth (Simple Setup)

The API key and SigNoz URL only need to be provided in one place — either on the server or on the client.

Option A — Credentials on the server (simpler client config):

SIGNOZ_URL=https://your-signoz-instance.com \
SIGNOZ_API_KEY=your-api-key \
TRANSPORT_MODE=http \
MCP_SERVER_PORT=8000 \
./signoz-mcp-server
{
    "mcpServers": {
        "signoz": {
            "url": "http://localhost:8000/mcp"
        }
    }
}

Option B — API key on the client (server holds the URL, client sends the key):

SIGNOZ_URL=https://your-signoz-instance.com \
TRANSPORT_MODE=http \
MCP_SERVER_PORT=8000 \
./signoz-mcp-server
{
    "mcpServers": {
        "signoz": {
            "url": "http://localhost:8000/mcp",
            "headers": {
                "SIGNOZ-API-KEY": "your-api-key-here"
            }
        }
    }
}

HTTP Probe Endpoints

HTTP mode exposes unauthenticated probe endpoints. New Kubernetes deployments should use /livez for livenessProbe and /readyz for readinessProbe.

Endpoint Purpose
/livez Shallow liveness probe. Returns 200 OK when the server process can answer HTTP requests. It does not check dependencies.
/readyz Readiness probe. Returns 200 OK only after the pod is ready to receive traffic; currently this requires the docs index to be ready. Otherwise returns 503.
/healthz Legacy/generic health check kept for backward compatibility. It follows the same strict status as /readyz; use /livez for shallow liveness.

What Can You Do With It?

"Show me all available metrics"
"What's the p99 latency for http_request_duration_seconds?"
"List all active alerts"
"Show me error logs for the paymentservice from the last hour"
"How many errors per service in the last hour?"
"Search traces for the checkout service from the last hour"
"Get details for trace ID abc123"
"Create a dashboard with CPU and memory widgets"
"How do I send Docker logs to SigNoz?"

Available Tools

SigNoz compatibility: signoz_check_metric_usage targets /api/v2/metrics/dashboards?metricName=... and /api/v2/metrics/alerts?metricName=..., available in SigNoz v0.131.0 and newer. Alert-rule list/get/create/update/delete require SigNoz v0.120.0 or newer. signoz_get_alert_history requires v0.118.0 or newer. Self-hosted deployments on older SigNoz versions will see HTTP 404 from the affected tools. Notification-channel tools target the render-envelope /api/v1/channels/* routes introduced by SigNoz/signoz#10941, #10957, #10995, and #10997.

Tool metadata: every tool accepts searchContext. Copy the user’s entire original request verbatim, including preflight or confirmation context; it is used for MCP observability and is not forwarded to SigNoz APIs.

Input validation: calls are never rejected for schema mismatches. Arguments are validated against each tool’s advertised schema; a mismatched call still runs best-effort, and the successful result carries an appended Input validation notice: text block naming the mismatched parameter so self-correcting agents can adjust. Mismatches are also counted in the mcp.tool.validation.mismatches metric.

Tool Description
signoz_list_metrics Discover active metric names and catalog metadata
signoz_query_metrics Query known metrics for values, trends, breakdowns, or formulas
signoz_get_top_metrics Return top 100 metrics ranked by ingested sample volume with pre-computed percentages for cost and volume analysis
signoz_check_metric_usage Given a list of metric names (up to 50 per call), return which dashboards and alerts reference each one
signoz_check_metric_cardinality Return label/attribute keys for a single metric with cardinality counts and sample values, sorted highest-cardinality first
signoz_get_field_keys Discover available field keys for metrics, traces, or logs
signoz_get_field_values Get possible values for a field key
signoz_list_alerts List firing/silenced/inhibited Alertmanager alert instances (not rule definitions)
signoz_list_alert_rules List configured alert-rule summaries, including inactive/OK and disabled rules
signoz_get_alert Get one alert rule’s full definition by id
signoz_get_alert_history Get one rule’s firing or state-transition history
signoz_create_alert Create an alert after verifying notification-channel names
signoz_update_alert Fully replace an alert after fetching it and verifying notification-channel names
signoz_delete_alert Permanently delete a confirmed alert rule by UUIDv7 id
signoz_list_dashboards List tenant-dashboard summaries and discover UUIDs
signoz_get_dashboard Get one dashboard’s full layout, variables, widgets, and queries
signoz_create_dashboard Create a custom multi-widget dashboard
signoz_update_dashboard Fully replace a fetched dashboard while preserving unrequested fields
signoz_delete_dashboard Permanently delete a confirmed dashboard by id
signoz_import_dashboard Create a dashboard from a known curated template path
signoz_list_dashboard_templates List curated templates and discover an import path
signoz_list_services List APM services with trace activity in a time range
signoz_get_service_top_operations Get ranked operations for one traced service
signoz_list_views List saved Explorer views for traces/logs/metrics/Cost Meter and discover UUIDs
signoz_get_view Get one saved Explorer view’s complete definition by id
signoz_search_docs Find ranked official-doc matches when no exact page is selected
signoz_fetch_doc Fetch one known official-doc page or heading as Markdown
signoz_create_view Save one reusable Explorer query
signoz_update_view Fully replace a fetched saved view while preserving unrequested fields
signoz_delete_view Permanently delete a confirmed saved view by id
signoz_aggregate_logs Aggregate log statistics and grouped or top-N breakdowns
signoz_search_logs Return individual log records matching filters
signoz_aggregate_traces Aggregate span statistics and grouped or top-N breakdowns
signoz_search_traces Return individual span rows or discover trace IDs
signoz_get_trace_details Get one known trace with all spans and hierarchy
signoz_execute_builder_query Query Builder v5 requests the dedicated tools cannot express
signoz_list_notification_channels List channel summaries for name verification and ID discovery
signoz_get_notification_channel Get all provider-specific settings for one channel by ID
signoz_create_notification_channel Create a uniquely named channel and send a test notification
signoz_update_notification_channel Fully replace a fetched channel and send a test notification
signoz_delete_notification_channel Permanently delete a confirmed channel by ID

For detailed usage and examples, see the full documentation.

Resource deep links: the resource read tools (signoz_list_dashboards, signoz_get_dashboard, signoz_list_alerts, signoz_list_alert_rules, signoz_get_alert, signoz_list_services, signoz_search_traces, signoz_get_trace_details) include a webUrl field — an absolute deep link to the resource in the SigNoz web UI (per result row for signoz_search_traces) — when the request carries a SigNoz instance URL.

Agent Routing Guidance

Use signoz_search_docs for topical discovery when no exact documentation page is selected, then signoz_fetch_doc for the chosen page or heading. Use live data tools for tenant telemetry, alert state, dashboards, saved views, and notification channels.

Docs tools use the same authentication path as other MCP tools.

Available Resources

Resource Read when you need
signoz://alert/instructions Alert schemas, fields, thresholds, evaluation, and notification workflow
signoz://alert/examples Alert payload examples; replace example channels with verified names
signoz://dashboard/instructions Dashboard fields, variables, chaining, and layout
signoz://dashboard/widgets-instructions Panel choices and query-specific guides
signoz://dashboard/widgets-examples Panel examples and validation patterns
signoz://dashboard/query-builder-example Dashboard Query Builder aggregations, filters, legends, and functions
signoz://promql/instructions PromQL widgets or alerts, especially dotted OTel metric names
signoz://dashboard/clickhouse-schema-for-logs Bundled logs schema snapshot for dashboard SQL
signoz://dashboard/clickhouse-logs-example Raw ClickHouse logs widget patterns
signoz://dashboard/clickhouse-schema-for-metrics Bundled metrics schema snapshot for dashboard SQL
signoz://dashboard/clickhouse-metrics-example Raw ClickHouse metrics widget patterns
signoz://dashboard/clickhouse-schema-for-traces Bundled traces schema snapshot for dashboard SQL
signoz://dashboard/clickhouse-traces-example Raw ClickHouse traces widget patterns
signoz://logs/query-builder-guide Logs Query Builder v5 JSON or unfamiliar log fields
signoz://traces/query-builder-guide Traces Query Builder v5 JSON or unfamiliar trace fields
signoz://metrics-aggregation-guide Metric aggregations, formulas, grouping, limits, and Cost Meter queries
signoz://view/instructions Saved Explorer view fields and read-before-replace workflow
signoz://view/examples Saved-view payloads for traces, logs, metrics, and Cost Meter
signoz://docs/sitemap Indexed official-doc catalog and page URLs
signoz://alert/{id}/summary One live alert definition plus up to 10 history records from the preceding six hours
signoz://dashboard/{id}/summary One full live dashboard definition; the URI remains backward-compatible

Environment Variables

Variable Description Required
SIGNOZ_URL SigNoz instance URL Yes (stdio); Optional (http with OAuth)
SIGNOZ_API_KEY SigNoz API key (get from Settings → API Keys in the SigNoz UI) Yes (stdio); Optional (http with OAuth)
LOG_LEVEL Logging level: info(default), debug, warn, error No
TRANSPORT_MODE MCP transport mode: stdio(default) or http No
MCP_SERVER_HOST Host/interface for HTTP transport mode (default: empty, which listens on all interfaces). Set to 127.0.0.1 for loopback-only access. No
MCP_SERVER_PORT Port for HTTP transport mode (default: 8000) No
MCP_MAX_REQUEST_BYTES Max inbound MCP HTTP request body size in bytes (default: 4194304 / 4 MiB). Bounds memory from a single oversized request. No
CLIENT_CACHE_SIZE Maximum cached tenant clients in multi-tenant HTTP mode (default: 256) No
CLIENT_CACHE_TTL_MINUTES Tenant-client cache lifetime in minutes (default: 30) No
SIGNOZ_DOCS_REFRESH_INTERVAL Runtime docs sitemap refresh interval (Go duration, default: 6h) No
SIGNOZ_DOCS_FULL_REFRESH_INTERVAL Runtime full docs refresh interval (Go duration, default: 24h) No
OAUTH_ENABLED Enable OAuth 2.1 authentication flow (true/false) No (default: false)
OAUTH_TOKEN_SECRET Encryption key for OAuth tokens (min 32 bytes, e.g. openssl rand -base64 32) Yes when OAUTH_ENABLED=true
OAUTH_ISSUER_URL Public URL of this MCP server (used in OAuth metadata discovery) Yes when OAUTH_ENABLED=true
OAUTH_ACCESS_TOKEN_TTL_MINUTES Access token lifetime in minutes (default: 60) No
OAUTH_REFRESH_TOKEN_TTL_MINUTES Refresh token lifetime in minutes (default: 43200 / 30d) No
OAUTH_AUTH_CODE_TTL_SECONDS Authorization code lifetime in seconds (default: 600 / 10min) No
SIGNOZ_CUSTOM_HEADERS Extra HTTP headers added to every API request, useful when SigNoz is behind a reverse proxy requiring auth (e.g. CF-Access-Client-Id:id.access,CF-Access-Client-Secret:secret). Format: Key1:Value1,Key2:Value2 No
SIGNOZ_INSTANCE_URL_ALLOWLIST Multi-tenant (http) only: comma-separated allowlist of SigNoz backend hosts the server will proxy to. Entries are exact hosts (signoz.example.com) or wildcards (*.us.signoz.cloud, which matches any subdomain ending in .us.signoz.cloud); a scheme/port/path accidentally included in an entry is tolerated and reduced to the bare host. When set, SigNoz instance URLs that do not match are refused at every ingress: the OAuth setup form and X-SigNoz-URL header return HTTP 403, the OAuth token endpoint (incl. existing refresh tokens) returns invalid_grant, and /mcp requests via an OAuth token return 403. All increment a disallowed_signoz_url-tagged failure metric for alerting (not logged per-request, to avoid noise from misconfigured/looping clients), and the rejection message points SigNoz Cloud users to their region’s MCP URL (mcp..signoz.cloud) with a docs link. Empty/unset allows any host. The operator’s own SIGNOZ_URL is exempt. No
ANALYTICS_ENABLED Enable product analytics (true/false; default: false) No
SEGMENT_KEY Segment write key used only when analytics is enabled No
OTEL_EXPORTER_OTLP_ENDPOINT OTLP gRPC endpoint for the MCP server’s own traces and metrics. Internal telemetry export is disabled when no OTLP endpoint/exporter is configured. For plaintext collectors, use an http:// endpoint such as http://localhost:4317. No
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT Trace-specific OTLP gRPC endpoint; overrides OTEL_EXPORTER_OTLP_ENDPOINT for traces. No
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT Metrics-specific OTLP gRPC endpoint; overrides OTEL_EXPORTER_OTLP_ENDPOINT for metrics. No
OTEL_TRACES_EXPORTER Set to none to disable internal trace export even when an OTLP endpoint is configured. No
OTEL_METRICS_EXPORTER Set to none to disable internal metrics export and runtime metrics even when an OTLP endpoint is configured. No

The MCP server does not run an OTLP log exporter; logs are emitted as JSON to stderr. OTEL_LOGS_EXPORTER is therefore not used.

Claude Desktop Extension

Building the Bundle

Requires Node.js. See Anthropic MCPB for details.

make bundle

Installing

  1. Open Claude Desktop → Settings → Developer → Edit Config → Add bundle.mcpb
  2. Select ./bundle/bundle.mcpb
  3. Enter your SIGNOZ_URL, SIGNOZ_API_KEY, and optionally LOG_LEVEL
  4. Restart Claude Desktop

Architecture

For a detailed overview of request flow, component interactions, and design decisions, see docs/architecture.md.

Contributing

See CONTRIBUTING.md for development workflow, required docs/manifest sync for MCP changes, and PR checklist.

Made with ❤️ for the observability community

View this README on GitHub

インストール

docker run -p 8000:8000 \

設定

{ "mcpServers": { "signoz": { "url": "https://mcp.<region>.signoz.cloud/mcp" } } }