by idoru
Enables querying, writing, and managing InfluxDB resources through the Model Context Protocol, offering organized endpoints for organizations, buckets, measurements, and Flux queries.
Provides a Model Context Protocol (MCP) interface to an InfluxDB instance, exposing endpoints for listing organizations, buckets, measurements, executing Flux queries, writing line‑protocol data, and creating database objects.
INFLUXDB_TOKEN
(authentication token). Optional INFLUXDB_URL
(defaults to http://localhost:8086
) and INFLUXDB_ORG
for default organization.npx
:
INFLUXDB_TOKEN=your_token npx influxdb-mcp-server
influxdb://orgs
, influxdb://buckets
, influxdb://bucket/{bucketName}/measurements
, or influxdb://query/{orgName}/{fluxQuery}
.write-data
, query-data
, create-bucket
, and create-org
through the MCP interface.Q: What environment variables are required?
INFLUXDB_TOKEN
(mandatory). INFLUXDB_URL
and INFLUXDB_ORG
are optional with sensible defaults.Q: Can I run the server globally after installing with npm?
npm install -g influxdb-mcp-server
, start it with INFLUXDB_TOKEN=your_token influxdb-mcp-server
.Q: How do I add the server to Claude for Desktop?
claude_desktop_config.json
referencing the npx
command (see the README for the exact JSON snippet).Q: Is there a way to test the server locally?
npm test
. The test suite spins up an InfluxDB Docker container, populates sample data, and verifies all MCP endpoints.Q: Where are the source files located?
src/index.js
. Handlers, utilities, and prompts are organized under src/handlers
, src/utils
, and src/prompts
respectively.A Model Context Protocol (MCP) server that exposes access to an InfluxDB instance using the InfluxDB OSS API v2. Mostly built with Claude Code.
This MCP server provides:
The server exposes the following resources:
Organizations List: influxdb://orgs
Buckets List: influxdb://buckets
Bucket Measurements: influxdb://bucket/{bucketName}/measurements
Query Data: influxdb://query/{orgName}/{fluxQuery}
The server provides these tools:
write-data
: Write time-series data in line protocol format
query-data
: Execute Flux queries
create-bucket
: Create a new bucket
create-org
: Create a new organization
The server offers these prompt templates:
flux-query-examples
: Common Flux query examplesline-protocol-guide
: Guide to InfluxDB line protocol formatThe server requires these environment variables:
INFLUXDB_TOKEN
(required): Authentication token for the InfluxDB APIINFLUXDB_URL
(optional): URL of the InfluxDB instance (defaults to http://localhost:8086
)INFLUXDB_ORG
(optional): Default organization name for certain operationsTo install InfluxDB MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @idoru/influxdb-mcp-server --client claude
# Run directly with npx
INFLUXDB_TOKEN=your_token npx influxdb-mcp-server
# Install globally
npm install -g influxdb-mcp-server
# Run the server
INFLUXDB_TOKEN=your_token influxdb-mcp-server
# 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
Add the server to your claude_desktop_config.json
:
{
"mcpServers": {
"influxdb": {
"command": "npx",
"args": ["influxdb-mcp-server"],
"env": {
"INFLUXDB_TOKEN": "your_token",
"INFLUXDB_URL": "http://localhost:8086",
"INFLUXDB_ORG": "your_org"
}
}
}
}
{
"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"
}
}
}
}
The server code is organized into a modular structure:
src/
index.js
- Main server entry pointconfig/
- Configuration related files
env.js
- Environment variable handlingutils/
- Utility functions
influxClient.js
- InfluxDB API clientloggerConfig.js
- Console logger configurationhandlers/
- Resource and tool handlers
organizationsHandler.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 toolprompts/
- Prompt templates
fluxQueryExamplesPrompt.js
- Flux query exampleslineProtocolGuidePrompt.js
- Line protocol guideThis structure allows for better maintainability, easier testing, and clearer separation of concerns.
The repository includes comprehensive integration tests that:
To run the tests:
npm test
MIT
Please log in to share your review and rating for this MCP.
{ "mcpServers": { "influxdb": { "command": "npx", "args": [ "influxdb-mcp-server" ], "env": { "INFLUXDB_TOKEN": "<YOUR_INFLUXDB_TOKEN>", "INFLUXDB_URL": "http://localhost:8086", "INFLUXDB_ORG": "<YOUR_DEFAULT_ORG>" } } } }
Explore related MCPs that share similar capabilities and solve comparable challenges
by googleapis
An MCP server that streamlines database tool development by handling connection pooling, authentication, observability, and secure access, allowing agents to interact with databases via natural language.
by bytebase
Provides a universal gateway that lets MCP‑compatible clients explore and query MySQL, PostgreSQL, SQL Server, MariaDB, and SQLite databases through a single standardized interface.
by designcomputer
Enables secure interaction with MySQL databases via the Model Context Protocol, allowing AI applications to list tables, read contents, and execute queries safely.
by benborla
Provides read‑only access to MySQL databases for large language models, allowing schema inspection and safe execution of SQL queries.
by ClickHouse
Enables AI assistants to run read‑only ClickHouse queries, list databases and tables, and execute embedded chDB queries through an MCP interface.
by chroma-core
Offers an MCP server exposing Chroma's vector database capabilities for LLM applications, supporting collection and document management, multiple embedding functions, and flexible client types such as in‑memory, persistent, HTTP, and cloud.
by kiliczsh
Enables LLMs to interact with MongoDB databases via a standardized interface, offering schema inspection, query execution, aggregation, and write capabilities, with optional read‑only mode and smart ObjectId handling.
by domdomegg
Provides read and write access to Airtable bases for AI systems, enabling inspection of schemas and manipulation of records.
by XGenerationLab
A Model Context Protocol (MCP) server that enables natural language queries to databases