OpenObserve Docs
IntegrationAIMcp

Model Context Protocol (MCP)

The Model Context Protocol is an open standard introduced by Anthropic that defines how AI applications connect to external tools and data sources. It's analogous to LSP for editors: one protocol, many clients, many servers.

You can connect your AI agents and IDEs to your OpenObserve instance to query logs, metrics, and traces in natural language; create and manage alerts; and explore stream metadata directly from your editor or agent runtime. MCP enables:

  • Natural-language queries against logs, metrics, and traces from your IDE
  • Agentic operations like alert creation as part of CI/CD pipelines
  • AI-assisted troubleshooting where an agent can pull stream data, correlate traces, and suggest root causes

Prerequisites

Your MCP endpoint follows the pattern:

https://your-instance/api/{org_id}/mcp

Generate a Base64-encoded auth token from your OpenObserve credentials:

echo -n "your-email@example.com:your-password" | base64

You'll use this token in every client below.

Connect to OpenObserve's MCP server

Add the following to ~/.cursor/mcp.json. See the Cursor documentation for more details.

{
  "mcpServers": {
    "openobserve": {
      "url": "https://your-instance/api/default/mcp",
      "headers": {
        "Authorization": "Basic <YOUR_BASE64_TOKEN>"
      }
    }
  }
}

Add the following to .vscode/mcp.json in your workspace. See the VS Code documentation.

{
  "servers": {
    "openobserve": {
      "type": "http",
      "url": "https://your-instance/api/default/mcp",
      "headers": {
        "Authorization": "Basic <YOUR_BASE64_TOKEN>"
      }
    }
  }
}

Add the server with one command. See the Claude Code documentation.

claude mcp add openobserve https://your-instance/api/default/mcp \
  -t http \
  --header "Authorization: Basic <YOUR_BASE64_TOKEN>"

Verify the connection:

claude mcp list

Add the following to claude_desktop_config.json. On macOS this lives at ~/Library/Application Support/Claude/. See the Claude Desktop documentation.

{
  "mcpServers": {
    "openobserve": {
      "url": "https://your-instance/api/default/mcp",
      "headers": {
        "Authorization": "Basic <YOUR_BASE64_TOKEN>"
      }
    }
  }
}

Add the following to ~/.codeium/windsurf/mcp_config.json. See the Windsurf documentation.

{
  "mcpServers": {
    "openobserve": {
      "url": "https://your-instance/api/default/mcp",
      "headers": {
        "Authorization": "Basic <YOUR_BASE64_TOKEN>"
      }
    }
  }
}

Custom MCP connectors are available on ChatGPT Pro, Plus, Business, Enterprise, and Education accounts. Follow OpenAI's setup instructions and use these settings:

  • Server URL: https://your-instance/api/default/mcp
  • Authentication: Custom header: Authorization: Basic <YOUR_BASE64_TOKEN>

MCP is an open protocol supported by many clients (Cline, Zed, Continue, and more). Consult your client's documentation for the exact config format. The values you'll need:

  • URL: https://your-instance/api/{org_id}/mcp
  • Transport: HTTP
  • Auth header: Authorization: Basic <YOUR_BASE64_TOKEN>

Building autonomous agents

For agentic workflows outside an IDE, call the MCP server directly over HTTP. We recommend creating a dedicated user with scoped permissions for agent use.

# start_time / end_time are epoch microseconds; this example queries the last hour
START=$(python3 -c "import time; print(int((time.time() - 3600) * 1_000_000))")
END=$(python3 -c "import time; print(int(time.time() * 1_000_000))")

curl https://your-instance/api/default/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Basic <YOUR_BASE64_TOKEN>" \
  -d @- <<EOF
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "SearchSQL",
    "arguments": {
      "org_id": "default",
      "request_body": {
        "query": {
          "sql": "SELECT * FROM logs WHERE level = 'error' LIMIT 10",
          "start_time": $START,
          "end_time": $END,
          "from": 0,
          "size": 10
        }
      }
    }
  },
  "id": 1
}
EOF

This pattern works with OpenAI's Responses API, Anthropic's API, and any agent runtime that supports remote MCP servers.

Available tools

OpenObserve includes the following tools. Tool names are prefixed with your server name (e.g. mcp__openobserve__StreamList).

Tools are discovered on demand

The catalog below shows all tools built into OpenObserve, but it is not sent to your MCP client all at once. By default, tools/list exposes tool_search, tools_call, and six frequently used pinned tools: GetIncident, PrometheusRangeQuery, SearchSQL, StreamList, StreamSchema, and GetLatestTraces. The agent uses tool_search to discover additional tools as needed, then runs them through tools_call. This keeps the initial tool list and model context small.

