{"id":26570847,"url":"https://github.com/idoru/influxdb-mcp-server","last_synced_at":"2025-04-12T06:10:36.482Z","repository":{"id":281784993,"uuid":"946415795","full_name":"idoru/influxdb-mcp-server","owner":"idoru","description":"An MCP Server for querying InfluxDB","archived":false,"fork":false,"pushed_at":"2025-03-11T19:11:08.000Z","size":120,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T07:16:19.606Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idoru.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-11T05:24:06.000Z","updated_at":"2025-04-06T23:51:34.000Z","dependencies_parsed_at":"2025-03-11T06:37:29.656Z","dependency_job_id":null,"html_url":"https://github.com/idoru/influxdb-mcp-server","commit_stats":null,"previous_names":["idoru/influxdb-mcp-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idoru%2Finfluxdb-mcp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idoru%2Finfluxdb-mcp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idoru%2Finfluxdb-mcp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idoru%2Finfluxdb-mcp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idoru","download_url":"https://codeload.github.com/idoru/influxdb-mcp-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248173824,"owners_count":21059594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-22T22:19:18.441Z","updated_at":"2025-04-12T06:10:36.463Z","avatar_url":"https://github.com/idoru.png","language":"JavaScript","readme":"# InfluxDB MCP Server\n\nA Model Context Protocol (MCP) server that exposes access to an InfluxDB instance using the InfluxDB OSS API v2. Mostly built with Claude Code.\n\n## Features\n\nThis MCP server provides:\n\n- **Resources**: Access to organization, bucket, and measurement data\n- **Tools**: Write data, execute queries, and manage database objects\n- **Prompts**: Templates for common Flux queries and Line Protocol format\n\n## Resources\n\nThe server exposes the following resources:\n\n1. **Organizations List**: `influxdb://orgs`\n   - Displays all organizations in the InfluxDB instance\n\n2. **Buckets List**: `influxdb://buckets`\n   - Shows all buckets with their metadata\n\n3. **Bucket Measurements**: `influxdb://bucket/{bucketName}/measurements`\n   - Lists all measurements within a specified bucket\n\n4. **Query Data**: `influxdb://query/{orgName}/{fluxQuery}`\n   - Executes a Flux query and returns results as a resource\n\n## Tools\n\nThe server provides these tools:\n\n1. `write-data`: Write time-series data in line protocol format\n   - Parameters: org, bucket, data, precision (optional)\n\n2. `query-data`: Execute Flux queries\n   - Parameters: org, query\n\n3. `create-bucket`: Create a new bucket\n   - Parameters: name, orgID, retentionPeriodSeconds (optional)\n\n4. `create-org`: Create a new organization\n   - Parameters: name, description (optional)\n\n## Prompts\n\nThe server offers these prompt templates:\n\n1. `flux-query-examples`: Common Flux query examples\n2. `line-protocol-guide`: Guide to InfluxDB line protocol format\n\n## Configuration\n\nThe server requires these environment variables:\n\n- `INFLUXDB_TOKEN` (required): Authentication token for the InfluxDB API\n- `INFLUXDB_URL` (optional): URL of the InfluxDB instance (defaults to `http://localhost:8086`)\n- `INFLUXDB_ORG` (optional): Default organization name for certain operations\n\n## Installation\n\n### Option 1: Run with npx (recommended)\n\n```bash\n# Run directly with npx\nINFLUXDB_TOKEN=your_token npx influxdb-mcp-server\n```\n\n### Option 2: Install globally\n\n```bash\n# Install globally\nnpm install -g influxdb-mcp-server\n\n# Run the server\nINFLUXDB_TOKEN=your_token influxdb-mcp-server\n```\n\n### Option 3: From source\n\n```bash\n# Clone the repository\ngit clone https://github.com/idoru/influxdb-mcp-server.git\ncd influxdb-mcp-server\n\n# Install dependencies\nnpm install\n\n# Run the server\nINFLUXDB_TOKEN=your_token npm start\n```\n\n## Integration with Claude for Desktop\n\nAdd the server to your `claude_desktop_config.json`:\n\n### Using npx (recommended)\n\n```json\n{\n  \"mcpServers\": {\n    \"influxdb\": {\n      \"command\": \"npx\",\n      \"args\": [\"influxdb-mcp-server\"],\n      \"env\": {\n        \"INFLUXDB_TOKEN\": \"your_token\",\n        \"INFLUXDB_URL\": \"http://localhost:8086\",\n        \"INFLUXDB_ORG\": \"your_org\"\n      }\n    }\n  }\n}\n```\n\n### If installed locally\n\n```json\n{\n  \"mcpServers\": {\n    \"influxdb\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/influxdb-mcp-server/src/index.js\"],\n      \"env\": {\n        \"INFLUXDB_TOKEN\": \"your_token\",\n        \"INFLUXDB_URL\": \"http://localhost:8086\",\n        \"INFLUXDB_ORG\": \"your_org\"\n      }\n    }\n  }\n}\n```\n\n## Code Structure\n\nThe server code is organized into a modular structure:\n\n- `src/`\n  - `index.js` - Main server entry point\n  - `config/` - Configuration related files\n    - `env.js` - Environment variable handling\n  - `utils/` - Utility functions\n    - `influxClient.js` - InfluxDB API client\n    - `loggerConfig.js` - Console logger configuration\n  - `handlers/` - Resource and tool handlers\n    - `organizationsHandler.js` - Organizations listing\n    - `bucketsHandler.js` - Buckets listing\n    - `measurementsHandler.js` - Measurements listing\n    - `queryHandler.js` - Query execution\n    - `writeDataTool.js` - Data write tool\n    - `queryDataTool.js` - Query tool\n    - `createBucketTool.js` - Bucket creation tool\n    - `createOrgTool.js` - Organization creation tool\n  - `prompts/` - Prompt templates\n    - `fluxQueryExamplesPrompt.js` - Flux query examples\n    - `lineProtocolGuidePrompt.js` - Line protocol guide\n\nThis structure allows for better maintainability, easier testing, and clearer separation of concerns.\n\n## Testing\n\nThe repository includes comprehensive integration tests that:\n\n- Spin up a Docker container with InfluxDB\n- Populate it with sample data\n- Test all MCP server functionality\n\nTo run the tests:\n\n```bash\nnpm test\n```\n\n## License\n\nMIT\n","funding_links":[],"categories":["Databases","Database \u0026 Messaging MCP Servers","Community Servers","پیاده‌سازی‌های سرور","Table of Contents","MCP 服务器精选列表","Legend","Cloud Services","🗄️ Databases","Uncategorized","🌐 Web Development","🗂️ Extensions by Category"],"sub_categories":["Time-Series \u0026 Metrics","🗄️ \u003ca name=\"databases\"\u003e\u003c/a\u003eپایگاه‌های داده","Databases","How to Submit","🗄️ 数据库交互","🗄️ \u003ca name=\"databases\"\u003e\u003c/a\u003eDatabases","Uncategorized","🗄️ Databases"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidoru%2Finfluxdb-mcp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidoru%2Finfluxdb-mcp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidoru%2Finfluxdb-mcp-server/lists"}