ff-ruyijs
A AI Browser run any site JavaScript from Python with the real Firefox engine. Headless SpiderMonkey + Necko for automation and scraping.
翻譯準備中
An MCP Server for querying InfluxDB
翻譯準備中
開發工具JavaScript · DockerfileGitHub @idoru自行安裝營運者未確認
試用過了嗎? 點一下就好,不需要登入。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
安裝型專案無需部署網域也可驗證。個人儲存庫可透過 GitHub 登入驗證,組織儲存庫可使用上方的儲存庫驗證檔案。
製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 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
INFLUXDB_ORG)Query Data: influxdb://query/{orgName}/{fluxQuery}
headers and one record per row, across all result tables)Template variables (bucketName, orgName, fluxQuery) must be percent-encoded, e.g. with encodeURIComponent, so names containing spaces or / and multi-line queries survive the URI.
The server provides these tools:
write-data: Write time-series data in line protocol format
org and bucket are optional when INFLUXDB_ORG / INFLUXDB_BUCKET are set, and fall back to those valuesquery-data: Execute Flux queries
org is optional when INFLUXDB_ORG is set, and falls back to that valuecreate-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 operations. When set, org becomes optional on the write-data and query-data toolsINFLUXDB_BUCKET (optional): Default bucket name. When set, bucket becomes optional on the write-data toolDEBUG (optional): Set to mcp:* to log every MCP message to stderr. This includes query text and written data, so leave it off in productionThe following variables apply only to the Streamable HTTP transport (see HTTP transport security):
MCP_HTTP_HOST (optional): Interface to listen on (defaults to 127.0.0.1; same as --host)MCP_AUTH_TOKEN (optional): When set, every request must send Authorization: Bearer <token>. Required to listen on a non-loopback interfaceMCP_ALLOWED_HOSTS (optional): Comma-separated hostnames (ports are ignored) accepted in the Host header. Defaults to localhost,127.0.0.1,[::1] plus the bind address on loopback; unset means no Host check on other interfacesMCP_HTTP_ALLOW_UNAUTHENTICATED (optional): Set to true to listen on a non-loopback interface without MCP_AUTH_TOKEN, e.g. behind a reverse proxy that authenticates for youMCP_HTTP_BODY_LIMIT (optional): Maximum request body size (defaults to 4mb; accepts b, kb or mb suffixes). Raise it for very large write-data batchesRequests to InfluxDB time out after 10 seconds (60 seconds for queries, 30 seconds for writes), including the time spent reading the response.
To 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
Node.js 20 or later is required.
influxdb-mcp-server uses stdio transport by default. You can explicitly request it with --stdio, or start the server with Streamable HTTP transport by providing the --http option with an optional port number (defaults to 3000). This mode uses an internal Express.js server that listens on 127.0.0.1 unless --host is given:
# Start with Streamable HTTP transport on default port 3000
INFLUXDB_TOKEN=your_token npm start -- --http
# Start with Streamable HTTP transport on a specific port
INFLUXDB_TOKEN=your_token npm start -- --http 8080
If you installed globally or are using npx, you can run:
INFLUXDB_TOKEN=your_token influxdb-mcp-server --http
# or explicitly force stdio
INFLUXDB_TOKEN=your_token influxdb-mcp-server --stdio
# or
INFLUXDB_TOKEN=your_token influxdb-mcp-server --http 8080
Anyone who can reach the HTTP endpoint can read and write InfluxDB with the server's INFLUXDB_TOKEN, so the HTTP transport is locked down by default:
127.0.0.1 only.Host header is not localhost, 127.0.0.1 or [::1], which blocks DNS rebinding attacks from websites open in your browser.MCP_AUTH_TOKEN is set (or MCP_HTTP_ALLOW_UNAUTHENTICATED=true).To expose the server on your network, or from a container, require a bearer token:
INFLUXDB_TOKEN=your_token MCP_AUTH_TOKEN="$(openssl rand -hex 32)" \
influxdb-mcp-server --http 3000 --host 0.0.0.0
Clients then send Authorization: Bearer <MCP_AUTH_TOKEN> with each request. Set MCP_ALLOWED_HOSTS to the hostnames clients use to reach the server for additional DNS rebinding protection. Prefer terminating TLS in front of the server when it is reachable beyond your machine.
The image runs as the unprivileged node user and uses stdio by default:
docker build -t influxdb-mcp-server .
docker run --rm -i -e INFLUXDB_TOKEN=your_token -e INFLUXDB_URL=http://host.docker.internal:8086 influxdb-mcp-server
# Streamable HTTP inside a container must bind 0.0.0.0, so it needs a token
docker run --rm -p 127.0.0.1:3000:3000 -e INFLUXDB_TOKEN=your_token -e MCP_AUTH_TOKEN=your_mcp_token \
influxdb-mcp-server --http 3000 --host 0.0.0.0
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",
"INFLUXDB_BUCKET": "your_bucket"
}
}
}
}
{
"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",
"INFLUXDB_BUCKET": "your_bucket"
}
}
}
}
The server code is organized into a modular structure:
src/
index.js - CLI entry point (argument parsing and transport selection)server.js - MCP server factory registering resources, tools and promptsconfig/ - Configuration related files
env.js - Environment variable handlinghttp.js - HTTP transport options and safety checkshttp/ - Streamable HTTP transport
app.js - Express app (Host validation, bearer auth, body limits)utils/ - Utility functions
influxClient.js - InfluxDB API client with request timeoutscsv.js - Flux CSV response parserflux.js - Flux string escaping and URI parameter decodingloggerConfig.js - Console logger configuration and DEBUG tracingtraceTransport.js - MCP message tracing for DEBUG=mcp:*handlers/ - 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 tests that:
To run the tests:
npm test
MIT