Legend: pinned = exposed directly in the initial tools/list response (no search required) · ⚠️ = destructive (modifies or deletes data)

Alerts (28 tools)
ToolDescription
CreateAlertCreate a new alert rule
GetAlertGet alert details by ID
ExportAlertExport alert as JSON
UpdateAlertUpdate an existing alert
DeleteAlertDelete an alert by ID ⚠️
ListAlertsList all alerts
EnableAlertEnable or disable an alert
TriggerAlertManually trigger an alert
MoveAlertsMove alerts to another folder
GenerateSqlGenerate SQL from natural language
TestDestinationTest alert destination connectivity
CreateDestinationCreate alert/pipeline destination
UpdateDestinationUpdate alert destination
GetDestinationGet destination details
ListDestinationsList all alert destinations
DeleteAlertDestinationDelete alert destination ⚠️
ListPrebuiltDestinationsList prebuilt destination templates
ListIncidentsList all incidents
GetIncidentGet incident details (pinned)
UpdateIncidentUpdate incident title/severity
GetIncidentStatsGet incident statistics
TriggerIncidentRcaManually trigger incident RCA
CreateTemplateCreate alert template
UpdateTemplateUpdate alert template
GetTemplateGet template details
ListTemplatesList all alert templates
DeleteAlertTemplateDelete alert template ⚠️
GetSystemTemplatesGet system prebuilt templates
Authorization (4 tools)
ToolDescription
CreateRolesCreate a role
DeleteRoleDelete a role ⚠️
ListRolesList all roles
UpdateRolesUpdate a role
Dashboards (20 tools)
ToolDescription
CreateDashboardCreate a dashboard with panels
UpdateDashboardUpdate an existing dashboard
ListDashboardsList all dashboards in org
GetDashboardGet dashboard details by ID
DeleteDashboardDelete a dashboard ⚠️
MoveDashboardMove dashboard to another folder
MoveDashboardsMove multiple dashboards to folder
AddPanelAdd a panel to a dashboard
UpdatePanelUpdate a single panel
DeletePanelDelete a single panel ⚠️
CreateReportCreate a scheduled report
UpdateReportUpdate a report
ListReportsList all reports
GetReportGet report details
DeleteReportDelete a report ⚠️
CreateAnnotationsCreate time annotations
GetAnnotationsGet annotations
DeleteAnnotationsDelete annotations ⚠️
UpdateAnnotationsUpdate annotations
RemoveTimedAnnotationFromPanelRemove annotation from panel ⚠️
Enrichment Tables (2 tools)
ToolDescription
CreateUpdateEnrichmentTableCreate/update enrichment table
CreateEnrichmentTableFromUrlCreate table from URL
Folders (6 tools)
ToolDescription
CreateFolderCreate a new folder
UpdateFolderUpdate folder properties
ListFoldersList all folders
GetFolderGet folder details by ID
GetFolderByNameGet folder by name
DeleteFolderDelete a folder by ID ⚠️
Functions (6 tools)
ToolDescription
createFunctionCreate a VRL function
listFunctionsList all functions
deleteFunctionDelete a function ⚠️
updateFunctionUpdate a VRL function
functionPipelineDependencyCheck function dependencies
testFunctionTest a VRL function
KV Store (4 tools)
ToolDescription
GetKVValueGet value by key
SetKVValueSet key-value pair
RemoveKVValueDelete key-value pair ⚠️
ListKVKeysList all keys
Logs (1 tool)
ToolDescription
LogsIngestionJsonIngest logs via JSON array
Organizations & System Settings (12 tools)
ToolDescription
AssumeServiceAccountAssume service account identity
GetUserOrganizationsGet user organizations
GetOrganizationSummaryGet organization summary
CreateOrganizationCreate an organization
OrganizationSettingCreateCreate/update org settings
OrganizationSettingGetGet organization settings
SystemSettingGetResolvedGet resolved system setting
SystemSettingListResolvedList resolved system settings
SystemSettingSetOrgSet org-level system setting
SystemSettingSetUserSet user-level system setting
SystemSettingDeleteOrgDelete org system setting ⚠️
SystemSettingDeleteUserDelete user system setting ⚠️
Patterns (1 tool)
ToolDescription
ExtractPatternsExtract log patterns
Pipelines (7 tools)
ToolDescription
createPipelineCreate a data pipeline
listPipelinesList all pipelines
getPipelineGet pipeline details by ID
getStreamsWithPipelineList streams using pipelines
deletePipelineDelete a pipeline ⚠️
updatePipelineUpdate an existing pipeline
enablePipelineEnable or disable a pipeline
PromQL / Metrics (7 tools)
ToolDescription
PrometheusQueryExecute PromQL instant query
PrometheusRangeQueryExecute PromQL range query (pinned)
PrometheusMetadataGet Prometheus metadata
PrometheusSeriesGet Prometheus series
PrometheusLabelsGet Prometheus label names
PrometheusLabelValuesGet Prometheus label values
PrometheusFormatQueryFormat PromQL query
Search (17 tools)
ToolDescription
SearchSQLSearch data with SQL (pinned)
SearchAroundSearch logs around a timestamp
SearchValuesGet distinct values for a field
SearchPartitionGet search partitions
SearchHistoryGet search history
GetSavedViewGet saved view details
ListSavedViewsList all saved views
DeleteSavedViewsDelete a saved view ⚠️
CreateSavedViewsCreate a saved view
UpdateSavedViewsUpdate a saved view
SubmitSearchJobSubmit async search job
ListSearchJobsList all search jobs
GetSearchJobStatusGet search job status
CancelSearchJobCancel a running search job
GetSearchJobResultGet search job results
DeleteSearchJobDelete a search job ⚠️
RetrySearchJobRetry a failed search job
Service Accounts (4 tools)
ToolDescription
ServiceAccountsListList service accounts
ServiceAccountSaveCreate service account
ServiceAccountUpdateUpdate service account
RemoveServiceAccountDelete service account ⚠️
Sourcemaps (4 tools)
ToolDescription
SourcemapListList sourcemaps
SourcemapDeleteDelete sourcemap ⚠️
SourcemapStacktraceResolve sourcemap stacktrace
SourcemapValuesListList sourcemap values
Streams (5 tools)
ToolDescription
StreamListList all streams (logs, metrics, traces) (pinned)
StreamSchemaGet stream schema (pinned)
StreamCreateCreate a new stream
UpdateStreamSettingsUpdate stream settings ⚠️
StreamDeleteDelete a stream ⚠️
Traces (5 tools)
ToolDescription
GetLatestTracesList recent traces with summaries (trace_id, span count, service names, duration). Supports filter and sort by start_time/duration (pinned)
GetLatestSessionsList recent LLM sessions from a trace stream: session_id, trace count, token usage, cost, error count
GetSessionDetailsGet per-turn trace summaries for a single LLM session by session_id
GetLatestUsersList recent LLM users from a trace stream: user_id, event count, token usage, cost
GetTraceDAGGet the span DAG (nodes and parent-child edges) for a specific trace by trace_id
Users (5 tools)
ToolDescription
UserListList all users
UserSaveCreate a new user
UserUpdateUpdate user details
AddUserToOrgAdd user to organization
RemoveUserFromOrgRemove user from organization ⚠️

