@androidosswal/mcp-sap-b1
v0.1.0
Published
MCP server exposing SAP B1 Service Layer schema (incl. UDFs) and one latest sample row, for AI-assisted custom-app development.
Maintainers
Readme
@androidosswal/mcp-sap-b1
An MCP (Model Context Protocol) server that gives AI coding assistants ground-truth knowledge of a SAP B1 Service Layer — schema (including custom UDFs) and a single latest sample row per entity — so generated code matches the customer's actual setup instead of hallucinating.
Read-only. Lean output. One process per project.
What it exposes
Exactly two tools:
list_endpoints
{ companyDB: string }
→ { count, endpoints: string[] }All entity-set names from the Service Layer $metadata, sorted.
describe_endpoint
{ companyDB: string, entity: string }
→ {
schema: { entitySet, keys, fields: [{ name, type, nullable?, isUDF?, maxLength? }] },
latestRow: <one record, latest by CreateDate desc> | null
}The schema is parsed from $metadata and trimmed (no SAP boilerplate). The sample row is fetched live with $top=1&$orderby=CreateDate desc (fallback to first key). Binary fields are replaced with "<binary stripped>".
Configuration
Env vars (set in your MCP client config):
| Var | Required | Notes |
|---|---|---|
| SAP_URL | ✅ | Full base URL incl. /b1s/v1, e.g. https://sap.acme.com:50000/b1s/v1 |
| SAP_USERNAME | ✅ | Service Layer login user |
| SAP_PASSWORD | ✅ | Service Layer password |
| SAP_CA_BUNDLE | ❌ | Path to a PEM CA bundle (for self-signed corporate CAs) |
| SAP_INSECURE_SSL | ❌ | true to disable TLS verification entirely. Off by default. |
TLS is strict by default. Both insecure modes log a warning at startup when active.
Install / Run
Via npx (recommended)
In your MCP client config (e.g. claude_desktop_config.json):
{
"mcpServers": {
"sap-b1-acme": {
"command": "npx",
"args": ["-y", "@androidosswal/mcp-sap-b1"],
"env": {
"SAP_URL": "https://sap.acme.com:50000/b1s/v1",
"SAP_USERNAME": "manager",
"SAP_PASSWORD": "yourPassword",
"SAP_INSECURE_SSL": "true"
}
}
}
}Local development
npm install
npm run dev # runs src/index.ts via tsxBuild
npm run build # emits dist/
npm start # runs dist/index.jsTypical AI workflow
- AI calls
list_endpoints({ companyDB: "SBODEMOUS" })once — caches the list mentally. - Per generated piece of code, AI calls
describe_endpoint({ companyDB, entity: "Orders" })to confirm the field set (especiallyU_*UDFs) and see one realistic row. - AI generates code that maps onto the real schema, not a generic SAP B1 template.
License
MIT
