Skip to main content
Glama
didlawowo
by didlawowo

Datadog モデルコンテキストプロトコル (MCP) 🔍

鍛冶屋のバッジ

Datadog APIと連携し、インフラストラクチャから監視データを取得するためのPythonベースのツールです。このMCPは、シンプルなインターフェースから監視状態やKubernetesログに簡単にアクセスできます。

Datadog の機能 🌟

  • モニター状態追跡: 特定のモニター状態を取得して分析する

  • Kubernetes ログ分析: Kubernetes クラスターからエラー ログを抽出してフォーマットする

Related MCP server: MCP Datadog Playcourt

前提条件 📋

  • Python 3.11以上

  • Datadog API およびアプリケーション キー (適切な権限付き)

  • Datadogサイトへのアクセス

インストール🔧

Smithery経由でインストール

Smithery経由で Claude Desktop 用の Datadog を自動的にインストールするには:

npx -y @smithery/cli install @didlawowo/mcp-collection --client claude

必要なパッケージ:

datadog-api-client
fastmcp
loguru
icecream
python-dotenv
uv

環境設定 🔑

Datadog の認証情報を使用して.envファイルを作成します。

DD_API_KEY=your_api_key
DD_APP_KEY=your_app_key

MCP 用の Claude デスクトップ セットアップをセットアップする 🖥️

  1. Claude Desktopをインストールする

# Assuming you're on macOS
brew install claude-desktop

# Or download from official website
https://claude.ai/desktop
  1. Datadog MCP 構成をセットアップします。

# on mac is 
~/Library/Application\ Support/Claude/claude_desktop_config.json


# Add this to your claude config json
```json
    "Datadog-MCP-Server": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "datadog-api-client",
        "--with",
        "fastmcp",
        "--with",
        "icecream",
        "--with",
        "loguru",
        "--with",
        "python-dotenv",
        "fastmcp",
        "run",
        "/your-path/mcp-collection/datadog/main.py"
      ],
      "env": {
        "DD_API_KEY": "xxxx",
        "DD_APP_KEY": "xxx"
      }
    },

使用方法💻

ログを取得する

モニターを取得する

建築 🏗

  • FastMCP Base : ツール管理にFastMCPフレームワークを活用

  • モジュラー設計:モニターとログの機能を分離

  • 型安全性: Python 型ヒントによる完全な型指定のサポート

  • API 抽象化: エラー処理を伴うラップされた Datadog API 呼び出し

MCP と Claude Desktop のセットアップに関するセクションを追加します。

モデルコンテキストプロトコル (MCP) の紹介 🤖

MCPとは何ですか?

モデルコンテキストプロトコル(MCP)は、AIモデルが外部ツールやAPIと標準化された方法で連携できるようにするフレームワークです。これにより、Claudeのようなモデルは以下が可能になります。

  • 外部データにアクセスする

  • コマンドを実行する

  • APIを操作する

  • 会話全体にわたって文脈を維持する

MCPサーバーの例

https://github.com/punkpeye/awesome-mcp-servers?tab=readme-ov-file

MCP セットアップのチュートリアル

https://medium.com/@pedro.aquino.se/how-to-use-mcp-tools-on-claude-desktop-app-and-automate-your-daily-tasks-1c38e22bc4b0

仕組み - 利用可能な機能 🛠️

LLMは提供された関数を使用してデータを取得し、それを使用します

1. モニターの状態を取得する

get_monitor_states(
    name: str,           # Monitor name to search
    timeframe: int = 1   # Hours to look back
)

例:


response = get_monitor_states(name="traefik")

# Sample Output
{
    "id": "12345678",
    "name": "traefik",
    "status": "OK",
    "query": "avg(last_5m):avg:traefik.response_time{*} > 1000",
    "message": "Response time is too high",
    "type": "metric alert",
    "created": "2024-01-14T10:00:00Z",
    "modified": "2024-01-14T15:30:00Z"
}

2. Kubernetesログを取得する

get_k8s_logs(
    cluster: str,            # Kubernetes cluster name
    timeframe: int = 5,      # Hours to look back
    namespace: str = None    # Optional namespace filter
)

例:

logs = get_k8s_logs(
    cluster="prod-cluster",
    timeframe=3,
    namespace="default"
)

# Sample Output
{
    "timestamp": "2024-01-14T22:00:00Z",
    "host": "worker-1",
    "service": "nginx-ingress",
    "pod_name": "nginx-ingress-controller-abc123",
    "namespace": "default",
    "container_name": "controller",
    "message": "Connection refused",
    "status": "error"
}
# Install as MCP extension
cd datadog
task install-mcp

4. インストールの確認

クロードチャットデスクトップ

クロードでデータドッグの接続を確認する

セットアップクロード

5. Datadog MCPツールを使用する

セキュリティに関する考慮事項 🔒

  • APIキーを.envに保存する

  • MCPは隔離された環境で実行される

  • 各ツールには定義された権限があります

  • レート制限が実装されています

トラブルシューティング🔧

MCPインスペクターの使用

# Launch MCP Inspector for debugging
task run-mcp-inspector

MCP インスペクターは以下を提供します。

  • MCP サーバーのステータスをリアルタイムで表示

  • 関数呼び出しログ

  • エラートレース

  • API応答監視

よくある問題と解決策

  1. API認証エラー

    Error: (403) Forbidden

    ➡️ .env で DD_API_KEY と DD_APP_KEY を確認してください

  2. MCP 接続の問題

    Error: Failed to connect to MCP server

    ➡️ claude_desktop_config.json のパスと内容を確認する

  3. モニターが見つかりません

    Error: No monitor found with name 'xxx'

    ➡️ モニター名のスペルと大文字と小文字の区別を確認する

  4. ログはここにあります

代替テキスト

貢献中🤝

お気軽にどうぞ:

  1. バグに関する未解決の問題

  2. 改善のためのPRを送信する

  3. 新機能の追加

ノート📝

  • API 呼び出しは Datadog EU サイトに対して行われます

  • モニター状態のデフォルトの時間枠は1時間です

  • ほとんどのユースケースに対応できるようにページサイズの制限が設定されています

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    C
    quality
    D
    maintenance
    Enables interaction with Datadog's monitoring platform to search logs, search trace spans, and perform trace span aggregation for analysis.
    3
    1,015
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables monitoring and querying of Datadog metrics for Kubernetes clusters, APM traces, infrastructure hosts, and databases through a unified interface.
    10
  • F
    license
    B
    quality
    D
    maintenance
    Enables comprehensive Datadog monitoring capabilities including CI/CD pipeline management, service logs analysis, metrics querying, monitor and SLO management, service definitions retrieval, and team management through Claude and other MCP clients.
    13
    20
  • A
    license
    B
    quality
    D
    maintenance
    Enables interaction with Datadog's monitoring and observability platform through the MCP protocol. Supports incident management, monitor status checks, log searches, metrics queries, APM traces, dashboard access, RUM analytics, host management, and downtime scheduling.
    13
    26
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • Read-only access to Auralogs production logs: search logs, inspect errors, review AI analyses.

  • Investigate errors, track deployments, analyze performance, and manage application monitoring

  • Read-only MCP access to sessions, funnels, campaigns, errors, live visitors, and anomalies.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/didlawowo/mcp-collection'

If you have feedback or need assistance with the MCP directory API, please join our Discord server