
idoru/influxdb-mcp-server 是从 https://github.com/idoru/influxdb-mcp-server. 导入的 MCP 服务器候选
概览
idoru/influxdb-mcp-server 是从 https://github.com/idoru/influxdb-mcp-server. 导入的 MCP 服务器候选
概述(AI 翻译)
一个模型上下文协议(MCP)服务器,利用 InfluxDB OSS API v2 暴露对 InfluxDB v2 实例的访问。主要使用 Claude 代码构建。
特色
该MCP服务器提供:
- 资源:组织数据、桶数据和测量数据的访问
- 工具:编写数据、执行查询和管理数据库对象
- 提示词:常见通量查询模板和行协议格式
资源
服务器会暴露以下资源:
- 组织列表:
influxdb://orgs
- 在 InfluxDB 实例中显示所有组织
- 遗愿清单:
influxdb://buckets
- 显示所有桶及其元数据
- 桶尺寸:
influxdb://bucket/{bucketName}/measurements
- 列出指定桶内的所有测量值
- 查询数据:
influxdb://query/{orgName}/{fluxQuery}
- 执行 Flux 查询并返回结果作为资源
工具
服务器提供以下工具:
write-data:以行协议格式写入时间序列数据
- 参数:org、bucket、data、precision(可选)
query-data:执行通量查询
- 参数:org,查询
create-bucket:创建新桶
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
InfluxDB v2 MCP Server
A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2. Mostly built with Claude Code.
Features
This MCP server provides:
- Resources: Access to organization, bucket, and measurement data
- Tools: Write data, execute queries, and manage database objects
- Prompts: Templates for common Flux queries and Line Protocol format
Resources
The server exposes the following resources:
-
Organizations List:
influxdb://orgs- Displays all organizations in the InfluxDB instance
-
Buckets List:
influxdb://buckets- Shows all buckets with their metadata
-
Bucket Measurements:
influxdb://bucket/{bucketName}/measurements- Lists all measurements within a specified bucket (uses
INFLUXDB_ORG)
- Lists all measurements within a specified bucket (uses
-
Query Data:
influxdb://query/{orgName}/{fluxQuery}- Executes a Flux query and returns results as JSON (
headersand one record per row, across all result tables)
- Executes a Flux query and returns results as JSON (
Template variables (bucketName, orgName, fluxQuery) must be percent-encoded, e.g. with encodeURIComponent, so names containing spaces or / and multi-line queries survive the URI.
Tools
The server provides these tools:
-
write-data: Write time-series data in line protocol format- Parameters: org, bucket, data, precision (optional)
organdbucketare optional whenINFLUXDB_ORG/INFLUXDB_BUCKETare set, and fall back to those values
-
query-data: Execute Flux queries- Parameters: org, query
orgis optional whenINFLUXDB_ORGis set, and falls back to that value
-
create-bucket: Create a new bucket- Parameters: name, orgID, retentionPeriodSeconds (optional, whole seconds; omit or pass 0 for infinite retention)
-
create-org: Create a new organization- Parameters: name, description (optional)
Prompts
The server offers these prompt templates:
flux-query-examples: Common Flux query examplesline-protocol-guide: Guide to InfluxDB line protocol format
Configuration
The server requires these environment variables:
INFLUXDB_TOKEN(required): Authentication token for the InfluxDB API
安装
npx influxdb-mcp-server配置
{
"mcpServers": {
"influxdb": {
"command": "npx",
"args": ["influxdb-mcp-server"],
"env": {
"INFLUXDB_TOKEN": "your_token",
"INFLUXDB_URL": "http://localhost:8086",
"INFLUXDB_ORG": "your_org",
"INFLUXDB_BUCKET": "your_bucket"
}
}
}
}