observability-mcp
Allows searching and listing logs from Elasticsearch, with support for filters such as time range, level, node IP, keyword, and trace ID, as well as pagination.
Allows querying metrics from Prometheus using PromQL, with tools for instant queries, range queries, and label value exploration.
Allows querying metrics from VictoriaMetrics using the Prometheus-compatible API, with tools for instant queries, range queries, and label value exploration.
Click on "Install 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., "@observability-mcpList ERROR logs from production Elasticsearch with keyword 'timeout' in applog-* over 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.
Observability MCP
这是一个可观测性 MCP 服务,让 AI 模型可以查询:
正式环境的 Elasticsearch 日志
测试环境的 SkyWalking 日志和 Trace
Prometheus 或 VictoriaMetrics 指标
服务使用 Streamable HTTP,MCP 地址为:
http://你的服务器IP:8000/mcp健康检查地址为:
http://你的服务器IP:8000/health1. 准备配置
项目配置放在 .env 文件中。先复制示例:
cp .env.example .env然后编辑 .env:
nano .env至少需要检查下面这些配置:
# MCP 服务监听地址
MCP_HOST=0.0.0.0
MCP_PORT=8000
# Elasticsearch,多个地址使用英文逗号分隔
ES_URLS=http://es-node-1:9200,http://es-node-2:9200
ES_AUTH_TYPE=basic
ES_USERNAME=your-user
ES_PASSWORD=your-password
ES_DEFAULT_INDEX=*
ES_ALLOWED_INDEX_PATTERNS=*
# Prometheus 或 VictoriaMetrics
METRICS_API_BASE_URL=http://prometheus:9090/api/v1
METRICS_AUTH_TYPE=none
# SkyWalking OAP GraphQL 地址
SKYWALKING_GRAPHQL_URL=http://skywalking-oap:12800/graphql
SKYWALKING_AUTH_TYPE=none认证方式支持:
none:不认证basic:用户名和密码bearer:Bearer Tokenapi_key:API Key
.env 中可能包含密码,不要把它提交到 Git 或发到公开环境。
Related MCP server: opensearch-mcp-server-py
2. Linux 使用 Python 启动
环境要求
Linux
Python 3.11 或更高版本
可以访问 Elasticsearch、SkyWalking 和指标后端
安装
进入项目目录:
cd /path/to/mxmcp创建 Python 虚拟环境:
python3 -m venv .venv启用虚拟环境:
source .venv/bin/activate安装依赖:
python -m pip install --upgrade pip
python -m pip install -r requirements.txt将 .env 加载为环境变量:
set -a
source .env
set +a启动服务:
python -m observability_mcp看到服务监听 8000 端口后,打开另一个终端验证:
curl http://127.0.0.1:8000/health停止服务时按 Ctrl+C。
3. 使用 Docker Compose 启动
环境要求
Docker
Docker Compose
确认项目目录中已经有配置好的 .env,然后执行:
docker compose up -d --build查看运行状态:
docker compose ps查看日志:
docker compose logs -f observability-mcp验证服务:
curl http://127.0.0.1:8000/health停止服务:
docker compose down更新代码后重新构建:
docker compose up -d --build注意:容器中的 127.0.0.1 指向容器自己。如果 Elasticsearch、SkyWalking
或 Prometheus 在其他机器上,.env 中应填写那台机器可访问的 IP 或域名。
4. 连接 MCP 客户端
在支持 Streamable HTTP 的 MCP 客户端中填写:
http://服务器IP:8000/mcp如果 MCP 客户端和服务在同一台机器,可以使用:
http://127.0.0.1:8000/mcp环境选择规则已经写入 MCP instructions:
用户提到测试环境或测试线:查询 SkyWalking
用户提到正式环境或生产环境:查询 Elasticsearch
用户没有说明环境:默认查询正式环境 Elasticsearch
查询无结果时不会自动跨环境重试,而是提示确认环境
5. MCP 工具
日志工具
list_log_indices:列出 Elasticsearch 索引、Alias 或 Data Streamsearch_logs:查询正式环境 Elasticsearch 日志list_skywalking_services:列出测试环境 SkyWalking 服务search_skywalking_logs:查询测试环境 SkyWalking 日志get_skywalking_trace:查询测试环境 SkyWalking Trace
search_logs 支持的常用条件:
trace_idnode_ipkeywordlevelstart_time、end_timeindexlimit
建议尽量指定索引和时间范围。例如:
{
"level": "ERROR",
"node_ip": "zp-llm-app-12-193",
"index": "applog-*",
"start_time": "2026-08-07T00:00:00+08:00",
"end_time": "2026-08-07T23:59:59+08:00",
"limit": 20
}如果响应中 has_more 为 true,下一页只传 next_cursor:
{
"cursor": "lc_xxxxxxxxxxxxxxxxxxxxxxxx"
}指标工具
query_instant:查询某个时刻的 PromQLquery_range:查询一段时间内的 PromQLget_label_values:查询某个标签的可选值
6. 日志 Profile
日志字段配置位于:
config/log-profiles.yamlProfile 用来告诉服务不同索引中的时间、消息、级别、Trace ID、节点和错误堆栈 分别存在哪些字段中。调用者不需要传 Profile,服务会根据索引自动选择。
默认规则包括:
filebeat-*、logs-ecs-*:使用ecsapplog-*:使用offset-log其他索引:使用
generic
修改 Profile 后需要重启 MCP 服务。
7. 常见问题
服务无法启动
先检查 Python 版本和依赖:
python --version
python -m pip install -r requirements.txt再确认 .env 已经加载。Linux Python 启动方式需要先执行:
set -a
source .env
set +a无法连接 Elasticsearch 或指标后端
从 MCP 所在机器测试目标地址:
curl http://目标地址:端口同时检查用户名、密码、防火墙和网络路由。
无法连接 SkyWalking
应连接 OAP 的 HTTP/GraphQL 端口,通常是 12800:
SKYWALKING_GRAPHQL_URL=http://OAP地址:12800/graphql30000 通常是 SkyWalking UI 端口,不是首选的 OAP GraphQL 地址。
日志查询很慢
避免同时使用下面两个条件:
index=*不设置开始和结束时间
推荐指定较小的索引范围和时间范围。limit=5 只限制返回数量,不代表
Elasticsearch 只检查 5 条数据。
8. 开发测试
安装开发依赖:
python -m pip install -r requirements-dev.txt运行测试和代码检查:
python -m pytest -q
python -m ruff check .License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceUnified MCP server for observability and monitoring, providing tools to query metrics, logs, and traces through Prometheus, Grafana, Loki, and Jaeger.2Mozilla Public 2.0
- AlicenseBqualityAmaintenanceMCP server for OpenSearch that enables AI assistants to interact with OpenSearch clusters through a standardized interface for search, index management, and cluster operations.9144Apache 2.0
- AlicenseAqualityDmaintenanceMCP server that gives AI agents access to your application's OpenTelemetry traces for querying, analysis, and debugging.592MIT
- Flicense-qualityFmaintenanceAn 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.5
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server for AI access to SmartBear tools, including BugSnag, Reflect, Swagger, PactFlow, QTM4J.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/blue-sky-exist/observability-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server