Skip to main content
Glama
InfluxDB MCP Server

InfluxDB MCP Server

by idoru

InfluxDB MCP-Server

Schmiedeabzeichen

Ein Model Context Protocol (MCP)-Server, der den Zugriff auf eine InfluxDB-Instanz mithilfe der InfluxDB OSS API v2 ermöglicht. Größtenteils mit Claude Code erstellt.

Merkmale

Dieser MCP-Server bietet:

  • Ressourcen : Zugriff auf Organisations-, Bucket- und Messdaten

  • Tools : Daten schreiben, Abfragen ausführen und Datenbankobjekte verwalten

  • Eingabeaufforderungen : Vorlagen für allgemeine Flux-Abfragen und das Line Protocol-Format

Related MCP server: InfluxDB OSS API MCP Server

Ressourcen

Der Server stellt die folgenden Ressourcen bereit:

  1. Liste der Organisationen : influxdb://orgs

    • Zeigt alle Organisationen in der InfluxDB-Instanz an

  2. Buckets-Liste : influxdb://buckets

    • Zeigt alle Buckets mit ihren Metadaten an

  3. Bucket-Messungen : influxdb://bucket/{bucketName}/measurements

    • Listet alle Messungen innerhalb eines angegebenen Buckets auf

  4. Abfragedaten : influxdb://query/{orgName}/{fluxQuery}

    • Führt eine Flux-Abfrage aus und gibt die Ergebnisse als Ressource zurück

Werkzeuge

Der Server bietet folgende Tools:

  1. write-data : Schreibt Zeitreihendaten im Zeilenprotokollformat

    • Parameter: Organisation, Bucket, Daten, Präzision (optional)

  2. query-data : Flux-Abfragen ausführen

    • Parameter: org, Abfrage

  3. create-bucket : Einen neuen Bucket erstellen

    • Parameter: Name, OrgID, retentionPeriodSeconds (optional)

  4. create-org : Eine neue Organisation erstellen

    • Parameter: Name, Beschreibung (optional)

Eingabeaufforderungen

Der Server bietet diese Eingabeaufforderungsvorlagen:

  1. flux-query-examples : Allgemeine Flux-Abfragebeispiele

  2. line-protocol-guide : Leitfaden zum Zeilenprotokollformat von InfluxDB

Konfiguration

