OpenObserve 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., "@OpenObserve MCP Server search logs for 'payment failed' errors 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.
OpenObserve MCP Server
Model Context Protocol server for querying OpenObserve from AI agents (Claude, Cursor, OpenCode, etc.).
Features
Multi-instance — query multiple OpenObserve deployments in a single call
Adaptive strategy — raw fetch ≤1 h, reservoir sampling 1–6 h, hourly aggregation 6 h–7 d, daily aggregation >7 d
Batch queries — parallel multi-query execution with configurable concurrency
LRU cache — TTL-based result caching with per-entry size cap
Cursor pagination — stateless pagination across instances via base64 cursors
Langfuse tracing — optional observability for every tool call
Related MCP server: openobserve-community-mcp
Installation
npm install -g openobserve-mcp
# or without installing:
npx openobserve-mcp --config /path/to/config.jsonConfiguration
Create a JSON config file:
{
"instances": [
{
"id": "prod",
"name": "Production",
"url": "https://openobserve.example.com",
"auth": { "type": "env", "envVar": "PROD_O2_TOKEN" },
"defaults": { "org": "default", "timeout": 30000, "maxResults": 1000 },
"capabilities": ["logs", "traces", "metrics"],
"tags": ["production"]
}
],
"batching": { "maxConcurrent": 5 },
"caching": { "enabled": true, "ttl": 300, "maxSize": 1000 }
}auth.envVar must point to an environment variable containing a Base64-encoded user:password string:
export PROD_O2_TOKEN=$(echo -n "user@example.com:password" | base64)Config can also be passed inline via the O2_MCP_CONFIG environment variable (JSON string).
MCP Client Setup
Claude Desktop / Cursor — add to your MCP config:
{
"mcpServers": {
"openobserve": {
"command": "npx",
"args": ["openobserve-mcp", "--config", "/path/to/config.json"],
"env": {
"PROD_O2_TOKEN": "base64token"
}
}
}
}OpenCode — add to .opencode/config.json:
{
"mcp": {
"openobserve": {
"type": "local",
"command": ["npx", "openobserve-mcp", "--config", "/path/to/config.json"],
"environment": {
"PROD_O2_TOKEN": "base64token"
},
"enabled": true
}
}
}Tools
Tool | Description |
| Search log streams with SQL across one or more instances. Automatically selects query strategy based on time range. |
| Execute multiple SQL queries in parallel across instances. |
| List configured instances with their capabilities and tags. |
| List available streams on one or more instances. |
| Return field names and types for one or more streams (cached 10 min). |
| Fetch log records surrounding a specific timestamp without writing SQL. |
SQL Reference
-- Basic filter
SELECT * FROM "mystream" WHERE level = 'error'
-- Full-text search
SELECT * FROM "mystream" WHERE match_all('timeout*')
-- Aggregation
SELECT code, COUNT(*) FROM "mystream" GROUP BY code ORDER BY COUNT(*) DESC
-- Time bucketing (do not add _timestamp filters manually)
SELECT histogram(_timestamp, '1 hour') AS ts, COUNT(*) FROM "mystream" GROUP BY tsSupported: =, !=, >, <, >=, <=, IS NULL, IS NOT NULL, AND, OR, NOT, COUNT, SUM, AVG, MIN, MAX, GROUP BY, ORDER BY, match_all(), histogram(). String literals use single quotes. Stream names use double quotes.
Optional: Langfuse Tracing
Set the following environment variables to emit traces to Langfuse:
Variable | Description |
| Set to |
| Langfuse project public key |
| Langfuse project secret key |
| Langfuse host (default: |
Requirements
Node.js ≥ 18.0.0
OpenObserve instance with API access
License
MIT © Adarsh BA
Available Tools
6 toolsbatch_queryA
Execute multiple SQL log queries in parallel across OpenObserve instances and return all results together. Each query specifies its own instance, SQL, and time range. Useful for comparing data across instances or fetching related signals in a single round trip.
Inputs: queries (required).
get_logs_aroundA
Fetch log records immediately before and after a specific timestamp in a stream. Returns up to size records centered on the anchor timestamp. Useful for viewing the context surrounding a known event without writing a SQL query.
Inputs: stream (required), instance (required), timestamp (required), size.
get_stream_schemaA
Return the field names and data types for one or more log streams on an OpenObserve instance. Accepts a single stream name or an array; schemas are fetched in parallel. Results are cached for 10 minutes.
Inputs: streams (required), instance (required).
list_instancesA
List the configured OpenObserve instances available to this server. Returns each instance's ID, name, URL, capabilities (logs, traces, metrics), and tags. Optionally filter by one or more tags or by a specific capability.
Inputs: tags, capability.
list_streamsA
List all log streams available on one or more OpenObserve instances. Returns stream names, types, storage type, and document/storage statistics.
Inputs: instances (required).
search_logsA
Search log streams with SQL across one or more OpenObserve instances. Automatically applies the most efficient query strategy based on time range: raw fetch for ≤1 h, sampling for 1–6 h, hourly aggregation for 6 h–7 d, daily aggregation beyond 7 d. SQL supports =, !=, >, <, >=, <=, IS NULL, IS NOT NULL, AND, OR, NOT, COUNT, SUM, AVG, MIN, MAX, GROUP BY, ORDER BY, histogram(_timestamp). String values use single quotes; stream names use double quotes. match_all('text') performs full-text search across indexed fields with wildcard support (). Do not add WHERE _timestamp filters — time range is handled by startTime and endTime parameters. Examples: SELECT * FROM "mystream" WHERE match_all('error') | SELECT code, COUNT(*) FROM "mystream" GROUP BY code
Inputs: sql (required), endTime (required), instances (required), startTime (required), +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: listing instances, searching logs, batch queries, listing streams, fetching schema, and retrieving context around events. No two tools overlap in functionality.
All tool names follow a consistent verb_noun pattern (list_instances, search_logs, batch_query, list_streams, get_stream_schema, get_logs_around), with no mixing of conventions.
Six tools is well-scoped for interacting with OpenObserve instances, covering instance discovery, log searching (single and batch), stream listing, schema inspection, and context retrieval without being overwhelming or sparse.
The tool surface covers the core workflows of exploring and querying log data, but lacks direct support for querying metrics or traces, which are capabilities mentioned in instances. Still, for log-focused operations, it is nearly complete.
Related MCP Connectors
Access New Relic observability data through MCP - query metrics, logs, traces, entities, and more
Cloud hosted Okahu MCP server that helps you manage genAI trace data
MCP server for querying and analyzing data from ad platforms, analytics tools, and spreadsheets
Remote MCP for GenAI span mapping, provider normalization, dashboard schemas, and receipts.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables querying logs and metrics from Graylog, Prometheus, and InfluxDB 2.x. It provides tools for executing Lucene log searches, PromQL queries, and Flux queries directly within MCP-compatible clients.MIT
- AlicenseBqualityDmaintenanceA read-only MCP server for OpenObserve Community Edition that works over the REST API. Provides tools for searching logs, traces, stream schemas, and dashboards - no Enterprise license required.816GPL 3.0
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI assistants to query and explore your OpenObserve observability data. Provides read-only access to logs, metrics, and traces for analysis and troubleshooting.5MIT
- FlicenseAqualityDmaintenanceMCP server that enables querying an OpenObserve instance for logs, traces, and metrics via tools like search_logs, search_traces, get_trace, and query_metrics, supporting natural-language-driven observability workflows.8-