SAP RCA MCP Server
SAP RCA MCP サーバー
Azure Log Analytics のデータを照会することで、AI エージェントが SAP システムの根本原因分析(Root Cause Analysis)を実行できるようにする Python MCP サーバー。
アーキテクチャ
AI Agent (Azure AI Foundry / Claude / Copilot Studio)
│ MCP Tool Calls
▼
FastMCP Server (server.py)
├── get_schema → schema_registry.py (table/column metadata)
├── execute_query → la_client.py (validated KQL execution)
├── analyze_results → domain_knowledge.py (SAP error classification)
└── run_full_rca → rca_orchestrator.py (8-step automated workflow)
│
▼
Azure Log Analytics (read-only KQL queries via Managed Identity)Related MCP server: CloudWatch Log Analyst MCP
4 つのツール
ツール | 目的 |
| 登録済みテーブルの正確な列名、型、時刻列、SID 列、KQL ヒントを返します。最初にこれを呼び出してください。 |
| エージェントが生成した KQL クエリを検証(読み取り専用ガード)してから実行します。 |
| SAP ドメイン知識を適用して生の行を分類します:エラーカテゴリ、重大度、推奨事項。 |
| 8 つの RCA ステップをすべて自動実行し、統合された JSON レポートを返します。 |
前提条件
Python 3.11+
Azure CLI(
az)がインストールされていることAzure Log Analytics ワークスペースへのアクセス(ワークスペース ID が必要)
アカウントに
Log Analytics Readerロールが割り当てられていること(またはマネージド ID)
セットアップ
# 1. Clone / navigate to this folder
cd C:\Users\padmajat\Documents\AMS-Agentic-RCA\MCP
# 2. Create virtual environment
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # Linux/macOS
# 3. Install dependencies
pip install -r requirements.txt
# 4. Configure
copy .env.example .env
# Edit .env and fill in AZURE_LOG_ANALYTICS_WORKSPACE_ID and AZURE_TENANT_ID
# 5. Authenticate (local development)
az login設定(.env)
AZURE_LOG_ANALYTICS_WORKSPACE_ID=<your-workspace-guid>
AZURE_TENANT_ID=<your-tenant-id>Azure でマネージド ID を使用する場合、必要なのはワークスペース ID のみです。AZURE_CLIENT_* フィールドはすべて空白のままにしてください。
実行
stdio モード(Claude Desktop、MCP Inspector、Azure AI Foundry ローカル)
python server.py
# or:
mcp dev server.pySSE/HTTP モード(Azure App Service デプロイ)
pip install uvicorn
uvicorn server:mcp --host 0.0.0.0 --port 8000SSE エンドポイントは次のようになります:http://localhost:8000/sse
Claude Desktop に接続
claude_desktop_config.json に追加:
{
"mcpServers": {
"sap-rca": {
"command": "python",
"args": ["C:/Users/padmajat/Documents/AMS-Agentic-RCA/MCP/server.py"],
"env": {
"AZURE_LOG_ANALYTICS_WORKSPACE_ID": "<your-workspace-id>",
"AZURE_TENANT_ID": "<your-tenant-id>"
}
}
}
}Azure AI Foundry に接続
Azure AI Foundry で、次の場所を指す MCP 接続を追加します:
https://<your-app-service>.azurewebsites.net/sse
エージェントとの会話例
フォーカスしたクエリワークフロー:
Agent → get_schema(["SapNetweaver_ShortDumps_CL"])
Agent → execute_query("SapNetweaver_ShortDumps_CL | where serverTimestamp_t > ago(4h) | where SID_s == 'CHA' | take 100")
Agent → analyze_results(results, "short_dumps", context="SID=CHA, last 4h")完全自動 RCA:
Agent → run_full_rca(sid="CHA", time_range_hours=4, issue_description="Multiple batch job failures")
← Returns complete 8-step RCA report登録済みテーブル
現在登録済み(7 件中 1 件):
テーブル | SAP ソース | ステータス |
| ST22 ABAP ショートダンプ | ✅ 登録済み |
| SM21 システムログ | ⏳ スキーマ CSV 待ち |
| SM37 バッチジョブ | ⏳ スキーマ CSV 待ち |
| インスタンス可用性 | ⏳ スキーマ CSV 待ち |
| プロセス可用性 | ⏳ スキーマ CSV 待ち |
| OS メトリクス | ⏳ スキーマ CSV 待ち |
| HA クラスター | ⏳ スキーマ CSV 待ち |
新しいテーブルスキーマの追加
スキーマ CSV(列 + 説明)を提供します —
SchemaforMCP-Details.csvと同じ形式です。既存の
SapNetweaver_ShortDumps_CLエントリをテンプレートとして、schema_registry.pyに新しいエントリを追加します。テーブルにドメイン固有の分析ロジックが必要な場合は、
tools/analyze_results.pyに_analyze_<type>()関数を追加します。tools/rca_orchestrator.pyの_KQL_TEMPLATESに KQL テンプレートを追加します。サーバーを再起動します — 他の変更は不要です。
セキュリティに関する注意事項
execute_queryはすべての KQL 管理コマンド(.ingest、.drop、.setなど)をブロックします。run_full_rcaはパラメータ化された KQL テンプレートを使用します — SID 値は置換前に検証されます。すべての資格情報は環境変数から読み込まれます — コード内にシークレットはありません。
Azure ではマネージド ID を使用してください。App Service 設定に
AZURE_CLIENT_SECRETを保存しないでください。
⚠ 未解決の質問(対応が必要)
サーバーがワークスペースに接続できるようになる前に、以下を提供する必要があります:
# | 内容 | 確認場所 | 更新するファイル |
1 | Log Analytics ワークスペース ID | Azure Portal → Log Analytics ワークスペース → 概要 → ワークスペース ID |
|
2 | Azure テナント ID | Azure Portal → Microsoft Entra ID → 概要 → テナント ID |
|
3 |
| 提供された CSV には |
|
4 | SID_s 列の存在 | ShortDumps テーブルに |
|
5 | 残り 6 つのテーブルスキーマ | 残りのテーブルについてスキーマ CSV( |
|
This server cannot be installed
Maintenance
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
- FlicenseNot gradedqualityDmaintenanceEnables querying and managing Azure Log Analytics workspaces using KQL (Kusto Query Language). Supports executing queries, managing saved queries, and exploring workspace tables and schemas with Service Principal authentication.
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to autonomously query AWS CloudWatch Logs and perform structured root-cause analysis via natural language prompts, using MCP tools for log group listing and Insights queries.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to investigate backend incidents by executing runbooks that gather evidence from observability and storage systems.59MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI-powered analysis of exceptions using vector similarity search and Azure OpenAI for operations teams.
Related MCP Connectors
AI agent run monitoring with incident replay and SLA receipts.
Find relevant security data from Sentinel data lake for building effective agents. More:aka.ms/s/de
Debug, build, and manage Power Automate cloud flows with AI agents
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/vchinnu/AMS-MCPV2'
If you have feedback or need assistance with the MCP directory API, please join our Discord server