Der Server benötigt diese Umgebungsvariablen:

  • INFLUXDB_TOKEN (erforderlich): Authentifizierungstoken für die InfluxDB-API

  • INFLUXDB_URL (optional): URL der InfluxDB-Instanz (standardmäßig http://localhost:8086 )

  • INFLUXDB_ORG (optional): Standard-Organisationsname für bestimmte Vorgänge

Installation

Installation über Smithery

So installieren Sie den InfluxDB MCP-Server für Claude Desktop automatisch über Smithery :

npx -y @smithery/cli install @idoru/influxdb-mcp-server --client claude

Option 1: Mit npx ausführen (empfohlen)

# Run directly with npx
INFLUXDB_TOKEN=your_token npx influxdb-mcp-server

Option 2: Global installieren

# Install globally
npm install -g influxdb-mcp-server

# Run the server
INFLUXDB_TOKEN=your_token influxdb-mcp-server

Option 3: Aus der Quelle

# Clone the repository
git clone https://github.com/idoru/influxdb-mcp-server.git
cd influxdb-mcp-server

# Install dependencies
npm install

# Run the server
INFLUXDB_TOKEN=your_token npm start

Integration mit Claude für Desktop

Fügen Sie den Server zu Ihrer claude_desktop_config.json hinzu:

Verwendung von npx (empfohlen)

{
  "mcpServers": {
    "influxdb": {
      "command": "npx",
      "args": ["influxdb-mcp-server"],
      "env": {
        "INFLUXDB_TOKEN": "your_token",
        "INFLUXDB_URL": "http://localhost:8086",
        "INFLUXDB_ORG": "your_org"
      }
    }
  }
}

Bei lokaler Installation

{
  "mcpServers": {
    "influxdb": {
      "command": "node",
      "args": ["/path/to/influxdb-mcp-server/src/index.js"],
      "env": {
        "INFLUXDB_TOKEN": "your_token",
        "INFLUXDB_URL": "http://localhost:8086",
        "INFLUXDB_ORG": "your_org"
      }
    }
  }
}

Codestruktur

Der Servercode ist in einer modularen Struktur organisiert:

  • src/

    • index.js - Haupteinstiegspunkt des Servers

    • config/ - Konfigurationsbezogene Dateien

      • env.js - Handhabung von Umgebungsvariablen

    • utils/ - Hilfsfunktionen

      • influxClient.js – InfluxDB-API-Client

      • loggerConfig.js – Konsolen-Logger-Konfiguration

    • handlers/ - Ressourcen- und Tool-Handler

      • organizationsHandler.js – Auflistung der Organisationen

      • bucketsHandler.js – Buckets-Auflistung

      • measurementsHandler.js – Auflistung der Messungen

      • queryHandler.js - Abfrageausführung

      • writeDataTool.js – Tool zum Schreiben von Daten

      • queryDataTool.js - Abfragetool

      • createBucketTool.js – Tool zur Bucket-Erstellung

      • createOrgTool.js – Tool zur Organisationserstellung

    • prompts/ - Eingabeaufforderungsvorlagen

      • fluxQueryExamplesPrompt.js – Flux-Abfragebeispiele

      • lineProtocolGuidePrompt.js - Leitfaden zum Leitungsprotokoll

Diese Struktur ermöglicht eine bessere Wartbarkeit, einfachere Tests und eine klarere Trennung der Belange.

Testen

Das Repository umfasst umfassende Integrationstests, die:

  • Starten Sie einen Docker-Container mit InfluxDB

  • Füllen Sie es mit Beispieldaten

  • Testen Sie alle MCP-Serverfunktionen

So führen Sie die Tests aus:

npm test

Lizenz

MIT

Available Tools

4 tools
create-bucketA

Provision a new bucket under an organization so that subsequent write-data calls have a destination.

Inputs: name (required), orgID (required), retentionPeriodSeconds.

create-orgB

Create a brand-new organization to isolate users or projects before generating buckets and tokens.

Inputs: name (required), description.

query-dataA

Execute a Flux query inside an organization to inspect measurement schemas, run aggregations, or validate recently written data. Default org: "my-organization".

Inputs: query (required), org.

write-dataB

Stream newline-delimited line protocol records into a bucket. Use this after composing measurements so the LLM can insert real telemetry, optionally controlling timestamp precision. Default org: "my-organization".

Inputs: data (required), bucket (required), org, precision.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool maps to a distinct resource and action: query-data reads, write-data ingests, create-bucket provisions storage, and create-org provisions a top-level container. There is no plausible way to confuse these operations with one another.

    Naming Consistency5/5

    All four names follow the same lowercase hyphenated verb_noun convention (query-data, write-data, create-bucket, create-org). The pattern is fully predictable.

    Tool Count4/5

    Four tools is at the thin end of the acceptable range but each one earns its place in the core write/query workflow. A slightly larger surface (listing/cleanup) would round out the set.

    Completeness3/5

    The core read/write path plus resource creation is covered, but there are no list or delete operations for buckets or orgs, leaving lifecycle gaps. The create-org description mentions tokens, yet no token tooling exists, creating a dead end.

    Maintenance

    ActivityMaintained
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that provides secure, read-only access to time-series data stored in InfluxDB 1.8 via JWT authentication.
      4
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      InfluxDB-v1-MCP is a powerful Model Context Protocol (MCP) interface specifically designed for InfluxDB v1.x, enabling AI assistants to intelligently manage and query time-series databases.
      Apache 2.0