Skip to main content
Glama
sid-stack001

DevContext

by sid-stack001

DevContext

Python MCP License: MIT

DevContext は、AIコーディングアシスタントとエンジニアに、ランタイムの可観測性データ(ログ、デプロイ、ヘルスメトリクス)を提供し、インシデントのトリアージを支援する、Model Context Protocol (MCP) サーバーと CLI ツールのプロトタイプです。


概要

コーディングアシスタントは、ソースリポジトリを調査し、修正案を作成することはできますが、ランタイムインシデント中に何が起きているか(最近のデプロイ、エラーレートの急上昇、ディスクの枯渇、下流APIの障害など)を把握できないことがよくあります。DevContext は、コマンドラインインターフェイス(CLI)と標準的な MCP ツール呼び出しを通じてランタイムコンテキストを公開するコンセプト実証ツールです。


Related MCP server: AI Incident Monitoring RCA MCP Server

CLI とツールコマンド

DevContext は、コマンドラインから直接実行することも、MCP サーバーとして登録することもできます。

1. devcontext diagnose

組み込みデータセットまたはカスタムファイル/フォルダーに対して、インシデントの自動トリアージを実行します。

# Diagnose built-in service dataset
devcontext diagnose --service order-processing

# Output raw JSON format
devcontext diagnose --service order-processing --json

# Point at custom log, deploy, and health paths (files or log directories)
devcontext diagnose --log-path /var/log/app/ --deploys-path deploys.json --health-path health.json

# Enable experimental Groq LLM extraction
devcontext diagnose --service order-processing --use-llm

2. devcontext serve

MCP ホスト(例: Claude Desktop、Antigravity)に接続するための stdio MCP サーバーを起動します。

devcontext serve

ログ解析オプション

  1. 決定論的パーサー(parser.py: ヒューリスティックを使用してログ行をサンプリングし、構造マッチング(JSON-lines、CSV、キー値ペア、または基本的な括弧区切り/スペース区切りのタイムスタンプ)を試みます。

    • 制限: 単純な単一行ログに最適です。複雑な複数行のスタックトレースや非標準のカスタム形式では、基本的な行マッチングにフォールバックする場合があります。

  2. 実験的 LLM 抽出(extraction.py: オプションで、ログチャンクを Groq の API(response_format={"type": "json_object"})に送信して、構造化されたイベントオブジェクトを抽出します。

    • 制限: API のレイテンシ(約200~400ms)とトークンコストが発生します。API キーがない場合や呼び出しがタイムアウトした場合は、決定論的パーサーにフォールバックします。


データソースオプション

  • 組み込みモックデータ: サービスの一部(例: service_name="order-processing")を渡すと、同梱のデモデータを照会できます。

  • カスタムファイルまたはディレクトリパス:

    • log_path: 単一のログファイル、または分割された .log / .txt ファイルを含むディレクトリへのパス。

    • deploys_path: カスタム deploys.json ファイルへのパス。

    • health_path: カスタム health.json ファイルへのパス。


評価とテストシナリオ

リポジトリには、5 つの合成テストシナリオで検証された評価ハーネス(eval.py)が含まれています。

シナリオ

サービス

シナリオ種別

期待される結果

結果

scenario_1_bad_deploy

payment-service

リソース制限の削減

デプロイ f8a1c92 を特定

合格

scenario_2_disk_full

storage-service

ディスク満杯(直近のデプロイなし)

ディスクの枯渇(98%)を特定

合格

scenario_3_memory_leak

analytics-worker

メモリリーク / OOM

メモリ飽和(97%)を特定

合格

scenario_4_downstream_outage

notification-service

外部 API の停止

SendGrid の 503 エラーを特定

合格

scenario_5_bad_migration

user-service

失敗したデータベースマイグレーション

デプロイ d4e912f を特定

合格

制限と範囲

  • 小さなテストスイート: この評価スイートには、検証用に作成された 5 つの合成テストケースが含まれています。本番環境を網羅するベンチマークではありません。

  • ヒューリスティック推論: diagnose() は単純なルール(例: 最初のエラーから 10 分以内にデプロイが発生したかどうかを確認する)を使用します。実際のインフラストラクチャインシデントはより複雑であることが多く、複数の要因が相互に関与する場合があります。


アーキテクチャ

┌─────────────────────────────────────────────────────────┐
│              CLI / MCP Clients                          │
│     (devcontext CLI / Claude Desktop / Antigravity)     │
└───────────────────────────┬─────────────────────────────┘
                            │ CLI Args / stdio JSON-RPC
┌───────────────────────────▼─────────────────────────────┐
│              DevContext Entry Point                     │
│               (cli.py / server.py)                      │
└───────────────────────────┬─────────────────────────────┘
                            │
┌───────────────────────────▼─────────────────────────────┐
│                 Diagnostic Core (tools.py)               │
└───────┬───────────────────┬─────────────────────┬───────┘
        │                   │                     │
┌───────▼───────────┐ ┌─────▼─────────────┐ ┌─────▼─────────────┐
│ Structure Parser  │ │ Deployment Engine │ │ Health Observer   │
│   (parser.py)     │ │ (deploys.json)    │ │ (health.json)     │
└───────┬───────────┘ └───────────────────┘ └───────────────────┘
        │
┌───────┴─────────────────────────────────────────┐
│  Groq API (Optional LLM log extraction)         │
└─────────────────────────────────────────────────┘

クイックスタートとセットアップ

1. インストール

git clone https://github.com/your-username/devcontext.git
cd devcontext
pip install -e .

2. CLI でサービスを診断

devcontext diagnose --service order-processing

3. MCP サーバー(Claude Desktop)として登録

DevContext を claude_desktop_config.json に追加します。

{
  "mcpServers": {
    "devcontext": {
      "command": "devcontext",
      "args": [
        "serve"
      ]
    }
  }
}

4. 評価スイートを実行

python eval.py

5. 任意の API キー設定

実験的な LLM ログ抽出に Groq を使用する場合は、.env.example.env にコピーしてください。

cp .env.example .env

依存関係と要件

  • Python 3.10+

  • mcp(Model Context Protocol SDK)

  • groq(オプション、LLM 抽出用)


将来の拡張

  • プラグイン可能なアダプタ: CloudWatch、Datadog、Grafana Loki、または Prometheus API に直接接続。

  • 確率的信頼度スコア: 単一の決定論的な文字列ではなく、根本原因の確率分布(例: 95% confidence: bad deploy)を出力。

  • 自動ロールバック提案: 診断とともに、検証済みの git revert コミットや Kubernetes パッチ仕様を生成。


ライセンス

MIT License の下で配布されています。

A
license - permissive license
Not graded
quality - not tested
B
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

  • F
    license
    Not graded
    quality
    B
    maintenance
    Provides telemetry tools for retrieving recent logs and system metrics to support root-cause analysis of infrastructure incidents. Enables autonomous incident triage with grounded verification and human-in-the-loop remediation.
    1
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to investigate production incidents by exposing service health, logs, and deployment data through MCP tools.
    8

View all related MCP servers

Related MCP Connectors

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/sid-stack001/devcontext'

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