Skip to main content
Glama
ramraj-patel

query-layer

by ramraj-patel

指标查询层 API 的 MCP 服务器

一个 MCP(Model Context Protocol)服务器,向 AI 助手暴露指标查询层 API。使用官方 Python MCP SDK v2 构建。

快速入门

# Prerequisites: Python 3.10+, uv
uv sync
uv run mcp dev src/server.py

在控制台打印的 URL 打开 MCP Inspector。你将看到 ping 工具可用。

Related MCP server: prometheus-mcp

与 Cursor 集成

.cursor/mcp.json 文件已预先配置。重启 Cursor 后,query-layer MCP 服务器即可供 AI 助手使用。

使用 Phoenix 进行本地追踪(可选)

# Terminal 1: start Phoenix
uv run phoenix serve

# Terminal 2: run the server pointing at Phoenix
export PHOENIX_COLLECTOR_ENDPOINT=http://localhost:6006
uv run mcp dev src/server.py

在 http://localhost:6006 查看追踪信息 — Phoenix 原生渲染 MCP 工具调用、提示词和 GenAI spans。

文档

文档

用途

计划

问题陈述、解决方案、实施计划

审查

生产级计划审查

设计

MCP 概念、技术选型、设计决策

快速入门

设置、安装、运行、配置、故障排查

可观测性

日志、追踪、OTLP、本地 Phoenix

项目结构

src/
  server.py          # MCPServer + tools (entry point)
  logging_config.py  # Structured JSON logging to stderr
  otel_config.py     # OpenTelemetry exporter configuration
.cursor/
  mcp.json           # Cursor MCP server configuration
docs/
  plan.md            # Full implementation plan
  review.md          # Plan review
  design.md          # Design document
  getting-started.md # Setup guide
  observability.md   # Observability guide

许可证

Apache 2.0 — 请参阅 LICENSE。

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    Provides access to Prometheus metrics and queries through standardized Model Context Protocol interfaces, allowing AI assistants to execute PromQL queries and analyze metrics data.
    6
    521
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    Provides seamless integration between AI assistants and Prometheus, enabling natural language interactions with your monitoring infrastructure. This server allows for effortless querying, discovery, and analysis of metrics.
    10
    497 npm
    27
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to query Prometheus metrics, monitor alerts, and analyze system health through read-only access to your Prometheus server with built-in query safety and optional AI-powered metric analysis.
    MIT