IN

InfluxDB OSS API v2 Query MCP Server

Run queries against InfluxDB OSS API v2 on the MCP server to analyze, filter, and visualize time-series data quickly.

Quick Install
npx -y @idoru/influxdb-mcp-server

Overview

The InfluxDB OSS API v2 Query MCP Server provides a lightweight Model Context Protocol (MCP) adaptor that lets model agents and developer tools run Flux queries against an InfluxDB OSS v2 instance. It wraps the InfluxDB API behind a simple MCP-compatible HTTP interface so you can analyze, filter, and extract time‑series results programmatically from LLMs, automation agents, and other orchestration layers without embedding database credentials in each client.

This server is useful when you need a single, audited gateway between automated models and your InfluxDB deployment. It centralizes connection configuration, enforces access patterns, and returns query results in JSON that are easy to consume for downstream processing or visualization.

Features

  • Exposes InfluxDB query capability as an MCP tool, suitable for LLM-based agents and orchestration systems
  • Uses InfluxDB OSS v2 HTTP API (Flux) for full-featured time-series querying
  • Centralized configuration via environment variables (Influx URL, token, org, bucket)
  • Docker-friendly: run locally or in containers
  • Returns JSON query results that are easy to parse and post-process
  • Logging and basic request traceability for debugging and auditability

Installation / Configuration

Clone the repository, set configuration, then run locally or with Docker.

  1. Clone the project
git clone https://github.com/idoru/influxdb-mcp-server.git
cd influxdb-mcp-server
  1. Configure environment variables (example .env)
# .env
INFLUX_URL=https://influx.example.com      # InfluxDB OSS v2 base URL
INFLUX_TOKEN=your-influxdb-token          # Token with read/query permissions
INFLUX_ORG=your-org                       # default organization (optional)
INFLUX_BUCKET=your-bucket                 # default bucket (optional)
PORT=8080                                 # server port
LOG_LEVEL=info
  1. Install and run (Node.js based example)
# install (if the repo uses npm)
npm install

# start
npm start
# or
node ./src/server.js
  1. Run with Docker
docker build -t influxdb-mcp-server:latest .
docker run -e INFLUX_URL=https://influx.example.com \
           -e INFLUX_TOKEN=your-influxdb-token \
           -e INFLUX_ORG=your-org \
           -e INFLUX_BUCKET=your-bucket \
           -p 8080:8080 \
           influxdb-mcp-server:latest

Optional docker-compose snippet:

version: "3.8"
services:
  mcp:
    image: influxdb-mcp-server:latest
    environment:
      - INFLUX_URL=https://influx.example.com
      - INFLUX_TOKEN=${INFLUX_TOKEN}
      - INFLUX_ORG=your-org
      - INFLUX_BUCKET=your-bucket
    ports:
      - "8080:8080"

Environment variables reference

VariableRequired?Purpose
INFLUX_URLyesBase URL for InfluxDB OSS v2 (e.g. https://influx.local:8086)
INFLUX_TOKENyesToken with permissions to execute Flux queries
INFLUX_ORGoptionalDefault organization to use for queries
INFLUX_BUCKEToptionalDefault bucket to use for queries
PORToptionalPort to bind the MCP server (default: 8080)
LOG_LEVELoptionalLogging verbosity (info, debug, warn, error)

Available Resources

  • GitHub repository: https://github.com/idoru/influxdb-mcp-server
  • InfluxDB OSS v2 API docs (Flux queries): https://docs.influxdata.com/influxdb/v2.0/api-guide/
  • Flux language reference: https://docs.influxdata.com/flux/v0.x/

The server exposes an MCP-style tool (commonly named something like “influxdb” or “influx-query”) that accepts JSON requests containing a Flux query and optional overrides (org, bucket, time range). Results are returned as structured JSON rows with timestamps, fields and tags.

Example request pattern (MCP tool invocation)

POST /tools/influxdb
Content-Type: application/json