igrid-sce-mcp-tool
Provides tools for interacting with SAP iGrid APIs through SAP BTP XSUAA authorization, enabling management of domains, templates, AI agents, actions, metrics, and CSV data import/export.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@igrid-sce-mcp-tool list all domains"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
igrid-sce-mcp-tool v4 — Read / Write / Admin
Node.js/JavaScript MCP integration layer for the existing iGrid-Prometheus REST APIs. The iGrid backend and the existing eight-tool split are unchanged; this version adds SAP BTP XSUAA role-based authorization at the MCP tool level.
Authorization model
The project now defines three XSUAA scopes, three role templates, and three predefined role collections:
Role collection | Role template | Scopes | Allowed MCP operations |
|
|
| GET/read tools only |
|
|
| POST/write tools only |
|
|
| All eight tools |
Authorization is checked inside the common MCP toolHandler before any downstream iGrid API request. A user without the required scope receives a Forbidden: MCP tool error.
Related MCP server: agent-sudo-mcp
Exactly 8 MCP tools
Bearer group — src/tools/bearer-tools.js
igrid_list_domains→GET /api/hub/datasets→ Read/Adminigrid_get_template→GET /api/hub/template/:domain→ Read/Adminigrid_run_agent→POST /api/ai/run→ Write/Adminigrid_propose_action→POST /api/ai/action/propose→ Write/Adminigrid_decide_action→POST /api/ai/action/decide→ Write/Adminigrid_metrics→GET /api/ai/metrics→ Read/Admin
x-api-key group — src/tools/api-key-tools.js
igrid_ingest_csv→POST /api/ingest/:domain→ Write/Adminigrid_export_csv→GET /api/export/:domain→ Read/Admin
igrid_propose_action is intentionally classified as Write because the requested authorization rule is based on the actual HTTP operation and this tool uses POST.
No igrid_health MCP tool is exposed. /healthz remains only the application health endpoint.
Existing downstream iGrid behavior is unchanged
Six tools continue to use the iGrid Bearer/service session.
igrid_ingest_csvandigrid_export_csvcontinue to use the iGridx-api-keychannel.No Destination or Connectivity service is introduced.
No credentials or secrets are hard-coded.
Important files
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 mappingEnvironment
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=For Bearer tools, a pre-issued IGRID_BEARER_TOKEN is preferred. If absent, the existing token manager can use the approved iGrid login/MFA contract when the required MFA configuration is supplied.
Build
npm install
npm run check
npm run security:check
npm test
npx mbt build -t mta_archivesBTP deployment
cf login
cf target -o <ORG> -s <SPACE>
cf deploy mta_archives/igrid-sce-mcp-tool_4.0.0.mtar -fSet iGrid secrets after deployment:
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-toolOr, when using the approved service login/MFA flow:
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 role assignment
Deployment creates/updates the XSUAA service instance igrid-sce-mcp-tool-xsuaa from xs-security.json.
After deployment, in the SAP BTP subaccount:
Open Security → Role Collections.
Confirm the predefined collections
iGrid-MCP-Read,iGrid-MCP-Write, andiGrid-MCP-Adminexist.Assign
iGrid-MCP-Readto read-only users.Assign
iGrid-MCP-Writeto write-only users.Assign
iGrid-MCP-Adminonly to users who need both GET and POST MCP tools.Re-authenticate the MCP client so its new token contains the assigned scopes.
If the user has only Read, POST tools fail at the MCP layer. If the user has only Write, GET tools fail. Admin can invoke all eight tools.
OAuth / Claude remote MCP
Use the deployed endpoint:
https://<BTP_ROUTE>/mcpThe OAuth discovery metadata now advertises the XSUAA read, write, and admin scopes. For user-specific role enforcement, use an OAuth flow that produces a user token, normally authorization code, so the user's BTP role collections are represented in the token.
A service key can still provide XSUAA OAuth client credentials, but a client_credentials token is a technical-client identity and should not be treated as if it inherited a human user's role collection.
Local stdio
Local stdio does not have a BTP user JWT, so role behavior is simulated with MCP_LOCAL_ROLE. Default is Admin to preserve the previous local behavior.
Read-only local test:
MCP_LOCAL_ROLE=Read npm run start:stdioWrite-only local test:
MCP_LOCAL_ROLE=Write npm run start:stdioFull local test:
MCP_LOCAL_ROLE=Admin npm run start:stdioClaude Desktop/Code example:
{
"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>"
}
}
}
}Role acceptance test
Use three users (or three user-role assignments) and obtain a fresh token after each assignment.
Read user
Expected success:
igrid_list_domains
igrid_get_template
igrid_metrics
igrid_export_csvExpected Forbidden::
igrid_run_agent
igrid_propose_action
igrid_decide_action
igrid_ingest_csvWrite user
Expected success:
igrid_run_agent
igrid_propose_action
igrid_decide_action
igrid_ingest_csvExpected Forbidden::
igrid_list_domains
igrid_get_template
igrid_metrics
igrid_export_csvAdmin user
All eight tools should pass the MCP role check. Downstream iGrid authentication/authorization and request validation still apply.
Security notes
The permission check happens before the iGrid API invocation.
XSUAA controls inbound MCP permissions; iGrid remains authoritative for downstream credentials and business authorization.
Never put the iGrid API key, iGrid password, Bearer token, XSUAA client secret, or service key in source control.
See
README-SECURITY.mdfor the concise security model.
Available Tools
8 toolsigrid_decide_actionDecide governed actionADestructive
WRITE role: approve or reject a previously proposed action. Requires explicit humanConfirmed=true; iGrid remains authoritative for downstream authorization.
Inputs: decision (required), humanConfirmed (required), note, request, +1 more.
igrid_export_csvExport governed CSVCRead-only
READ role: export an iGrid domain through GET /api/export/:domain using the documented x-api-key M2M endpoint.
Inputs: domain (required).
igrid_get_templateGet domain CSV templateARead-only
READ role: return the contract-accurate CSV template for an iGrid domain.
Inputs: domain (required).
igrid_ingest_csvIngest CSV into iGridCDestructive
WRITE role: send CSV to iGrid through POST /api/ingest/:domain using the documented x-api-key M2M endpoint.
Inputs: csv (required), domain (required).
igrid_list_domainsList iGrid domainsARead-only
READ role: discover current iGrid hub datasets with counts and freshness.
Inputs: no named parameters.
igrid_metricsGet iGrid AI metricsARead-only
READ role: return token/cost observability metrics for the iGrid AI assistant.
Inputs: no named parameters.
igrid_propose_actionPropose governed actionA
WRITE role: submit a governed action proposal through POST /api/ai/action/propose. It remains a dry-run proposal and does not approve the action.
Inputs: request (required).
igrid_run_agentRun iGrid AI agentCDestructive
WRITE role: run an existing iGrid AI agent through POST /api/ai/run.
Inputs: request (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct operation: listing domains, exporting/ingesting CSV, getting templates, running agents, proposing/deciding actions, and metrics. There is no overlap or ambiguity between them.
All tools follow the consistent pattern 'igrid_<verb>_<object>' (e.g., igrid_export_csv, igrid_propose_action). The name 'igrid_metrics' uses a noun instead of verb but still fits the pattern as a read operation. Overall, naming is highly predictable.
With 8 tools, the server is well-scoped for its purpose: managing iGrid data domains and AI agent actions. The number is neither too small nor too large, each tool serves a clear function.
The tool surface covers key workflows: domain discovery, CSV import/export, template retrieval, agent execution, action governance, and metrics. Minor gaps exist, such as no tool for listing past proposed actions or viewing action history, but core functionality is complete.
Related MCP Connectors
Supervised API-write gateway for AI agents with policy, human approval and execution receipts.
Credential broker for AI agents: scoped, revocable API access with policy enforcement and audit.
Security gateway for AI agents: policy, approval, and audited execution, no secrets shared.
Governed access to sensitive data, secrets and APIs for AI agents. A signed proof for each decision.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceProvides a trust and governance layer for AI agents, enabling secure API access, credential vaulting, paid execution with human approval, and automatic call resume.2-
- AlicenseAqualityCmaintenanceLocal zero-trust permission gateway for AI agents. Enforces policy-based tool authorization, human approvals, scoped permissions, and cryptographically verifiable audit logs.494 PyPI5Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to discover and execute tools via a secure MCP server with JWT authentication, RBAC, rate limiting, and audit logging.1MIT
- AlicenseNot gradedqualityDmaintenanceProvides a secure MCP gateway for AI agents to access APIs without exposing raw credentials, with scoped access, audit logging, and OAuth support.MIT