II

idoru/influxdb-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

49 stars 19 forks 质量 83 趋势 14MIT

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服务器提供:

  • 资源:组织数据、桶数据和测量数据的访问
  • 工具:编写数据、执行查询和管理数据库对象
  • 提示词:常见通量查询模板和行协议格式

资源

服务器会暴露以下资源:

  1. 组织列表:influxdb://orgs
  • 在 InfluxDB 实例中显示所有组织
  1. 遗愿清单:influxdb://buckets
  • 显示所有桶及其元数据
  1. 桶尺寸:influxdb://bucket/{bucketName}/measurements
  • 列出指定桶内的所有测量值
  1. 查询数据:influxdb://query/{orgName}/{fluxQuery}
  • 执行 Flux 查询并返回结果作为资源

工具

服务器提供以下工具:

  1. write-data:以行协议格式写入时间序列数据
  • 参数:org、bucket、data、precision(可选)
  1. query-data:执行通量查询
  • 参数:org,查询
  1. 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:

  1. Organizations List: influxdb://orgs

    • Displays all organizations in the InfluxDB instance
  2. Buckets List: influxdb://buckets

    • Shows all buckets with their metadata
  3. Bucket Measurements: influxdb://bucket/{bucketName}/measurements

    • Lists all measurements within a specified bucket (uses INFLUXDB_ORG)
  4. Query Data: influxdb://query/{orgName}/{fluxQuery}

    • Executes a Flux query and returns results as JSON (headers and one record per row, across all result tables)

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:

  1. write-data: Write time-series data in line protocol format

    • Parameters: org, bucket, data, precision (optional)
    • org and bucket are optional when INFLUXDB_ORG / INFLUXDB_BUCKET are set, and fall back to those values
  2. query-data: Execute Flux queries

    • Parameters: org, query
    • org is optional when INFLUXDB_ORG is set, and falls back to that value
  3. create-bucket: Create a new bucket

    • Parameters: name, orgID, retentionPeriodSeconds (optional, whole seconds; omit or pass 0 for infinite retention)
  4. create-org: Create a new organization

    • Parameters: name, description (optional)

Prompts

The server offers these prompt templates:

  1. flux-query-examples: Common Flux query examples
  2. line-protocol-guide: Guide to InfluxDB line protocol format

Configuration

The server requires these environment variables:

  • INFLUXDB_TOKEN (required): Authentication token for the InfluxDB API
在 GitHub 查看完整 README

安装

npx influxdb-mcp-server
新手?先看 mcpskill.org 教程 →

配置

{ "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" } } } }