guniweb-sap-mcp 0.1.25 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +15 -0
- package/README.md +315 -78
- package/dist/index.js +154 -5549
- package/package.json +8 -3
- package/dist/index.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 guniweb
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,23 +1,73 @@
|
|
|
1
|
-
# SAP S/4HANA MCP Server
|
|
1
|
+
# GuniWeb SAP S/4HANA & ECC MCP Server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Designed for n8n, usable from any MCP host
|
|
4
|
+
|
|
5
|
+
Connect n8n workflows to SAP S/4HANA and ECC via OData V2, V4, IDocs, and RFC/BAPI using the Model Context Protocol (MCP).
|
|
6
|
+
|
|
7
|
+
```mermaid
|
|
8
|
+
graph LR
|
|
9
|
+
n8n["n8n AI Agent<br/>+ LLM"] -->|MCP Protocol| MCP["guniweb-sap-mcp<br/>22 Tools • 7 Auth Types"]
|
|
10
|
+
MCP -->|"OData V2/V4<br/>IDoc XML<br/>RFC/BAPI"| SAP["SAP S/4HANA & ECC"]
|
|
11
|
+
MCP -->|"OAuth2 / JWT"| BTP["SAP BTP"]
|
|
12
|
+
BTP --> SAP
|
|
13
|
+
|
|
14
|
+
style n8n fill:#4a90d9,color:#fff,stroke:#3a7bc8
|
|
15
|
+
style MCP fill:#2d2d2d,color:#fff,stroke:#555
|
|
16
|
+
style SAP fill:#1a6fb5,color:#fff,stroke:#0f5a9d
|
|
17
|
+
style BTP fill:#e8a317,color:#fff,stroke:#c88d14
|
|
18
|
+
```
|
|
4
19
|
|
|
5
20
|
## Features
|
|
6
21
|
|
|
7
|
-
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
|
|
22
|
+
### OData & IDoc
|
|
23
|
+
- **OData V2 + V4 CRUD** -- Read, query, create, update, delete with auto version detection
|
|
24
|
+
- **Deep Insert** -- Create parent + child entities in one request
|
|
25
|
+
- **Function Imports (V2) & Actions/Functions (V4)** -- Trigger SAP business logic
|
|
26
|
+
- **Batch Operations** -- Multiple operations in a single `$batch` request
|
|
27
|
+
- **NL-to-OData Query** -- Natural language queries converted to structured OData filters
|
|
28
|
+
- **IDoc Send & Receive** -- HTTP/XML based, no RFC dependency
|
|
29
|
+
|
|
30
|
+
### Discovery & Intelligence
|
|
31
|
+
- **Service Discovery** -- Auto-discover OData services with 16 business domain categories
|
|
32
|
+
- **Progressive Metadata** -- Service catalog -> entity sets -> properties -> query
|
|
33
|
+
- **Smart Query Routing** -- Domain-based routing resources for LLM tool selection
|
|
34
|
+
- **Decision-Tree Tool Descriptions** -- "When to use / When NOT to use" blocks guide LLMs
|
|
35
|
+
|
|
36
|
+
### Tool Visibility (v1.5)
|
|
37
|
+
- **3-Tier Tool Registry** -- Core / OData / IDoc tiers with on-demand activation
|
|
38
|
+
- **`sap_enable_tools`** -- LLMs activate additional tool tiers at runtime
|
|
39
|
+
- **`--read-only` Mode** -- Hide all write/destructive tools
|
|
40
|
+
- **IDoc Auto-Disable** -- IDoc tools hidden when no IDoc config present
|
|
41
|
+
- **MCP Annotations** -- readOnlyHint, destructiveHint, idempotentHint on all 17 tools
|
|
42
|
+
|
|
43
|
+
### Authentication (7 Types)
|
|
44
|
+
|
|
45
|
+
```mermaid
|
|
46
|
+
graph TB
|
|
47
|
+
subgraph Technical["Technical User Auth"]
|
|
48
|
+
basic["basic<br/><i>Direct S/4HANA</i>"]
|
|
49
|
+
oauth2["oauth2<br/><i>BTP Client Credentials</i>"]
|
|
50
|
+
apikey["apikey<br/><i>Sandbox / Testing</i>"]
|
|
51
|
+
end
|
|
52
|
+
subgraph Enterprise["Enterprise Auth (OIDC)"]
|
|
53
|
+
ias["ias<br/><i>SAP IAS Token</i>"]
|
|
54
|
+
xsuaa["xsuaa<br/><i>SAP XSUAA Token</i>"]
|
|
55
|
+
end
|
|
56
|
+
subgraph Principal["Principal Propagation<br/><i>End-user identity forwarded to SAP</i>"]
|
|
57
|
+
btp["btp-principal<br/><i>JWT Bearer Exchange<br/>via Destination Service</i>"]
|
|
58
|
+
saml["saml-bearer<br/><i>SAML 2.0 Assertion<br/>+ RSA-SHA256 Signing</i>"]
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
style Technical fill:#2a5f8f,color:#fff,stroke:#1a4f7f
|
|
62
|
+
style Enterprise fill:#5b8c5a,color:#fff,stroke:#4b7c4a
|
|
63
|
+
style Principal fill:#8b5e3c,color:#fff,stroke:#7b4e2c
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Infrastructure
|
|
67
|
+
- **Three Transport Modes** -- stdio, Streamable HTTP, SSE
|
|
68
|
+
- **API Key Protection** -- Secure HTTP transport with Bearer token
|
|
69
|
+
- **Docker Ready** -- Docker Compose for n8n + SAP MCP sidecar
|
|
70
|
+
- **918 Tests** -- Unit, integration, E2E with CI/CD via GitHub Actions
|
|
21
71
|
|
|
22
72
|
## Quick Start
|
|
23
73
|
|
|
@@ -27,12 +77,6 @@ Connect n8n workflows to SAP S/4HANA via OData V2, V4, and IDocs using the Model
|
|
|
27
77
|
npm install -g guniweb-sap-mcp
|
|
28
78
|
```
|
|
29
79
|
|
|
30
|
-
Or run without installing:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
npx guniweb-sap-mcp
|
|
34
|
-
```
|
|
35
|
-
|
|
36
80
|
### 2. Configure
|
|
37
81
|
|
|
38
82
|
```bash
|
|
@@ -52,79 +96,272 @@ guniweb-sap-mcp
|
|
|
52
96
|
# HTTP -- for n8n MCP Client in URL mode or Docker
|
|
53
97
|
guniweb-sap-mcp --transport http --port 8808
|
|
54
98
|
|
|
55
|
-
#
|
|
56
|
-
guniweb-sap-mcp --transport
|
|
99
|
+
# With tool tier control
|
|
100
|
+
guniweb-sap-mcp --transport http --port 8808 --tiers core,odata
|
|
101
|
+
guniweb-sap-mcp --transport http --port 8808 --read-only
|
|
57
102
|
```
|
|
58
103
|
|
|
59
104
|
### 4. Use with n8n
|
|
60
105
|
|
|
61
|
-
**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
106
|
+
1. Add an **AI Agent** node with an **MCP Client Tool** sub-node
|
|
107
|
+
2. Set the MCP Client URL to `http://sap-mcp:8808/mcp` (Docker) or `http://localhost:8808/mcp`
|
|
108
|
+
3. The AI agent discovers SAP tools automatically and can query, create, update SAP data
|
|
109
|
+
|
|
110
|
+
## Setup for SAP ECC
|
|
111
|
+
|
|
112
|
+
ECC NetWeaver backends require additional setup beyond the [Quick Start](#quick-start). The MCP server supports ECC 6.0+ (EHP 7+) for OData V2, OData V4, IDoc HTTP/XML, and RFC/BAPI. Cloud-only S/4HANA tenants do not need this section.
|
|
113
|
+
|
|
114
|
+
### 1. Activate NetWeaver Gateway
|
|
115
|
+
|
|
116
|
+
In transaction `SICF`, activate the standard ICF services under `/sap/opu/odata/`. Then use transaction `/IWFND/MAINT_SERVICE` to register the OData services you want to expose.
|
|
117
|
+
|
|
118
|
+
The MCP server's catalog auto-discovery (Phase 23) probes three paths in sequence and caches the first 200 hit:
|
|
119
|
+
|
|
120
|
+
- `/sap/opu/odata/IWFND/CATALOGSERVICE;v=2/ServiceCollection` (S/4HANA default)
|
|
121
|
+
- `/sap/opu/odata/iwfnd/CATALOGSERVICE;v=2/ServiceCollection` (lower-case ECC)
|
|
122
|
+
- `/sap/opu/odata/IWFND/CATALOGSERVICE/ServiceCollection` (ECC EHP 7 v=1)
|
|
123
|
+
|
|
124
|
+
Override via `ODATA_V2_CATALOG_PATH` if your gateway uses a non-standard mount.
|
|
125
|
+
|
|
126
|
+
### 2. Install SAP NW RFC SDK (RFC/BAPI tools only)
|
|
127
|
+
|
|
128
|
+
Required for the `rfc` tool tier. Skip this step if you only use OData or IDoc.
|
|
129
|
+
|
|
130
|
+
**Linux:**
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
tar xzf nwrfcsdk_linux.tgz -C /usr/sap/
|
|
134
|
+
export LD_LIBRARY_PATH=/usr/sap/nwrfcsdk/lib:$LD_LIBRARY_PATH
|
|
135
|
+
npm install node-rfc
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**macOS:**
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
tar xzf nwrfcsdk_darwin.tgz -C /usr/sap/
|
|
142
|
+
export DYLD_LIBRARY_PATH=/usr/sap/nwrfcsdk/lib:$DYLD_LIBRARY_PATH
|
|
143
|
+
npm install node-rfc
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
`node-rfc` is declared as `optionalDependencies` -- if the SDK is missing, the server logs a Pino warning at startup and the RFC tier is skipped. OData and IDoc tools continue to work.
|
|
147
|
+
|
|
148
|
+
### 3. ECC-Specific Environment Variables
|
|
149
|
+
|
|
150
|
+
In addition to the variables documented in [Quick Start](#quick-start):
|
|
151
|
+
|
|
152
|
+
| Variable | Required | Description |
|
|
153
|
+
|---------------------------|------------------------|--------------------------------------------------------------------------------------------|
|
|
154
|
+
| `ODATA_V2_CATALOG_PATH` | No (auto-discover) | Override catalog path, e.g. `/sap/opu/odata/iwfnd/CATALOGSERVICE;v=2/ServiceCollection` |
|
|
155
|
+
| `SAP_TLS_VERIFY` | No (default `true`) | Set to `false` to disable TLS certificate verification for self-signed-cert ECC scenarios |
|
|
156
|
+
| `SAP_CLIENT_CERT_PATH` | For X.509 client-cert | Path to PEM-encoded client certificate, e.g. `/etc/sap/client.crt` |
|
|
157
|
+
| `SAP_CLIENT_KEY_PATH` | For X.509 client-cert | Path to PEM-encoded private key (optional passphrase via prompt) |
|
|
158
|
+
| `SAP_SNC_QOP` | For SNC (RFC) | SNC Quality-of-Protection level: `1` (auth-only), `2` (integrity), `3`/`8`/`9` (encryption) |
|
|
159
|
+
| `SAP_SNC_MYNAME` | For SNC (RFC) | Local SNC name, e.g. `p:CN=mcp-server, O=GuniWeb` |
|
|
160
|
+
| `SAP_SNC_PARTNERNAME` | For SNC (RFC) | Backend SNC name, e.g. `p:CN=SAPSERVER, O=ACME` |
|
|
161
|
+
| `SAP_SNC_LIB` | For SNC (RFC) | Path to SNC library (`.so` / `.dylib` / `.dll`), e.g. `/usr/sap/sapcrypto/libsapcrypto.so` |
|
|
162
|
+
|
|
163
|
+
## Available Tools (22)
|
|
164
|
+
|
|
165
|
+
### Core Tier (always active)
|
|
166
|
+
| Tool | Description |
|
|
167
|
+
|------|-------------|
|
|
168
|
+
| `test-connection` | Test connectivity to SAP (pings catalog service) |
|
|
169
|
+
| `sap_list_services` | List entity sets in an OData service |
|
|
170
|
+
| `sap_discover_services` | Discover all services with category filtering and search |
|
|
171
|
+
| `sap_get_metadata` | Inspect entity types, properties, keys (with search filter) |
|
|
172
|
+
|
|
173
|
+
### OData Tier (active by default)
|
|
174
|
+
| Tool | Description |
|
|
175
|
+
|------|-------------|
|
|
176
|
+
| `sap_read` | Read a single entity or collection |
|
|
177
|
+
| `sap_query` | Query with OData $filter, $select, $expand, pagination |
|
|
178
|
+
| `sap_nl_query` | Natural language query with structured filters |
|
|
179
|
+
| `sap_create` | Create entities (supports deep insert + draft services) |
|
|
180
|
+
| `sap_update` | Update entities (automatic ETag handling) |
|
|
181
|
+
| `sap_delete` | Delete entities (automatic ETag handling) |
|
|
182
|
+
| `sap_function` | Call V2 function imports or V4 actions/functions |
|
|
183
|
+
| `sap_batch` | Execute multiple operations in a single batch |
|
|
184
|
+
|
|
185
|
+
### IDoc Tier (on-demand via `sap_enable_tools`)
|
|
186
|
+
| Tool | Description |
|
|
187
|
+
|------|-------------|
|
|
188
|
+
| `sap_idoc_send` | Send IDoc to SAP via HTTP/XML |
|
|
189
|
+
| `sap_idoc_list_received` | List received IDocs from webhook |
|
|
190
|
+
| `sap_idoc_status` | Check IDoc processing status |
|
|
191
|
+
| `sap_idoc_discover` | Discover available IDoc types |
|
|
192
|
+
|
|
193
|
+
### RFC Tier (on-demand via `sap_enable_tools`, requires SAP NW RFC SDK)
|
|
194
|
+
| Tool | Description |
|
|
195
|
+
|------|-------------|
|
|
196
|
+
| `sap_rfc_call` | Call any RFC-enabled function module with zod-validated parameters |
|
|
197
|
+
| `sap_rfc_metadata` | Fetch function-module signature (imports/exports/tables/exceptions) |
|
|
198
|
+
| `sap_bapi_call` | Invoke a BAPI, parse BAPIRET2 return tables, pin connection for follow-up commit |
|
|
199
|
+
| `sap_bapi_commit` | Invoke `BAPI_TRANSACTION_COMMIT` on the pinned session |
|
|
200
|
+
| `sap_rfc_search_functions` | Find function modules by name pattern via `RFC_FUNCTION_SEARCH` |
|
|
201
|
+
|
|
202
|
+
### Meta Tool
|
|
203
|
+
| Tool | Description |
|
|
204
|
+
|------|-------------|
|
|
205
|
+
| `sap_enable_tools` | Activate/deactivate tool tiers at runtime |
|
|
206
|
+
|
|
207
|
+
## Architecture
|
|
208
|
+
|
|
209
|
+
```mermaid
|
|
210
|
+
graph TB
|
|
211
|
+
subgraph n8n["n8n"]
|
|
212
|
+
Agent["AI Agent + LLM"]
|
|
213
|
+
MCPClient["MCP Client Tool"]
|
|
214
|
+
Agent --> MCPClient
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
subgraph Server["guniweb-sap-mcp"]
|
|
218
|
+
Transport["Transport<br/>stdio | HTTP | SSE"]
|
|
219
|
+
UserCtx["UserContext<br/>Extraction"]
|
|
220
|
+
Registry["ToolRegistryManager<br/>Core | OData | IDoc"]
|
|
221
|
+
Tools["17 MCP Tools<br/>3 Resources • 3 Prompts"]
|
|
222
|
+
OData["ODataClient<br/>V2/V4 Auto-Detect"]
|
|
223
|
+
Discovery["Service Discovery<br/>16 Domain Categories"]
|
|
224
|
+
NLQuery["NL-to-OData<br/>Filter Builder"]
|
|
225
|
+
HTTP["SapHttpClient<br/>CSRF • Redirect • Auth"]
|
|
226
|
+
Auth["Auth Layer<br/>7 Auth Types"]
|
|
227
|
+
Cache["Per-User Token Cache<br/>LRU • SHA-256"]
|
|
228
|
+
|
|
229
|
+
Transport --> UserCtx
|
|
230
|
+
Transport --> Registry
|
|
231
|
+
Registry --> Tools
|
|
232
|
+
Tools --> OData
|
|
233
|
+
Tools --> Discovery
|
|
234
|
+
Tools --> NLQuery
|
|
235
|
+
OData --> HTTP
|
|
236
|
+
Discovery --> HTTP
|
|
237
|
+
NLQuery --> OData
|
|
238
|
+
HTTP --> Auth
|
|
239
|
+
Auth --> Cache
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
subgraph SAP["SAP Backend"]
|
|
243
|
+
S4["S/4HANA<br/>OData V2/V4"]
|
|
244
|
+
IDoc["IDoc<br/>HTTP/XML"]
|
|
245
|
+
BTPSuite["BTP Integration<br/>Suite"]
|
|
246
|
+
DestSvc["Destination<br/>Service"]
|
|
247
|
+
TokenSvc["XSUAA / IAS<br/>Token Service"]
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
MCPClient -->|MCP Protocol| Transport
|
|
251
|
+
HTTP -->|Direct| S4
|
|
252
|
+
HTTP -->|Via BTP| BTPSuite
|
|
253
|
+
BTPSuite --> S4
|
|
254
|
+
HTTP --> IDoc
|
|
255
|
+
Auth -->|Token Exchange| DestSvc
|
|
256
|
+
Auth -->|OIDC / OAuth2| TokenSvc
|
|
257
|
+
DestSvc --> S4
|
|
258
|
+
|
|
259
|
+
style n8n fill:#e8f4fd,stroke:#4a90d9
|
|
260
|
+
style Server fill:#f5f5f5,stroke:#555
|
|
261
|
+
style SAP fill:#e8f0fe,stroke:#1a6fb5
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Integration Paths
|
|
265
|
+
|
|
266
|
+
```mermaid
|
|
267
|
+
graph LR
|
|
268
|
+
subgraph Path1["Path 1: Direct"]
|
|
269
|
+
n1["n8n"] -->|MCP| s1["MCP Server"] -->|Basic Auth| sap1["SAP S/4HANA"]
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
subgraph Path2["Path 2: BTP Client Credentials"]
|
|
273
|
+
n2["n8n"] -->|MCP| s2["MCP Server"] -->|OAuth2| btp2["BTP Suite"] --> sap2["SAP S/4HANA"]
|
|
274
|
+
s2 -->|CC Flow| tok2["XSUAA"]
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
subgraph Path3["Path 3: BTP Principal Propagation"]
|
|
278
|
+
n3["n8n + JWT"] -->|MCP| s3["MCP Server"] -->|JWT Exchange| dest3["Destination Svc"] --> sap3["SAP S/4HANA"]
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
subgraph Path4["Path 4: SAML Bearer (no BTP)"]
|
|
282
|
+
n4["n8n + JWT"] -->|MCP| s4["MCP Server"] -->|"SAML Assertion<br/>RSA-SHA256"| sap4["SAP OAuth2<br/>Endpoint"]
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
style Path1 fill:#e8f4fd,stroke:#4a90d9
|
|
286
|
+
style Path2 fill:#fef9e7,stroke:#e8a317
|
|
287
|
+
style Path3 fill:#eafaf1,stroke:#5b8c5a
|
|
288
|
+
style Path4 fill:#fdf2e9,stroke:#8b5e3c
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Request Flow (OData Write)
|
|
292
|
+
|
|
293
|
+
```mermaid
|
|
294
|
+
sequenceDiagram
|
|
295
|
+
participant LLM as LLM (via n8n)
|
|
296
|
+
participant Tool as MCP Tool
|
|
297
|
+
participant Registry as ToolRegistry
|
|
298
|
+
participant OData as ODataClient
|
|
299
|
+
participant HTTP as SapHttpClient
|
|
300
|
+
participant SAP as SAP Gateway
|
|
301
|
+
|
|
302
|
+
LLM->>Tool: sap_create(serviceUrl, entitySet, data)
|
|
303
|
+
Tool->>Registry: isToolVisible?
|
|
304
|
+
Registry-->>Tool: yes
|
|
305
|
+
Tool->>OData: create(entitySet, data)
|
|
306
|
+
OData->>HTTP: request(POST, url, data)
|
|
307
|
+
|
|
308
|
+
Note over HTTP,SAP: CSRF Token Fetch
|
|
309
|
+
HTTP->>SAP: GET /sap/opu/odata/sap/SRV/<br/>x-csrf-token: fetch<br/>sap-client: 324
|
|
310
|
+
SAP-->>HTTP: x-csrf-token: TOKEN<br/>set-cookie: SESSION
|
|
311
|
+
|
|
312
|
+
Note over HTTP,SAP: Mutating Request
|
|
313
|
+
HTTP->>SAP: POST /sap/opu/odata/sap/SRV/EntitySet<br/>x-csrf-token: TOKEN<br/>Cookie: SESSION
|
|
314
|
+
SAP-->>HTTP: 201 Created + entity data
|
|
315
|
+
|
|
316
|
+
HTTP-->>OData: response
|
|
317
|
+
OData-->>Tool: created entity
|
|
318
|
+
Tool-->>LLM: JSON result via MCP
|
|
319
|
+
```
|
|
103
320
|
|
|
104
321
|
## Supported SAP Systems
|
|
105
322
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
-
|
|
323
|
+
The MCP server supports the following SAP backends. Connector availability depends on the target system; see footnotes for prerequisites.
|
|
324
|
+
|
|
325
|
+
| Connector | ECC 6.0+ (EHP 7+) | S/4HANA on-prem | S/4HANA Cloud (Public) |
|
|
326
|
+
|-----------------------|---------------------------|------------------------|------------------------|
|
|
327
|
+
| **OData V2** | ✅ supported [^1] | ✅ supported | ✅ supported |
|
|
328
|
+
| **OData V4** | ⚠️ partial [^4] | ✅ supported | ✅ supported |
|
|
329
|
+
| **IDoc** (HTTP/XML) | ✅ supported [^1] | ✅ supported | ❌ N/A [^3] |
|
|
330
|
+
| **RFC/BAPI** | ✅ supported [^1][^2][^5] | ✅ supported [^2][^5] | ❌ N/A [^3] |
|
|
331
|
+
|
|
332
|
+
Additionally validated against:
|
|
333
|
+
|
|
334
|
+
- SAP BTP Integration Suite (as intermediary for S/4HANA Cloud RFC/IDoc paths)
|
|
109
335
|
- SAP API Business Hub Sandbox
|
|
110
336
|
|
|
337
|
+
[^1]: NetWeaver Gateway ICF services must be activated (transaction `SICF`). See [Setup for SAP ECC](#setup-for-sap-ecc).
|
|
338
|
+
[^2]: Requires SAP NW RFC SDK 7.50+ on the host. `node-rfc` is declared as `optionalDependencies`; missing SDK degrades gracefully with a startup warning.
|
|
339
|
+
[^3]: S/4HANA Cloud Public Edition does not expose RFC or classic IDoc-HTTP for external consumers. Use SAP BTP Integration Suite as an intermediary.
|
|
340
|
+
[^4]: OData V4 in ECC is rare; most ECC NetWeaver Gateway services are V2. V4 is the default for S/4HANA.
|
|
341
|
+
[^5]: SNC library (`SAP_SNC_LIB`) is OS-specific (`.so` / `.dylib` / `.dll`) and must be installed separately.
|
|
342
|
+
|
|
111
343
|
## Documentation
|
|
112
344
|
|
|
113
|
-
- [Setup Guide](docs/setup-guide.md) -- Installation,
|
|
345
|
+
- [Setup Guide](docs/setup-guide.md) -- Installation, all 7 auth types, CLI flags, Docker deployment
|
|
114
346
|
- [Architecture](docs/architecture.md) -- Technical architecture, request flows, design decisions
|
|
115
|
-
- [API Reference](docs/api-reference.md) -- All tools, resources, and prompts with parameters
|
|
116
|
-
- [Examples](docs/examples.md) --
|
|
117
|
-
- [Docker Compose](docker-compose.yml) -- Ready-to-use n8n + SAP MCP deployment
|
|
347
|
+
- [API Reference](docs/api-reference.md) -- All 17 tools, resources, and prompts with parameters
|
|
348
|
+
- [Examples](docs/examples.md) -- SAP workflow examples with step-by-step instructions
|
|
118
349
|
|
|
119
350
|
## Technology
|
|
120
351
|
|
|
121
352
|
Built with:
|
|
122
|
-
- [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk)
|
|
123
|
-
- [axios](https://github.com/axios/axios) -- HTTP client with CSRF
|
|
124
|
-
- [
|
|
125
|
-
- [
|
|
353
|
+
- [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk) v1.x
|
|
354
|
+
- [axios](https://github.com/axios/axios) -- HTTP client with CSRF + redirect handling
|
|
355
|
+
- [jose](https://github.com/panva/jose) -- JWT/JWKS validation for IAS/XSUAA auth
|
|
356
|
+
- [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) -- IDoc XML + SAML assertion building
|
|
357
|
+
- [Zod](https://zod.dev/) v4 -- Schema validation
|
|
126
358
|
- [pino](https://github.com/pinojs/pino) -- Structured JSON logging
|
|
127
|
-
-
|
|
359
|
+
- [tsup](https://github.com/egoist/tsup) -- ESM bundling
|
|
360
|
+
- TypeScript 5.9, Node.js >= 22.18.0
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
SAP, S/4HANA, ECC, NetWeaver, ABAP are trademarks or registered trademarks of SAP SE in Germany and other countries. This project is not affiliated with SAP SE.
|
|
128
365
|
|
|
129
366
|
## License
|
|
130
367
|
|