InfluxDB MCP サーバー
InfluxDB OSS API v2を使用してInfluxDBインスタンスへのアクセスを公開するモデルコンテキストプロトコル(MCP)サーバー。主にClaude Codeによって構築されています。
特徴
この MCP サーバーは以下を提供します。
- リソース: 組織、バケット、測定データへのアクセス
- ツール: データの書き込み、クエリの実行、データベース オブジェクトの管理
- プロンプト: 一般的な Flux クエリとラインプロトコル形式のテンプレート
リソース
サーバーは次のリソースを公開します。
- 組織リスト:
influxdb://orgs
- InfluxDBインスタンス内のすべての組織を表示します
- バケットリスト:
influxdb://buckets
- すべてのバケットとそのメタデータを表示します
- バケット測定:
influxdb://bucket/{bucketName}/measurements
- 指定されたバケット内のすべての測定値を一覧表示します
- クエリデータ:
influxdb://query/{orgName}/{fluxQuery}
- Fluxクエリを実行し、結果をリソースとして返します
ツール
サーバーは次のツールを提供します:
write-data
: 時系列データをラインプロトコル形式で書き込む- パラメータ: org、bucket、data、precision(オプション)
query-data
: Fluxクエリを実行する- パラメータ: org、クエリ
create-bucket
: 新しいバケットを作成する- パラメータ: name、orgID、retentionPeriodSeconds(オプション)
create-org
: 新しい組織を作成する- パラメータ: 名前、説明(オプション)
プロンプト
サーバーは、次のプロンプト テンプレートを提供します。
flux-query-examples
: 一般的な Flux クエリの例line-protocol-guide
: InfluxDB ラインプロトコル形式のガイド
構成
サーバーには次の環境変数が必要です:
INFLUXDB_TOKEN
(必須): InfluxDB API の認証トークンINFLUXDB_URL
(オプション): InfluxDBインスタンスのURL (デフォルトはhttp://localhost:8086
)INFLUXDB_ORG
(オプション): 特定の操作のデフォルトの組織名
インストール
Smithery経由でインストール
Smithery経由で Claude Desktop 用の InfluxDB MCP Server を自動的にインストールするには:
オプション1: npxで実行(推奨)
オプション2: グローバルにインストールする
オプション3: ソースから
Claude for Desktopとの統合
claude_desktop_config.json
にサーバーを追加します。
npx の使用(推奨)
ローカルにインストールした場合
コード構造
サーバー コードはモジュール構造に編成されています。
src/
index.js
- メインサーバーのエントリポイントconfig/
- 設定関連ファイルenv.js
- 環境変数の処理
utils/
- ユーティリティ関数influxClient.js
- InfluxDB API クライアントloggerConfig.js
- コンソールロガーの設定
handlers/
- リソースとツールのハンドラーorganizationsHandler.js
- 組織の一覧bucketsHandler.js
- バケットの一覧measurementsHandler.js
- 測定値リストqueryHandler.js
- クエリ実行writeDataTool.js
- データ書き込みツールqueryDataTool.js
- クエリツールcreateBucketTool.js
- バケット作成ツールcreateOrgTool.js
- 組織作成ツール
prompts/
- プロンプトテンプレートfluxQueryExamplesPrompt.js
- Flux クエリの例lineProtocolGuidePrompt.js
- ラインプロトコルガイド
この構造により、保守性が向上し、テストが容易になり、関心の分離が明確になります。
テスト
リポジトリには、次のような包括的な統合テストが含まれています。
- InfluxDB で Docker コンテナを起動する
- サンプルデータを入力する
- すべてのMCPサーバー機能をテストする
テストを実行するには:
ライセンス
マサチューセッツ工科大学
You must be authenticated.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Claude に InfluxDB 時系列データベース インスタンスへのアクセスを提供し、自然言語によるデータの書き込み、クエリ、組織およびバケットの管理を可能にするモデル コンテキスト プロトコル サーバー。
Related Resources
Related MCP Servers
- -security-license-qualityA Model Context Protocol server that provides tools for connecting to and interacting with various database systems (SQLite, PostgreSQL, MySQL/MariaDB, SQL Server) through a unified interface.Last updated -Python
- -securityFlicense-qualityA Model Context Protocol server that provides tools for interacting with databases, including PostgreSQL, DuckDB, and Google Cloud Storage Parquet files.Last updated -2TypeScript
- -securityFlicense-qualityA Model Context Protocol server that provides secure, read-only access to time-series data stored in InfluxDB 1.8 via JWT authentication.Last updated -Python
- -securityAlicense-qualityA Model Context Protocol server that enables LLMs to interact with databases (currently MongoDB) through natural language, supporting operations like querying, inserting, deleting documents, and running aggregation pipelines.Last updated -TypeScriptMIT License