The InfluxDB MCP Server provides a Model Context Protocol server that connects to an InfluxDB instance using the InfluxDB OSS API v2. It allows you to access your time series database resources, execute queries, and manage database objects through a standardized interface that works with Claude and other AI assistants.
To install InfluxDB MCP Server 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
The server requires the following 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 operationsAdd 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 exposes these resources:
Organizations List: influxdb://orgs
Buckets List: influxdb://buckets
Bucket Measurements: influxdb://bucket/{bucketName}/measurements
Query Data: influxdb://query/{orgName}/{fluxQuery}
Write time-series data in line protocol format:
org
: Organization namebucket
: Bucket namedata
: Data in line protocol formatprecision
: Time precision (optional)Execute Flux queries:
org
: Organization namequery
: Flux query stringCreate a new bucket:
name
: Bucket nameorgID
: Organization IDretentionPeriodSeconds
: Retention period in seconds (optional)Create a new organization:
name
: Organization namedescription
: Organization description (optional)The server provides helpful prompt templates:
flux-query-examples
: Common Flux query examplesline-protocol-guide
: Guide to InfluxDB line protocol formatTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "influxdb" '{"command":"npx","args":["influxdb-mcp-server"],"env":{"INFLUXDB_TOKEN":"your_token","INFLUXDB_URL":"http://localhost:8086","INFLUXDB_ORG":"your_org"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"influxdb": {
"command": "npx",
"args": [
"influxdb-mcp-server"
],
"env": {
"INFLUXDB_TOKEN": "your_token",
"INFLUXDB_URL": "http://localhost:8086",
"INFLUXDB_ORG": "your_org"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this 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"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect