guniweb-sap-mcp 0.1.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/README.md +125 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3034 -0
- package/dist/index.js.map +1 -0
- package/package.json +81 -0
package/README.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# SAP S/4HANA MCP Server for n8n
|
|
2
|
+
|
|
3
|
+
Connect n8n workflows to SAP S/4HANA via OData V2, V4, and IDocs using the Model Context Protocol (MCP).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **OData V2 + V4 CRUD** -- Read, query, create, update, and delete SAP entities
|
|
8
|
+
- **Deep Insert** -- Create parent and child entities in a single request (e.g., Sales Order with line items)
|
|
9
|
+
- **Function Imports (V2) and Actions/Functions (V4)** -- Trigger SAP business logic
|
|
10
|
+
- **Progressive Discovery** -- Discover services, inspect metadata, then execute operations
|
|
11
|
+
- **IDoc Send & Receive** -- Send IDocs to SAP via HTTP/XML, receive via webhook
|
|
12
|
+
- **Three Transport Modes** -- stdio (default), Streamable HTTP, and SSE for flexible deployment
|
|
13
|
+
- **API Key Authentication** -- Secure HTTP transport with Bearer token authentication
|
|
14
|
+
- **Docker Ready** -- Docker Compose example for n8n + SAP MCP sidecar deployment
|
|
15
|
+
- **MCP Prompts** -- Pre-built conversation starters for common SAP tasks
|
|
16
|
+
- **Selective Entity Set Exposure** -- Restrict visible entity sets with `--expose` glob patterns
|
|
17
|
+
- **Auto Version Detection** -- Automatically detects OData V2 or V4 from service metadata
|
|
18
|
+
- **Three Auth Modes** -- Basic Auth, OAuth 2.0 (BTP), API Key (Sandbox)
|
|
19
|
+
- **ETag Handling** -- Automatic optimistic concurrency control
|
|
20
|
+
- **Metadata Caching** -- Service metadata cached per session for performance
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
### 1. Install
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install -g guniweb-sap-mcp
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or run without installing:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx guniweb-sap-mcp
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 2. Configure
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
export SAP_BASE_URL=https://your-sap-system.example.com
|
|
40
|
+
export SAP_AUTH_TYPE=basic
|
|
41
|
+
export SAP_USERNAME=your-user
|
|
42
|
+
export SAP_PASSWORD=your-password
|
|
43
|
+
export SAP_CLIENT=100
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 3. Run
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# stdio (default) -- for n8n MCP Client in command mode
|
|
50
|
+
guniweb-sap-mcp
|
|
51
|
+
|
|
52
|
+
# HTTP -- for n8n MCP Client in URL mode or Docker
|
|
53
|
+
guniweb-sap-mcp --transport http --port 8808
|
|
54
|
+
|
|
55
|
+
# SSE -- for legacy MCP clients
|
|
56
|
+
guniweb-sap-mcp --transport sse --port 8808
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 4. Use with n8n
|
|
60
|
+
|
|
61
|
+
**Command mode (stdio):**
|
|
62
|
+
|
|
63
|
+
1. Add an **MCP Client** node to your n8n workflow
|
|
64
|
+
2. Set the command to: `guniweb-sap-mcp`
|
|
65
|
+
3. Configure SAP environment variables in the node settings
|
|
66
|
+
4. The AI agent can now use all SAP tools
|
|
67
|
+
|
|
68
|
+
**URL mode (HTTP / Docker):**
|
|
69
|
+
|
|
70
|
+
1. Start the server: `guniweb-sap-mcp --transport http --port 8808`
|
|
71
|
+
2. Add an **MCP Client** node to your n8n workflow
|
|
72
|
+
3. Set the URL to: `http://localhost:8808/mcp` (or `http://sap-mcp:8808/mcp` in Docker)
|
|
73
|
+
4. If using `--api-key`, configure a Bearer token header
|
|
74
|
+
|
|
75
|
+
## Transport Modes
|
|
76
|
+
|
|
77
|
+
| Mode | Command | Use Case |
|
|
78
|
+
|------|---------|----------|
|
|
79
|
+
| stdio | `guniweb-sap-mcp` | n8n MCP Client (command mode) |
|
|
80
|
+
| HTTP | `guniweb-sap-mcp --transport http` | n8n MCP Client (URL mode), Docker |
|
|
81
|
+
| SSE | `guniweb-sap-mcp --transport sse` | Legacy MCP clients |
|
|
82
|
+
|
|
83
|
+
HTTP transport is recommended for Docker deployments. See [Setup Guide](docs/setup-guide.md) for all CLI options.
|
|
84
|
+
|
|
85
|
+
## Available Tools
|
|
86
|
+
|
|
87
|
+
| Tool | Description |
|
|
88
|
+
|---------------------|--------------------------------------------------|
|
|
89
|
+
| `test-connection` | Test connectivity to the configured SAP system |
|
|
90
|
+
| `sap_list_services` | Discover available entity sets in an OData service |
|
|
91
|
+
| `sap_get_metadata` | Inspect entity types, properties, keys, and navigation properties |
|
|
92
|
+
| `sap_read` | Read a single entity or collection |
|
|
93
|
+
| `sap_query` | Query with filter, sort, pagination, expand |
|
|
94
|
+
| `sap_create` | Create entities (supports deep insert) |
|
|
95
|
+
| `sap_update` | Update entities (automatic ETag handling) |
|
|
96
|
+
| `sap_delete` | Delete entities (automatic ETag handling) |
|
|
97
|
+
| `sap_function` | Call V2 function imports or V4 actions/functions |
|
|
98
|
+
| `sap_idoc_send` | Send an IDoc to SAP via HTTP/XML |
|
|
99
|
+
| `sap_idoc_list` | List received IDocs from webhook |
|
|
100
|
+
| `sap_idoc_status` | Check IDoc processing status |
|
|
101
|
+
|
|
102
|
+
## Supported SAP Systems
|
|
103
|
+
|
|
104
|
+
- SAP S/4HANA Cloud
|
|
105
|
+
- SAP S/4HANA On-Premise
|
|
106
|
+
- SAP BTP Integration Suite
|
|
107
|
+
- SAP API Business Hub Sandbox
|
|
108
|
+
|
|
109
|
+
## Documentation
|
|
110
|
+
|
|
111
|
+
- [Setup Guide](docs/setup-guide.md) -- Installation, configuration, transport modes, Docker deployment
|
|
112
|
+
- [API Reference](docs/api-reference.md) -- All tools, resources, and prompts with parameters and examples
|
|
113
|
+
- [Examples](docs/examples.md) -- Common SAP workflow examples with step-by-step instructions
|
|
114
|
+
- [Docker Compose](docker-compose.yml) -- Ready-to-use n8n + SAP MCP deployment
|
|
115
|
+
|
|
116
|
+
## Technology
|
|
117
|
+
|
|
118
|
+
Built with:
|
|
119
|
+
- [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk) -- Model Context Protocol server runtime
|
|
120
|
+
- [SAP Cloud SDK](https://github.com/SAP/cloud-sdk-js) -- SAP OData integration, auth, and connectivity
|
|
121
|
+
- TypeScript, Node.js >= 22.18.0
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
ISC
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|