Multi-organization workflows

Each organization in your OpenObserve instance has its own MCP endpoint. You can register multiple servers in a single client to switch contexts. The example below uses the Claude Code CLI, but the same pattern applies to every client covered above: add one entry per org in the relevant config file (mcp.json, claude_desktop_config.json, etc.).

claude mcp add o2-prod https://your-instance/api/production/mcp \
  -t http --header "Authorization: Basic <PROD_TOKEN>"

claude mcp add o2-dev https://your-instance/api/development/mcp \
  -t http --header "Authorization: Basic <DEV_TOKEN>"

This is useful for keeping production data isolated from development queries, or for SaaS deployments where each tenant has its own org.

Security considerations

  • Use a dedicated MCP user with the minimum permissions required, rather than your personal admin credentials.
  • Never commit credentials to version control. Store Base64 tokens in environment variables or a secrets manager.
  • Rotate credentials regularly and revoke access for any client you no longer use.
  • Confirm tool calls before execution in your MCP client when possible. This protects against prompt injection from untrusted data sources.
  • Use organization-specific endpoints to limit blast radius. A token for org_a cannot access org_b.
  • Restrict network access to the MCP endpoint via firewall rules or IP allowlisting where feasible.

Troubleshooting

Connection fails / 404
  • Confirm the endpoint path includes /api/{org_id}/mcp
  • Test the base URL with curl to verify network reachability
401 Unauthorized
# Verify your Base64 token decodes correctly
echo "<YOUR_BASE64_TOKEN>" | base64 -d
# Should print: your-email@example.com:your-password

# Test credentials against the meta endpoint
curl -u "username:password" https://your-instance/api/default/_meta
Tools don't appear in client
  • Restart the MCP client after editing config
  • Check the client's MCP server status panel; inside a Claude session run /mcp
  • Verify the user has access to the target organization
  • Confirm the user has the necessary RBAC permissions for stream and alert operations

Next steps

Need some help?

Was this page helpful?

Last updated on

On this page