InfluxDB 3 — Claude Code MCP server: query and write databases
The official InfluxDB 3 MCP server lets an agent read and write data, inspect schemas and trace query errors. Handy when you want to dig into a database from chat.
claude mcp add --env INFLUX_DB_PRODUCT_TYPE=<INFLUX_DB_PRODUCT_TYPE> --env INFLUX_DB_TOKEN=<INFLUX_DB_TOKEN> --env INFLUX_DB_INSTANCE_URL=<INFLUX_DB_INSTANCE_URL> --env INFLUX_DB_MANAGEMENT_TOKEN=<INFLUX_DB_MANAGEMENT_TOKEN> --env INFLUX_DB_ACCOUNT_ID=<INFLUX_DB_ACCOUNT_ID> --transport stdio influxdb-3 -- npx -y @influxdata/influxdb3-mcp-serverWhat InfluxDB 3 does
The server hands your agent tools for InfluxDB 3 Core, Enterprise, Cloud Dedicated, Clustered and Cloud Serverless. It can run SQL and InfluxQL, write points, and manage databases and tokens. Which tools show up depends on the profile: with INFLUX_MCP_TOOL_PROFILE=readonly only read and discovery tools remain, and anything that mutates data or administers the instance is left out.
The token travels in a Bearer header and the server never inspects it, so the token's own permissions decide what is reachable. A scoped token simply won't see the rest. Failures come back structured, with error.code, error.recovery and error.retryable. A 403 maps to not_found_or_denied, and a query against a table that doesn't exist tells you to fix the reference via list_tables or describe_table.
You need Node.js v20.11 or newer plus the URL and token of an InfluxDB 3 instance. The Docker path needs Docker. Local development runs on pnpm, pinned in package.json and activated with corepack enable.
What it helps with
- run SQL or InfluxQL against a database from inside the agent
- list databases, tables and columns before writing a query
- figure out why a dashboard panel went blank after a deploy
- tell missing data apart from a broken query
- give an agent read access with no write or admin tools
Example prompts for the agent
- List the databases and tables in InfluxDB, then average the sensor temperature over the last day
- Why does this InfluxQL query return nothing? Check the measurement and its columns
- Build a bounded SQL query against
sensorsand return the rows with any warnings
How to install InfluxDB 3
Platform CLI
claude mcp add --env INFLUX_DB_PRODUCT_TYPE=<INFLUX_DB_PRODUCT_TYPE> --env INFLUX_DB_TOKEN=<INFLUX_DB_TOKEN> --env INFLUX_DB_INSTANCE_URL=<INFLUX_DB_INSTANCE_URL> --env INFLUX_DB_MANAGEMENT_TOKEN=<INFLUX_DB_MANAGEMENT_TOKEN> --env INFLUX_DB_ACCOUNT_ID=<INFLUX_DB_ACCOUNT_ID> --transport stdio influxdb-3 -- npx -y @influxdata/influxdb3-mcp-serverReplace <…> with your own values. 2 more environment variables are in the server README
Platform CLI
codex mcp add influxdb-3 --env INFLUX_DB_PRODUCT_TYPE=<INFLUX_DB_PRODUCT_TYPE> --env INFLUX_DB_TOKEN=<INFLUX_DB_TOKEN> --env INFLUX_DB_INSTANCE_URL=<INFLUX_DB_INSTANCE_URL> --env INFLUX_DB_MANAGEMENT_TOKEN=<INFLUX_DB_MANAGEMENT_TOKEN> --env INFLUX_DB_ACCOUNT_ID=<INFLUX_DB_ACCOUNT_ID> -- npx -y @influxdata/influxdb3-mcp-serverReplace <…> with your own values. 2 more environment variables are in the server README
Config file
{
"mcpServers": {
"influxdb-3": {
"command": "npx",
"args": [
"-y",
"@influxdata/influxdb3-mcp-server"
],
"env": {
"INFLUX_DB_PRODUCT_TYPE": "<INFLUX_DB_PRODUCT_TYPE>",
"INFLUX_DB_TOKEN": "<INFLUX_DB_TOKEN>",
"INFLUX_DB_INSTANCE_URL": "<INFLUX_DB_INSTANCE_URL>",
"INFLUX_DB_MANAGEMENT_TOKEN": "<INFLUX_DB_MANAGEMENT_TOKEN>",
"INFLUX_DB_ACCOUNT_ID": "<INFLUX_DB_ACCOUNT_ID>"
}
}
}
}Replace <…> with your own values. 2 more environment variables are in the server README
Config file
{
"servers": {
"influxdb-3": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@influxdata/influxdb3-mcp-server"
],
"env": {
"INFLUX_DB_PRODUCT_TYPE": "<INFLUX_DB_PRODUCT_TYPE>",
"INFLUX_DB_TOKEN": "<INFLUX_DB_TOKEN>",
"INFLUX_DB_INSTANCE_URL": "<INFLUX_DB_INSTANCE_URL>",
"INFLUX_DB_MANAGEMENT_TOKEN": "<INFLUX_DB_MANAGEMENT_TOKEN>",
"INFLUX_DB_ACCOUNT_ID": "<INFLUX_DB_ACCOUNT_ID>"
}
}
}
}Replace <…> with your own values. 2 more environment variables are in the server README
Platform CLI
gemini mcp add -e INFLUX_DB_PRODUCT_TYPE=<INFLUX_DB_PRODUCT_TYPE> -e INFLUX_DB_TOKEN=<INFLUX_DB_TOKEN> -e INFLUX_DB_INSTANCE_URL=<INFLUX_DB_INSTANCE_URL> -e INFLUX_DB_MANAGEMENT_TOKEN=<INFLUX_DB_MANAGEMENT_TOKEN> -e INFLUX_DB_ACCOUNT_ID=<INFLUX_DB_ACCOUNT_ID> influxdb-3 npx -y @influxdata/influxdb3-mcp-serverReplace <…> with your own values. 2 more environment variables are in the server README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about InfluxDB 3
How do I install InfluxDB 3 in Claude Code?
Run `claude mcp add influxdb3-mcp-server -e INFLUX_DB_PRODUCT_TYPE=<INFLUX_DB_PRODUCT_TYPE> -e INFLUX_DB_TOKEN=<INFLUX_DB_TOKEN> -e INFLUX_DB_MANAGEMENT_TOKEN=<INFLUX_DB_MANAGEMENT_TOKEN> -- npx -y @influxdata/influxdb3-mcp-server`. Replace the placeholders with your own values.
What does the InfluxDB 3 MCP server do?
It gives an agent tools to read and write InfluxDB 3 data, explore schemas and diagnose query errors. In read-only mode the write and admin tools are dropped.
What do I need to run the server?
An InfluxDB 3 instance with its URL and token, plus Node.js v20.11 or newer. The Docker setup also needs Docker.