InfluxDB MCP Server
This MCP server connects to InfluxDB v2 to browse database objects, query data, write time-series points, and manage buckets and organizations.
Browse organizations (
influxdb://orgs) and buckets (influxdb://buckets).List measurements in a bucket via
influxdb://bucket/{bucketName}/measurements.Execute Flux queries through
query-dataorinfluxdb://query/{orgName}/{fluxQuery}.Write line protocol data with optional timestamp precision using
write-data.Create buckets with optional retention periods using
create-bucket.Create organizations with optional descriptions using
create-org.Use built-in prompt templates for Flux query examples and line protocol guidance.
Run over stdio or Streamable HTTP with optional authentication, host restrictions, and body limits.
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.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@InfluxDB MCP Server show me the CPU usage data from the last hour"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: InfluxDB OSS API MCP Server
Resources
The server exposes the following resources:
Organizations List:
influxdb://orgsDisplays all organizations in the InfluxDB instance
Buckets List:
influxdb://bucketsShows all buckets with their metadata
Bucket Measurements:
influxdb://bucket/{bucketName}/measurementsLists all measurements within a specified bucket (uses
INFLUXDB_ORG)
Query Data:
influxdb://query/{orgName}/{fluxQuery}Executes a Flux query and returns results as JSON (
headersand 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:
write-data: Write time-series data in line protocol formatParameters: org, bucket, data, precision (optional)
organdbucketare optional whenINFLUXDB_ORG/INFLUXDB_BUCKETare set, and fall back to those values
query-data: Execute Flux queriesParameters: org, query
orgis optional whenINFLUXDB_ORGis set, and falls back to that value
create-bucket: Create a new bucketParameters: name, orgID, retentionPeriodSeconds (optional, whole seconds; omit or pass 0 for infinite retention)
create-org: Create a new organizationParameters: 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 APIINFLUXDB_URL(optional): URL of the InfluxDB instance (defaults tohttp://localhost:8086)INFLUXDB_ORG(optional): Default organization name for certain operations. When set,orgbecomes optional on thewrite-dataandquery-datatoolsINFLUXDB_BUCKET(optional): Default bucket name. When set,bucketbecomes optional on thewrite-datatoolDEBUG(optional): Set tomcp:*to log every MCP message to stderr. This includes query text and written data, so leave it off in production
The following variables apply only to the Streamable HTTP transport (see HTTP transport security):
MCP_HTTP_HOST(optional): Interface to listen on (defaults to127.0.0.1; same as--host)MCP_AUTH_TOKEN(optional): When set, every request must sendAuthorization: Bearer <token>. Required to listen on a non-loopback interfaceMCP_ALLOWED_HOSTS(optional): Comma-separated hostnames (ports are ignored) accepted in theHostheader. Defaults tolocalhost,127.0.0.1,[::1]plus the bind address on loopback; unset means noHostcheck on other interfacesMCP_HTTP_ALLOW_UNAUTHENTICATED(optional): Set totrueto listen on a non-loopback interface withoutMCP_AUTH_TOKEN, e.g. behind a reverse proxy that authenticates for youMCP_HTTP_BODY_LIMIT(optional): Maximum request body size (defaults to4mb; acceptsb,kbormbsuffixes). Raise it for very largewrite-databatches
Requests to InfluxDB time out after 10 seconds (60 seconds for queries, 30 seconds for writes), including the time spent reading the response.
Installation
Installing via Smithery
To install InfluxDB MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @idoru/influxdb-mcp-server --client claudeOption 1: Run with npx (recommended)
# Run directly with npx
INFLUXDB_TOKEN=your_token npx influxdb-mcp-serverOption 2: Install globally
# Install globally
npm install -g influxdb-mcp-server
# Run the server
INFLUXDB_TOKEN=your_token influxdb-mcp-serverOption 3: From source
# 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 startNode.js 20 or later is required.
influxdb-mcp-server uses stdio transport by default. You can explicitly request it with --stdio, or start the server with Streamable HTTP transport by providing the --http option with an optional port number (defaults to 3000). This mode uses an internal Express.js server that listens on 127.0.0.1 unless --host is given:
# Start with Streamable HTTP transport on default port 3000
INFLUXDB_TOKEN=your_token npm start -- --http
# Start with Streamable HTTP transport on a specific port
INFLUXDB_TOKEN=your_token npm start -- --http 8080If you installed globally or are using npx, you can run:
INFLUXDB_TOKEN=your_token influxdb-mcp-server --http
# or explicitly force stdio
INFLUXDB_TOKEN=your_token influxdb-mcp-server --stdio
# or
INFLUXDB_TOKEN=your_token influxdb-mcp-server --http 8080HTTP transport security
Anyone who can reach the HTTP endpoint can read and write InfluxDB with the server's INFLUXDB_TOKEN, so the HTTP transport is locked down by default:
It listens on
127.0.0.1only.On loopback it rejects requests whose
Hostheader is notlocalhost,127.0.0.1or[::1], which blocks DNS rebinding attacks from websites open in your browser.It refuses to listen on any other interface unless
MCP_AUTH_TOKENis set (orMCP_HTTP_ALLOW_UNAUTHENTICATED=true).
To expose the server on your network, or from a container, require a bearer token:
INFLUXDB_TOKEN=your_token MCP_AUTH_TOKEN="$(openssl rand -hex 32)" \
influxdb-mcp-server --http 3000 --host 0.0.0.0Clients then send Authorization: Bearer <MCP_AUTH_TOKEN> with each request. Set MCP_ALLOWED_HOSTS to the hostnames clients use to reach the server for additional DNS rebinding protection. Prefer terminating TLS in front of the server when it is reachable beyond your machine.
Docker
The image runs as the unprivileged node user and uses stdio by default:
docker build -t influxdb-mcp-server .
docker run --rm -i -e INFLUXDB_TOKEN=your_token -e INFLUXDB_URL=http://host.docker.internal:8086 influxdb-mcp-server
# Streamable HTTP inside a container must bind 0.0.0.0, so it needs a token
docker run --rm -p 127.0.0.1:3000:3000 -e INFLUXDB_TOKEN=your_token -e MCP_AUTH_TOKEN=your_mcp_token \
influxdb-mcp-server --http 3000 --host 0.0.0.0Integration with Claude for Desktop
Add the server to your claude_desktop_config.json:
Using npx (recommended)
{
"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"
}
}
}
}If installed locally
{
"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",
"INFLUXDB_BUCKET": "your_bucket"
}
}
}
}Code Structure
The server code is organized into a modular structure:
src/index.js- CLI entry point (argument parsing and transport selection)server.js- MCP server factory registering resources, tools and promptsconfig/- Configuration related filesenv.js- Environment variable handlinghttp.js- HTTP transport options and safety checks
http/- Streamable HTTP transportapp.js- Express app (Host validation, bearer auth, body limits)
utils/- Utility functionsinfluxClient.js- InfluxDB API client with request timeoutscsv.js- Flux CSV response parserflux.js- Flux string escaping and URI parameter decodingloggerConfig.js- Console logger configuration andDEBUGtracingtraceTransport.js- MCP message tracing forDEBUG=mcp:*
handlers/- Resource and tool handlersorganizationsHandler.js- Organizations listingbucketsHandler.js- Buckets listingmeasurementsHandler.js- Measurements listingqueryHandler.js- Query executionwriteDataTool.js- Data write toolqueryDataTool.js- Query toolcreateBucketTool.js- Bucket creation toolcreateOrgTool.js- Organization creation tool
prompts/- Prompt templatesfluxQueryExamplesPrompt.js- Flux query exampleslineProtocolGuidePrompt.js- Line protocol guide
This structure allows for better maintainability, easier testing, and clearer separation of concerns.
Testing
The repository includes comprehensive tests that:
Spin up a Docker container with InfluxDB
Populate it with sample data
Test all MCP server functionality
Exercise the HTTP transport's Host validation, authentication and limits, and the CSV and Flux helpers, without Docker
To run the tests:
npm testLicense
MIT
Available Tools
4 toolscreate-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
Scored across 4 tools
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.
All four names follow the same lowercase hyphenated verb_noun convention (query-data, write-data, create-bucket, create-org). The pattern is fully predictable.
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.
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
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Hosted MCP server for AI-driven data ops. Create apps, manage schemas, and CRUD structured data.
A Model Context Protocol server for Wix AI tools
The Telnyx MCP server is an official implementation of the Model Context Protocol that enables AI clients (like Claude Desktop, Cursor, and OpenAI Agents) to interact with Telnyx's telephony, messaging, and AI assistant APIs. It provides comprehensive capabilities including making and managing phone calls, sending SMS/MMS messages, purchasing and configuring phone numbers, creating AI assistants with custom instructions, managing cloud storage buckets, scraping and embedding website content, and handling integration secrets. The server exists as both a local implementation and a remotely hosted version, allowing developers to integrate real-world communication infrastructure directly into AI applications.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides secure, read-only access to time-series data stored in InfluxDB 1.8 via JWT authentication.4-
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables interactions with InfluxDB's open-source time-series database API, allowing data querying, management, and operations through natural language.-
- AlicenseAqualityDmaintenanceA Model Context Protocol server providing tools for DB queries, API calls, file I/O, and text transformations, enabling AI agents like Claude to perform real-world actions.10MIT
- AlicenseNot gradedqualityDmaintenanceInfluxDB-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