InfluxDB MCP Server

by idoru

Integrations

  • Provides templates and execution capabilities for Flux queries, which is the query language for InfluxDB, allowing for data querying and transformation operations.

  • Exposes access to an InfluxDB instance using the InfluxDB OSS API v2, allowing for organization and bucket management, measurement data access, writing time-series data, and executing Flux queries against the database.

InfluxDB MCP-Server

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

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

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

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Ein Model Context Protocol-Server, der Claude Zugriff auf InfluxDB-Zeitreihendatenbankinstanzen bietet und das Schreiben von Daten, Abfragen und Verwalten von Organisationen und Buckets in natürlicher Sprache ermöglicht.

  1. Merkmale
    1. Ressourcen
      1. Werkzeuge
        1. Eingabeaufforderungen
          1. Konfiguration
            1. Installation
              1. Option 1: Mit npx ausführen (empfohlen)
              2. Option 2: Global installieren
              3. Option 3: Aus der Quelle
            2. Integration mit Claude für Desktop
              1. Verwendung von npx (empfohlen)
              2. Bei lokaler Installation
            3. Codestruktur
              1. Testen
                1. Lizenz

                  Related MCP Servers

                  • -
                    security
                    -
                    license
                    -
                    quality
                    A Model Context Protocol server that provides tools for connecting to and interacting with various database systems (SQLite, PostgreSQL, MySQL/MariaDB, SQL Server) through a unified interface.
                    Last updated -
                    Python
                  • -
                    security
                    F
                    license
                    -
                    quality
                    A Model Context Protocol server that provides tools for interacting with databases, including PostgreSQL, DuckDB, and Google Cloud Storage Parquet files.
                    Last updated -
                    2
                    TypeScript
                    • Linux
                    • Apple
                  • -
                    security
                    F
                    license
                    -
                    quality
                    A Model Context Protocol server that provides secure, read-only access to time-series data stored in InfluxDB 1.8 via JWT authentication.
                    Last updated -
                    Python
                  • -
                    security
                    A
                    license
                    -
                    quality
                    A Model Context Protocol server that enables LLMs to interact with databases (currently MongoDB) through natural language, supporting operations like querying, inserting, deleting documents, and running aggregation pipelines.
                    Last updated -
                    TypeScript
                    MIT License
                    • Apple

                  View all related MCP servers

                  ID: 9bo1fbiook