Write time-series data in line protocol format to an InfluxDB bucket
Execute Flux queries against InfluxDB
Create a new bucket in InfluxDB
Create a new organization in InfluxDB
The InfluxDB MCP provides a seamless interface to interact with InfluxDB time-series databases directly from your AI assistant. It enables querying data, writing new time-series points, and managing database objects like buckets and organizations. With this MCP, you can analyze time-series data, create visualizations, and manage your InfluxDB instance without leaving your AI assistant conversation. It supports the full power of Flux query language and InfluxDB's line protocol for data ingestion.
The InfluxDB MCP server provides a bridge between your AI assistant and InfluxDB instances, allowing you to work with time-series data directly in your conversations. This MCP supports the InfluxDB OSS API v2 and provides access to organization data, buckets, measurements, and query capabilities.
Before using the InfluxDB MCP, you'll need to set up the following environment variables:
INFLUXDB_TOKEN
(required): Your authentication token for the InfluxDB APIINFLUXDB_URL
(optional): The URL of your InfluxDB instance (defaults to http://localhost:8086
)INFLUXDB_ORG
(optional): Default organization name for operations that require itYou can install and run the InfluxDB MCP server in several ways:
This is the simplest approach that requires minimal setup:
INFLUXDB_TOKEN=your_token npx influxdb-mcp-server
If you prefer a global installation:
# Install globally
npm install -g influxdb-mcp-server
# Run the server
INFLUXDB_TOKEN=your_token influxdb-mcp-server
For development or customization:
# 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
To add this MCP to your AI assistant configuration, add the following to your configuration file:
{
"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 MCP exposes these resources:
influxdb://orgs
- Lists all organizations in your InfluxDB instanceinfluxdb://buckets
- Shows all buckets with their metadatainfluxdb://bucket/{bucketName}/measurements
- Lists all measurements within a specified bucketinfluxdb://query/{orgName}/{fluxQuery}
- Executes a Flux query and returns results as a resourceThe MCP includes helpful prompt templates:
flux-query-examples
: Provides common Flux query examples to help you get startedline-protocol-guide
: Offers a guide to InfluxDB line protocol format for writing data