InfluxDB 3 MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Model Context Protocol (MCP) server for InfluxDB 3 integration. Provides tools, resources, and prompts for interacting with InfluxDB 3 Core and Enterprise, plus InfluxDB Cloud Dedicated, InfluxDB Clustered, and InfluxDB Cloud Serverless via MCP clients.
---
Prerequisites
- **InfluxDB 3 Instance**: URL and token (Core/Enterprise/Cloud Serverless) or Cluster ID and tokens (Cloud Dedicated/Clustered)
- **Node.js**: v20.11 or newer (for npm/npx usage)
- **npm**: v9 or newer (for npm/npx usage)
- **Docker**: (for Docker-based setup)
---
Read-only Agent Workflows
Set INFLUX_MCP_TOOL_PROFILE=readonly when you want an MCP client to explore
and query InfluxDB 3 data without exposing write, admin, token-management, or
host-level tools. In Enterprise deployments that use preview user auth, the
same read-only flow works when the configured bearer credential is a JWT instead
of an apiv3_ token.
Analyst explores an unfamiliar database
An analyst can connect an MCP client such as Claude Desktop, Cursor, Codex, or
another agent harness and ask a question like:
With the read-only profile, the agent can:
1. Call list_databases to see accessible databases.
2. Call list_tables and describe_table to discover measurements and
columns.
3. Treat uncertain tag and field categories as unknown.
4. Build a bounded SQL query with db, q, and optional params.
5. Call query_sql with structured JSON output.
6. Return the result, row count, truncation status, warnings, and correlation
metadata.
The user gets a grounded answer and a reusable query while the agent explores
and queries data without access to mutation or administration tools.
Operator investigates an InfluxQL dashboard query
An operator can troubleshoot an existing InfluxQL dashboard panel and ask:
With the read-only profile, the agent can:
1. Keep the user's query in InfluxQL and call query_influxql.
2. Use SHOW queries and schema discovery to verify the measurement and
referenced columns.
3. Sample recent rows with bounded reads to distinguish missing data from a
broken query.
4. Reject unsafe follow-up attempts, such as SELECT INTO or destructive
statements.
5. Return request_id, query_id, and query_id_source so the operator can
correlate the MCP result with system.queries.id when query history is
available.
6. Emit structured logs to stderr for stdio transports so stdout remains
reserved for MCP protocol messages.
The user gets a practical diagnosis, such as missing data, renamed schema, a
wrong time predicate, or a query failure. The investigation is traceable without
logging full query text by default.
---
Available Tools
| Tool Name | Description | Availability |
| ----------------------------- | ----------------------------------------------------------------------------------------------------- | ------------------------- |
| load_database_context | Load optional custom database context and documentation | All versions |
| get_help | Get help and troubleshooting guidance for InfluxDB operations | All versions |
| write_line_protocol | Write data using InfluxDB line protocol | All versions |
| create_database | Create a new database (with cloud-specific config options) | All versions |
| update_database | Update database configuration (retention for all; maxTables/maxColumns for Cloud Dedicated/Clustered) | All versions |
| delete_database | Delete a database by name (irreversible) | All versions |
| execute_query | Run a SQL query against a database (supports multiple formats) | All versions |
| query_sql | Run bounded read-only SQL with structured response metadata | All versions |
| query_influxql | Run bounded read-only InfluxQL with structured response metadata | All versions |
| get_measurements | List all measurements (tables) in a database | All versions |
| get_measurement_schema | Get schema (columns/types) for a measurement/table | All versions |
| list_tables | List tables, also called measurements, in a database | All versions |
| describe_table | Describe table schema with conservative column categories | All versions |