openobserve-mcp
MCP 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.
README
openobserve-mcp
An MCP server that lets any MCP client — Claude Code, Cursor, a custom agent — query an OpenObserve instance: logs, traces, and metrics.
Quick start
npm install
npm run build
npm run o2:up # OpenObserve on http://localhost:5080
npm run seed # sample logs, traces, and metrics
npm run smoke # call every tool over a real stdio MCP session
npm run smoke should print eight ok lines. Log in to the UI at http://localhost:5080 with root@example.com / Complexpass#123.
Connecting a client
Claude Code
claude mcp add openobserve \
--env O2_URL=http://localhost:5080 \
--env O2_ORG=default \
--env O2_USER=root@example.com \
--env O2_PASSWORD='Complexpass#123' \
-- node /absolute/path/to/openobserve-mcp/dist/index.js
Restart the client afterwards — MCP servers are loaded at session start.
Any client (JSON config)
{
"mcpServers": {
"openobserve": {
"command": "node",
"args": ["/absolute/path/to/openobserve-mcp/dist/index.js"],
"env": {
"O2_URL": "http://localhost:5080",
"O2_ORG": "default",
"O2_USER": "root@example.com",
"O2_PASSWORD": "Complexpass#123"
}
}
}
}
Configuration
| Variable | Default | Purpose |
|---|---|---|
O2_URL |
http://localhost:5080 |
Base URL of the instance |
O2_ORG |
default |
Organization id |
O2_USER |
— | Login email |
O2_PASSWORD |
— | Password |
See .env.example. Credentials are read from the process environment only; nothing is written to disk.
Tools
| Tool | Purpose |
|---|---|
list_streams |
Enumerate streams, optionally filtered by type |
get_schema |
Field names and types for a stream |
get_org_summary |
Stream count, storage, pipelines, alerts, dashboards |
search_logs |
Rows matching a SQL WHERE clause, newest first |
aggregate_logs |
COUNT / AVG / GROUP BY over logs, traces, or metrics |
search_traces |
Recent traces with root operation, duration, services |
get_trace |
Every span of one trace, ordered by start time |
query_metrics |
PromQL over a time range |
Time ranges
Every time argument takes an ISO timestamp or relative shorthand: 30s, 15m, 2h, 7d, 1w. end_time defaults to now.
aggregate_logs table token
Write the table as the literal token stream; it is substituted with the real stream name in FROM / JOIN position only, so a column or string literal containing the word is left alone.
{
"stream": "app_logs",
"sql": "SELECT service, COUNT(*) AS c FROM stream GROUP BY service ORDER BY c DESC",
"start_time": "1h"
}
Logs and traces live in separate indexes. To aggregate spans, pass "stream_type": "traces" — otherwise OpenObserve reports stream not found.
Layout
src/
index.ts entrypoint — stdio transport only
server.ts builds a wired McpServer (importable for tests)
config.ts environment → Config
client.ts OpenObserve HTTP API wrapper
time.ts ISO / relative range parsing → micros + seconds
tools/
index.ts registers every tool
helpers.ts JSON result shape, SQL quoting, shared schema
streams.ts list_streams, get_schema, get_org_summary
logs.ts search_logs, aggregate_logs
traces.ts search_traces, get_trace
metrics.ts query_metrics
scripts/
seed.mjs sample logs, traces, metrics
smoke.mjs stdio MCP client — exercises every tool
docker-compose.yml local OpenObserve
Adding a tool means one file in src/tools/ plus a line in src/tools/index.ts.
Verified against
OpenObserve public.ecr.aws/zinclabs/openobserve:latest (v0.15.x), MCP SDK 1.25, Node 22.
Endpoint paths are version-sensitive. Two in particular differ from what the API docs suggest: stream schema is /api/{org}/streams/{stream}/schema (not /api/{org}/{stream}/schema), and there is no /traces/{trace_id} endpoint — get_trace searches the trace stream by id instead. If you upgrade OpenObserve, re-run npm run smoke.
Development
npm run watch # tsc --watch
npm run smoke # regression check against a live instance
node scripts/smoke.mjs list # inspect registered tools
node scripts/smoke.mjs get_schema '{"stream":"app_logs"}'
scripts/smoke.mjs speaks the real MCP protocol over stdio, so it catches schema and transport regressions that a direct HTTP test would miss.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.