igrid-sce-mcp-tool
igrid-sce-mcp-tool v4 — 読み取り / 書き込み / 管理
既存のiGrid-Prometheus REST API向けのNode.js/JavaScript MCP統合レイヤーです。iGridバックエンドと既存の8つのツール分割は変更されていません。このバージョンでは、MCPツールレベルでSAP BTP XSUAAロールベースの認可を追加しています。
認可モデル
このプロジェクトでは、3つのXSUAAスコープ、3つのロールテンプレート、および3つの定義済みロールコレクションを定義しています。
ロールコレクション | ロールテンプレート | スコープ | 許可されるMCP操作 |
|
|
| GET/読み取りツールのみ |
|
|
| POST/書き込みツールのみ |
|
|
| 全8ツール |
認可は、共通のMCP toolHandler 内で、下流のiGrid APIリクエストの前にチェックされます。必要なスコープを持たないユーザーは、Forbidden: MCPツールエラーを受け取ります。
Related MCP server: agent-sudo-mcp
正確に8つのMCPツール
Bearerグループ — src/tools/bearer-tools.js
igrid_list_domains→GET /api/hub/datasets→ 読み取り/管理igrid_get_template→GET /api/hub/template/:domain→ 読み取り/管理igrid_run_agent→POST /api/ai/run→ 書き込み/管理igrid_propose_action→POST /api/ai/action/propose→ 書き込み/管理igrid_decide_action→POST /api/ai/action/decide→ 書き込み/管理igrid_metrics→GET /api/ai/metrics→ 読み取り/管理
x-api-keyグループ — src/tools/api-key-tools.js
igrid_ingest_csv→POST /api/ingest/:domain→ 書き込み/管理igrid_export_csv→GET /api/export/:domain→ 読み取り/管理
igrid_propose_action は、要求された認可ルールが実際のHTTP操作に基づいており、このツールがPOSTを使用するため、意図的に書き込みとして分類されています。
igrid_health MCPツールは公開されていません。/healthz はアプリケーションのヘルスエンドポイントとしてのみ残ります。
既存の下流iGridの動作は変更されていません
6つのツールは引き続きiGrid Bearer/サービスセッションを使用します。
igrid_ingest_csvおよびigrid_export_csvは引き続きiGridx-api-keyチャネルを使用します。DestinationサービスまたはConnectivityサービスは導入されていません。
資格情報やシークレットはハードコードされていません。
重要なファイル
xs-security.json XSUAA scopes, role templates, role collections
src/auth/xsuaa.js XSUAA authentication + OAuth metadata
src/auth/authorization.js Read/Write/Admin authorization checks
src/context/auth-context.js Per-request auth context propagation
src/tools/response.js Common MCP tool-level enforcement
src/tools/bearer-tools.js 6 Bearer tools and permission mapping
src/tools/api-key-tools.js 2 x-api-key tools and permission mapping環境
IGRID_BASE_URL=https://igrid-prometheus.azurewebsites.net
IGRID_API_KEY=<IGRID_API_KEY>
IGRID_BEARER_TOKEN=<optional pre-issued iGrid Bearer>
IGRID_SERVICE_EMAIL=<optional approved iGrid service email>
IGRID_SERVICE_PASSWORD=<optional approved iGrid service password>
IGRID_MFA_CODE=<optional MFA code>
IGRID_MFA_BODY_JSON=<approved MFA JSON body using {{code}}>
IGRID_REQUEST_TIMEOUT_MS=30000
MCP_TRANSPORT=http
MCP_HOST=0.0.0.0
MCP_PORT=8080
MCP_PATH=/mcp
# Local stdio / local HTTP test authorization only.
# Ignored for a hosted request authenticated through XSUAA.
MCP_LOCAL_ROLE=Admin
MCP_HTTP_AUTH_TOKEN=Bearerツールについては、事前に発行された IGRID_BEARER_TOKEN が推奨されます。存在しない場合、既存のトークンマネージャーは、必要なMFA設定が提供されていれば、承認されたiGridログイン/MFA契約を使用できます。
ビルド
npm install
npm run check
npm run security:check
npm test
npx mbt build -t mta_archivesBTPデプロイ
cf login
cf target -o <ORG> -s <SPACE>
cf deploy mta_archives/igrid-sce-mcp-tool_4.0.0.mtar -fデプロイ後にiGridシークレットを設定:
cf set-env igrid-sce-mcp-tool IGRID_API_KEY '<IGRID_API_KEY>'
cf set-env igrid-sce-mcp-tool IGRID_BEARER_TOKEN '<IGRID_BEARER_TOKEN>'
cf restart igrid-sce-mcp-toolまたは、承認されたサービスログイン/MFAフローを使用する場合:
cf set-env igrid-sce-mcp-tool IGRID_SERVICE_EMAIL '<SERVICE_EMAIL>'
cf set-env igrid-sce-mcp-tool IGRID_SERVICE_PASSWORD '<SERVICE_PASSWORD>'
cf set-env igrid-sce-mcp-tool IGRID_MFA_BODY_JSON '<APPROVED_JSON_WITH_{{code}}>'
cf restart igrid-sce-mcp-toolXSUAAロール割り当て
デプロイにより、xs-security.json からXSUAAサービスインスタンス igrid-sce-mcp-tool-xsuaa が作成/更新されます。
デプロイ後、SAP BTPサブアカウントで:
セキュリティ → ロールコレクション を開きます。
定義済みコレクション
iGrid-MCP-Read、iGrid-MCP-Write、およびiGrid-MCP-Adminが存在することを確認します。iGrid-MCP-Readを読み取り専用ユーザーに割り当てます。iGrid-MCP-Writeを書き込み専用ユーザーに割り当てます。iGrid-MCP-Adminは、GETおよびPOSTのMCPツールの両方を必要とするユーザーにのみ割り当てます。MCPクライアントを再認証して、新しいトークンに割り当てられたスコープが含まれるようにします。
ユーザーが読み取りのみの場合、POSTツールはMCPレイヤーで失敗します。ユーザーが書き込みのみの場合、GETツールは失敗します。管理者は8つのツールすべてを呼び出すことができます。
OAuth / Claude remote MCP
デプロイされたエンドポイントを使用:
https://<BTP_ROUTE>/mcpOAuthディスカバリメタデータは、XSUAAの read、write、admin スコープを通知するようになりました。ユーザー固有のロール適用には、通常は認可コードを使用して、ユーザーのBTPロールコレクションがトークンに反映されるユーザートークンを生成するOAuthフローを使用します。
サービスキーは引き続きXSUAA OAuthクライアント資格情報を提供できますが、client_credentials トークンは技術的なクライアントIDであり、人間のユーザーのロールコレクションを継承したものとして扱うべきではありません。
ローカル stdio
ローカル stdio にはBTPユーザーJWTがないため、ロールの動作は MCP_LOCAL_ROLE でシミュレートされます。デフォルトは Admin で、以前のローカル動作を維持します。
読み取り専用のローカルテスト:
MCP_LOCAL_ROLE=Read npm run start:stdio書き込み専用のローカルテスト:
MCP_LOCAL_ROLE=Write npm run start:stdio完全なローカルテスト:
MCP_LOCAL_ROLE=Admin npm run start:stdioClaude Desktop/Codeの例:
{
"mcpServers": {
"igrid-sce-mcp-tool": {
"command": "node",
"args": ["/ABSOLUTE/PATH/igrid-sce-mcp-tool/src/server.js"],
"env": {
"MCP_TRANSPORT": "stdio",
"MCP_LOCAL_ROLE": "Read",
"IGRID_BASE_URL": "https://igrid-prometheus.azurewebsites.net",
"IGRID_API_KEY": "<IGRID_API_KEY>",
"IGRID_BEARER_TOKEN": "<IGRID_BEARER_TOKEN>"
}
}
}
}ロール受け入れテスト
3人のユーザー(または3つのユーザーロール割り当て)を使用し、各割り当て後に新しいトークンを取得します。
読み取りユーザー
期待される成功:
igrid_list_domains
igrid_get_template
igrid_metrics
igrid_export_csv期待される Forbidden::
igrid_run_agent
igrid_propose_action
igrid_decide_action
igrid_ingest_csv書き込みユーザー
期待される成功:
igrid_run_agent
igrid_propose_action
igrid_decide_action
igrid_ingest_csv期待される Forbidden::
igrid_list_domains
igrid_get_template
igrid_metrics
igrid_export_csv管理者ユーザー
8つのツールすべてがMCPロールチェックに合格する必要があります。下流のiGrid認証/認可およびリクエスト検証は引き続き適用されます。
セキュリティに関する注意事項
権限チェックはiGrid API呼び出しの前に行われます。
XSUAAはインバウンドMCP権限を制御します。iGridは下流の資格情報とビジネス認可について引き続き権限を持ちます。
iGrid APIキー、iGridパスワード、Bearerトークン、XSUAAクライアントシークレット、またはサービスキーをソース管理に絶対に配置しないでください。
簡潔なセキュリティモデルについては、
README-SECURITY.mdを参照してください。
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
- Flicense-qualityAmaintenanceProvides a trust and governance layer for AI agents, enabling secure API access, credential vaulting, paid execution with human approval, and automatic call resume.81
- AlicenseAqualityAmaintenanceLocal zero-trust permission gateway for AI agents. Enforces policy-based tool authorization, human approvals, scoped permissions, and cryptographically verifiable audit logs.45Apache 2.0
- Alicense-qualityCmaintenanceEnables AI agents to discover and execute tools via a secure MCP server with JWT authentication, RBAC, rate limiting, and audit logging.1MIT
- Alicense-qualityBmaintenanceProvides a secure MCP gateway for AI agents to access APIs without exposing raw credentials, with scoped access, audit logging, and OAuth support.MIT
Related MCP Connectors
Runtime permission, approval, and audit layer for AI agent tool execution.
Single entry point for the GOSCE portfolio: routes orchestrators to verified agents by capability, w
Build, validate, and deploy multi-agent AI solutions from any AI environment.
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/tkrishnav31/igrid_aits--mcp_tool'
If you have feedback or need assistance with the MCP directory API, please join our Discord server