@mcp-abap-adt/proxy 0.1.5 → 0.1.8
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/CHANGELOG.md +66 -1
- package/README.md +73 -65
- package/bin/mcp-abap-adt-proxy.js +15 -42
- package/dist/index.d.ts +3 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +414 -277
- package/dist/lib/config.d.ts +13 -4
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +110 -93
- package/dist/lib/errorHandler.d.ts +3 -3
- package/dist/lib/errorHandler.d.ts.map +1 -1
- package/dist/lib/errorHandler.js +31 -28
- package/dist/lib/logger.d.ts.map +1 -1
- package/dist/lib/logger.js +12 -9
- package/dist/lib/stores.d.ts +7 -7
- package/dist/lib/stores.d.ts.map +1 -1
- package/dist/lib/stores.js +46 -80
- package/dist/lib/transportConfig.d.ts +1 -1
- package/dist/lib/transportConfig.d.ts.map +1 -1
- package/dist/lib/transportConfig.js +58 -38
- package/dist/proxy/btpProxy.d.ts +102 -0
- package/dist/proxy/btpProxy.d.ts.map +1 -0
- package/dist/proxy/btpProxy.js +833 -0
- package/dist/proxy/cloudLlmHubProxy.d.ts +1 -65
- package/dist/proxy/cloudLlmHubProxy.d.ts.map +1 -1
- package/dist/proxy/cloudLlmHubProxy.js +1 -441
- package/dist/router/headerAnalyzer.d.ts +9 -18
- package/dist/router/headerAnalyzer.d.ts.map +1 -1
- package/dist/router/headerAnalyzer.js +35 -63
- package/dist/router/requestInterceptor.d.ts +5 -11
- package/dist/router/requestInterceptor.d.ts.map +1 -1
- package/dist/router/requestInterceptor.js +33 -30
- package/package.json +33 -15
- package/dist/router/directCloudRouter.d.ts +0 -32
- package/dist/router/directCloudRouter.d.ts.map +0 -1
- package/dist/router/directCloudRouter.js +0 -146
- package/dist/router/localBasicRouter.d.ts +0 -23
- package/dist/router/localBasicRouter.d.ts.map +0 -1
- package/dist/router/localBasicRouter.js +0 -118
package/CHANGELOG.md
CHANGED
|
@@ -7,11 +7,76 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.8] - 2026-02-05
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **Browser-based Authentication (Authorization Code)**
|
|
14
|
+
- Enforced `AuthorizationCodeProvider` as the sole authentication method for BTP destinations.
|
|
15
|
+
- Added CLI options `--browser`, `--browser-auth-port` (default: 3333).
|
|
16
|
+
- **Eager Authentication**
|
|
17
|
+
- Proxy now initiates authentication (opens browser) immediately on startup if `--btp` is provided.
|
|
18
|
+
- **Service URL Injection**
|
|
19
|
+
- Added support for `--url` parameter to inject MCP server URL when missing from service key.
|
|
20
|
+
- Added placeholders for missing auth config to allow manual URL injection.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
- **Port Conflict**: Changed default browser callback port to 3333 (was 3001) to avoid conflict with proxy server.
|
|
24
|
+
- **Service Key Loading**: Fixed issue where `AuthorizationCodeProvider` was initialized with empty config, causing validation errors.
|
|
25
|
+
- **JSON-RPC ID Handling**: Fixed schema validation issue where backend returning `id: null` caused client errors (proxy now restores original ID).
|
|
26
|
+
|
|
27
|
+
## [0.1.7] - 2025-12-31
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- **@mcp-abap-adt/auth-broker**: bumped to `^0.3.0` - auto-detect service key format, credentials wrapper support, debug logging
|
|
31
|
+
- **@mcp-abap-adt/auth-stores**: bumped to `^0.3.0`
|
|
32
|
+
|
|
33
|
+
## [0.1.6] - 2025-12-07
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
- **Separate AuthBroker instances for BTP and ABAP destinations**
|
|
37
|
+
- `btpAuthBroker` with `XsuaaTokenProvider` for BTP destinations (`--btp` or `x-btp-destination`)
|
|
38
|
+
- `abapAuthBroker` with `BtpTokenProvider` for ABAP destinations (`--mcp` or `x-mcp-destination`)
|
|
39
|
+
- Proper separation ensures correct token provider is used for each destination type
|
|
40
|
+
- **Client Setup Guide** (`docs/CLIENT_SETUP.md`)
|
|
41
|
+
- Step-by-step setup instructions for Cline and GitHub Copilot
|
|
42
|
+
- Configuration examples for different scenarios (local MCP, BTP MCP, BTP + ABAP)
|
|
43
|
+
- Troubleshooting section with common issues and solutions
|
|
44
|
+
- Quick reference for command-line options and service key locations
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
- **Improved service key store selection**
|
|
48
|
+
- `CombinedServiceKeyStore` now prefers XSUAA store for BTP destinations (`preferXsuaa=true`)
|
|
49
|
+
- Prevents errors when BTP service keys (XSUAA format) are parsed by ABAP store
|
|
50
|
+
- For BTP destinations, only tries XSUAA store (doesn't fallback to ABAP store)
|
|
51
|
+
- **Error messages updated**
|
|
52
|
+
- Error messages no longer mention `.env` files (proxy only uses service keys)
|
|
53
|
+
- Service key errors now show correct paths and file requirements
|
|
54
|
+
- **Platform path resolution**
|
|
55
|
+
- Updated `getPlatformPaths` to match logic from `mcp-abap-adt`
|
|
56
|
+
- Correctly determines service key and session paths for Unix and Windows
|
|
57
|
+
- Unix: `~/.config/mcp-abap-adt/service-keys` and `~/.config/mcp-abap-adt/sessions`
|
|
58
|
+
- Windows: `%USERPROFILE%\Documents\mcp-abap-adt\service-keys` and `%USERPROFILE%\Documents\mcp-abap-adt\sessions`
|
|
59
|
+
|
|
60
|
+
### Fixed
|
|
61
|
+
- **BTP destination authentication**
|
|
62
|
+
- Fixed issue where BTP destinations were incorrectly using ABAP token provider
|
|
63
|
+
- BTP destinations now correctly use `XsuaaTokenProvider` (client_credentials grant type)
|
|
64
|
+
- ABAP destinations use `BtpTokenProvider` (browser OAuth2 or refresh token flow)
|
|
65
|
+
- **Service key lookup for BTP destinations**
|
|
66
|
+
- Fixed "Service key missing 'uaa' object" error for BTP destinations
|
|
67
|
+
- BTP service keys (XSUAA format) are now correctly parsed by `XsuaaServiceKeyStore`
|
|
68
|
+
- Prevents ABAP store from attempting to parse XSUAA format service keys
|
|
69
|
+
|
|
70
|
+
### Documentation
|
|
71
|
+
- Added comprehensive client setup guide with examples for Cline and GitHub Copilot
|
|
72
|
+
- Updated README to reflect dual AuthBroker architecture
|
|
73
|
+
- Clarified authentication flow: XSUAA block (BTP) → ABAP block (SAP) → MCP server
|
|
74
|
+
|
|
10
75
|
## [0.1.4] - 2025-12-02
|
|
11
76
|
|
|
12
77
|
### Added
|
|
13
78
|
- **Documentation for BTP-Only authentication mode**
|
|
14
|
-
- Added "Scenario 2: BTP Authentication Only (No SAP Configuration)" in `
|
|
79
|
+
- Added "Scenario 2: BTP Authentication Only (No SAP Configuration)" in `docs/USAGE.md`
|
|
15
80
|
- Documented use case for connecting to any BTP service without SAP ABAP configuration
|
|
16
81
|
- Explained that `x-mcp-destination` is optional when using `x-btp-destination` or `--btp`
|
|
17
82
|
- Updated README.md with "BTP-Only Mode" section explaining behavior when only `--btp` is provided
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @mcp-abap-adt/proxy
|
|
2
2
|
|
|
3
|
-
MCP proxy server for SAP ABAP ADT - proxies local requests to
|
|
3
|
+
MCP proxy server for SAP ABAP ADT - proxies local requests to MCP servers with JWT authentication.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ This package acts as a simple proxy between local MCP clients (like Cline) and a
|
|
|
8
8
|
|
|
9
9
|
## Purpose
|
|
10
10
|
|
|
11
|
-
Enable local MCP clients to connect to remote MCP servers
|
|
11
|
+
Enable local MCP clients to connect to remote MCP servers with automatic JWT token management via `@mcp-abap-adt/auth-broker`. The proxy adds authentication headers and forwards requests transparently.
|
|
12
12
|
|
|
13
13
|
## Features
|
|
14
14
|
|
|
@@ -32,19 +32,40 @@ npm install -g @mcp-abap-adt/proxy
|
|
|
32
32
|
# Start proxy server (in-memory session storage, secure)
|
|
33
33
|
mcp-abap-adt-proxy
|
|
34
34
|
|
|
35
|
-
# With
|
|
36
|
-
mcp-abap-adt-proxy --btp=ai
|
|
35
|
+
# With BTP destination
|
|
36
|
+
mcp-abap-adt-proxy --btp=ai
|
|
37
37
|
|
|
38
38
|
# Enable file-based session storage (persists tokens to disk)
|
|
39
|
-
mcp-abap-adt-proxy --unsafe
|
|
39
|
+
mcp-abap-adt-proxy --btp=ai --unsafe
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Configuration
|
|
43
|
+
|
|
44
|
+
The proxy supports multiple configuration methods:
|
|
45
|
+
|
|
46
|
+
- **Command-line parameters** (highest priority)
|
|
47
|
+
- **YAML/JSON configuration files** - See [YAML Configuration Guide](./docs/YAML_CONFIG.md)
|
|
48
|
+
- **Environment variables**
|
|
49
|
+
- **Default values** (lowest priority)
|
|
50
|
+
|
|
51
|
+
**Quick Example (YAML config)**:
|
|
52
|
+
```bash
|
|
53
|
+
# Copy example config from documentation
|
|
54
|
+
cp docs/mcp-proxy-config.example.yaml mcp-proxy-config.yaml
|
|
40
55
|
|
|
41
|
-
#
|
|
42
|
-
|
|
56
|
+
# Edit mcp-proxy-config.yaml with your settings
|
|
57
|
+
|
|
58
|
+
# Run with config file
|
|
59
|
+
mcp-abap-adt-proxy --config=mcp-proxy-config.yaml
|
|
60
|
+
# Or short form:
|
|
61
|
+
mcp-abap-adt-proxy -c mcp-proxy-config.yaml
|
|
43
62
|
```
|
|
44
63
|
|
|
45
|
-
### Client Configuration
|
|
64
|
+
### Client Configuration
|
|
65
|
+
|
|
66
|
+
For detailed setup instructions for Cline and GitHub Copilot, see the **[Client Setup Guide](./docs/CLIENT_SETUP.md)**.
|
|
46
67
|
|
|
47
|
-
|
|
68
|
+
**Quick Example (Cline)**:
|
|
48
69
|
|
|
49
70
|
```json
|
|
50
71
|
{
|
|
@@ -55,90 +76,84 @@ The proxy uses two service keys (URLs are obtained from service keys):
|
|
|
55
76
|
"type": "streamableHttp",
|
|
56
77
|
"url": "http://localhost:3001/mcp/stream/http",
|
|
57
78
|
"headers": {
|
|
58
|
-
"x-btp-destination": "btp-cloud"
|
|
59
|
-
"x-mcp-destination": "sap-abap"
|
|
79
|
+
"x-btp-destination": "btp-cloud"
|
|
60
80
|
}
|
|
61
81
|
}
|
|
62
82
|
}
|
|
63
83
|
}
|
|
64
84
|
```
|
|
65
85
|
|
|
66
|
-
**Required Headers
|
|
67
|
-
- `x-btp-destination` - Destination name for BTP Cloud authorization token and MCP server URL
|
|
68
|
-
- `x-mcp-destination` - Destination name for SAP ABAP connection (for local testing mode without BTP)
|
|
69
|
-
- `x-mcp-url` - Direct MCP server URL (for local testing mode without authentication)
|
|
70
|
-
|
|
71
|
-
**Optional Headers:**
|
|
72
|
-
- `x-mcp-destination` - Destination name for SAP ABAP connection (optional, provides SAP token and configuration when used with BTP)
|
|
86
|
+
**Required Headers:**
|
|
87
|
+
- `x-btp-destination` - Destination name for BTP Cloud authorization token and MCP server URL
|
|
73
88
|
|
|
74
89
|
**Command Line Overrides:**
|
|
75
|
-
- `--btp=<destination>` - Overrides `x-btp-destination` header (
|
|
76
|
-
- `--
|
|
77
|
-
- `--
|
|
90
|
+
- `--btp=<destination>` - Overrides `x-btp-destination` header (takes precedence)
|
|
91
|
+
- `--url=<url>` - Overrides MCP server URL (required if service key lacks URL)
|
|
92
|
+
- `--browser=<browser>` - Browser to use: `system` (default), `chrome`, `edge`, `firefox`, `headless`
|
|
93
|
+
- `--browser-auth-port=<port>` - Port for OAuth2 callback (default: 3333)
|
|
78
94
|
- `--unsafe` - Enables file-based session storage (persists tokens to disk). By default, sessions are stored in-memory (secure, lost on restart)
|
|
79
95
|
|
|
80
96
|
**How It Works:**
|
|
81
97
|
|
|
82
|
-
|
|
83
|
-
1. `x-btp-destination` (or `--btp`) → Gets JWT token from auth-broker → Adds `Authorization: Bearer <token>` header
|
|
84
|
-
2. `x-mcp-destination` (or `--mcp`) → Gets JWT token and SAP config from auth-broker → Adds SAP headers (`x-sap-jwt-token`, `x-sap-url`, etc.) - **optional**
|
|
85
|
-
3. MCP server URL obtained from service key for `x-btp-destination`
|
|
98
|
+
The proxy uses BTP/XSUAA authentication:
|
|
86
99
|
|
|
87
|
-
**BTP
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
100
|
+
1. **BTP Authentication** (if `--btp` or `x-btp-destination` is present):
|
|
101
|
+
- Uses `AuthorizationCodeProvider` (browser-based OAuth2 flow)
|
|
102
|
+
- **Eager Authentication**: Opens browser immediately on startup to get token
|
|
103
|
+
- Injects/overwrites `Authorization: Bearer <token>` header
|
|
104
|
+
- MCP server URL obtained from BTP destination service key OR injected via `--url`
|
|
105
|
+
- Service key format: contains `uaa` (url, clientid, clientsecret)
|
|
92
106
|
|
|
93
|
-
**
|
|
94
|
-
1.
|
|
95
|
-
2. `x-
|
|
96
|
-
3.
|
|
107
|
+
**BTP Authentication Mode** (with `--btp`):
|
|
108
|
+
1. Proxy starts → Opens browser for login (Eager Auth) → Gets/Refreshes JWT token
|
|
109
|
+
2. `x-btp-destination` (or `--btp`) → Adds `Authorization: Bearer <token>` header
|
|
110
|
+
3. MCP server URL obtained from service key OR `--url` parameter
|
|
97
111
|
|
|
98
112
|
## Documentation
|
|
99
113
|
|
|
100
|
-
- **[
|
|
101
|
-
- **[
|
|
102
|
-
- **[
|
|
103
|
-
- **[
|
|
104
|
-
- **[
|
|
105
|
-
- **[
|
|
106
|
-
- **[
|
|
114
|
+
- **[Client Setup Guide](./docs/CLIENT_SETUP.md)** - Step-by-step setup for Cline and GitHub Copilot
|
|
115
|
+
- **[Configuration Guide](./docs/CONFIGURATION.md)** - Complete configuration reference
|
|
116
|
+
- **[YAML Configuration Guide](./docs/YAML_CONFIG.md)** - Using YAML/JSON configuration files
|
|
117
|
+
- **[Usage Examples](./docs/USAGE.md)** - Practical usage examples and patterns
|
|
118
|
+
- **[API Documentation](./docs/API.md)** - API reference and interfaces
|
|
119
|
+
- **[Architecture](./docs/ARCHITECTURE.md)** - System architecture and design
|
|
120
|
+
- **[Troubleshooting](./docs/TROUBLESHOOTING.md)** - Common issues and solutions
|
|
121
|
+
- **[Routing Logic Specification](./docs/ROUTING_LOGIC.md)** - Detailed routing logic and scenarios
|
|
122
|
+
- **[Implementation Analysis](./docs/IMPLEMENTATION_ANALYSIS.md)** - Current implementation analysis
|
|
107
123
|
- **[Roadmap](./ROADMAP.md)** - Development roadmap and progress
|
|
108
124
|
|
|
109
125
|
## How It Works
|
|
110
126
|
|
|
111
127
|
The proxy performs the following steps for each request:
|
|
112
128
|
|
|
113
|
-
1. **Extract Headers**: Reads `x-btp-destination
|
|
114
|
-
2. **Apply Command Line Overrides**: `--btp
|
|
115
|
-
3. **Validate Routing Requirements**: Requires
|
|
116
|
-
4. **
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
8. **Forward Request**: Sends request to MCP server URL (from `x-mcp-url`, service key, or direct URL)
|
|
126
|
-
9. **Return Response**: Forwards the response back to the client
|
|
129
|
+
1. **Extract Headers**: Reads `x-btp-destination` header
|
|
130
|
+
2. **Apply Command Line Overrides**: `--btp` parameter overrides header (if provided)
|
|
131
|
+
3. **Validate Routing Requirements**: Requires `x-btp-destination/--btp`
|
|
132
|
+
4. **BTP Authentication** (if `x-btp-destination` or `--btp` is provided):
|
|
133
|
+
- Uses `AuthorizationCodeProvider` (browser-based login)
|
|
134
|
+
- **Eagerly** obtains token on startup (if configured via `--btp`)
|
|
135
|
+
- Retrieves JWT token using cached refresh token or opens browser
|
|
136
|
+
- Injects/overwrites `Authorization: Bearer <token>` header
|
|
137
|
+
5. **Get MCP Server URL**:
|
|
138
|
+
- From service key for `x-btp-destination`
|
|
139
|
+
6. **Forward Request**: Sends request to MCP server URL with all injected headers
|
|
140
|
+
7. **Return Response**: Forwards the response back to the client
|
|
127
141
|
|
|
128
142
|
### Example Request Flow
|
|
129
143
|
|
|
130
144
|
```
|
|
131
|
-
Cline → Proxy (adds BTP token
|
|
145
|
+
Cline → Proxy (adds BTP token) → Target MCP Server → Proxy → Cline
|
|
132
146
|
```
|
|
133
147
|
|
|
134
148
|
The proxy is transparent - it only adds authentication headers and forwards requests.
|
|
135
149
|
|
|
136
150
|
## Configuration
|
|
137
151
|
|
|
152
|
+
### Configuration
|
|
153
|
+
|
|
138
154
|
### Environment Variables
|
|
139
155
|
|
|
140
156
|
```bash
|
|
141
|
-
export CLOUD_LLM_HUB_URL="https://cloud-llm-hub.example.com"
|
|
142
157
|
export MCP_HTTP_PORT=3001
|
|
143
158
|
export LOG_LEVEL=info
|
|
144
159
|
export MCP_PROXY_UNSAFE=true # Enable file-based session storage (optional)
|
|
@@ -150,7 +165,6 @@ Create `mcp-proxy-config.json`:
|
|
|
150
165
|
|
|
151
166
|
```json
|
|
152
167
|
{
|
|
153
|
-
"cloudLlmHubUrl": "https://cloud-llm-hub.example.com",
|
|
154
168
|
"httpPort": 3001,
|
|
155
169
|
"logLevel": "info",
|
|
156
170
|
"maxRetries": 3,
|
|
@@ -163,7 +177,7 @@ Create `mcp-proxy-config.json`:
|
|
|
163
177
|
- `unsafe: false` (default) - Session data stored in-memory (secure, lost on restart)
|
|
164
178
|
- `unsafe: true` - Session data persisted to disk (tokens saved to `.env` files)
|
|
165
179
|
|
|
166
|
-
See [Configuration Guide](./
|
|
180
|
+
See [Configuration Guide](./docs/CONFIGURATION.md) for complete options.
|
|
167
181
|
|
|
168
182
|
## Error Handling & Resilience
|
|
169
183
|
|
|
@@ -191,9 +205,6 @@ npm run test:servers
|
|
|
191
205
|
# Direct execution
|
|
192
206
|
node tools/start-servers.js
|
|
193
207
|
|
|
194
|
-
# With MCP destination (local testing)
|
|
195
|
-
node tools/start-servers.js --mcp=trial
|
|
196
|
-
|
|
197
208
|
# With SSE transport
|
|
198
209
|
node tools/start-servers.js --transport=sse
|
|
199
210
|
```
|
|
@@ -213,7 +224,6 @@ See [tools/README.md](./tools/README.md) for complete documentation.
|
|
|
213
224
|
- ✅ Project Setup & Foundation
|
|
214
225
|
- ✅ Request Interception & Analysis
|
|
215
226
|
- ✅ JWT Token Management & Proxy Forwarding
|
|
216
|
-
- ✅ Local Testing Mode (without BTP authentication)
|
|
217
227
|
- ✅ Configuration & Environment
|
|
218
228
|
- ✅ Error Handling & Resilience
|
|
219
229
|
- ✅ Testing Tools (`tools/start-servers.js`)
|
|
@@ -237,6 +247,4 @@ MIT
|
|
|
237
247
|
- **Issues**: https://github.com/fr0ster/mcp-abap-adt-proxy/issues
|
|
238
248
|
- **Related Packages**:
|
|
239
249
|
- [@mcp-abap-adt/auth-broker](https://github.com/fr0ster/mcp-abap-adt-auth-broker)
|
|
240
|
-
- [@mcp-abap-adt/connection](https://github.com/fr0ster/mcp-abap-adt-connection)
|
|
241
250
|
- [@mcp-abap-adt/header-validator](https://github.com/fr0ster/mcp-abap-adt-header-validator)
|
|
242
|
-
|
|
@@ -50,21 +50,17 @@ Options:
|
|
|
50
50
|
--sse-port=<port> SSE server port (default: 3002)
|
|
51
51
|
--http-host=<host> HTTP server host (default: 0.0.0.0)
|
|
52
52
|
--sse-host=<host> SSE server host (default: 0.0.0.0)
|
|
53
|
-
--cloud-llm-hub-url Cloud LLM Hub URL (default: from env CLOUD_LLM_HUB_URL)
|
|
54
53
|
--btp=<destination> Override x-btp-destination header (for BTP Cloud authorization)
|
|
55
|
-
|
|
56
|
-
--
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Optional: either --btp, --mcp, or --mcp-url is required for stdio/SSE transports
|
|
61
|
-
Used for local testing without authentication
|
|
54
|
+
Required for stdio/SSE transports unless provided in headers
|
|
55
|
+
--target-url=<url> Override target URL (separates Auth from Connection)
|
|
56
|
+
Useful for direct OData service testing or non-standard MCP URLs
|
|
57
|
+
--config=<file>, -c Load configuration from YAML or JSON file
|
|
58
|
+
Alternative to command-line parameters
|
|
62
59
|
--unsafe Enable file-based session storage (persists tokens to disk)
|
|
63
60
|
--help, -h Show this help message
|
|
64
61
|
--version, -v Show version number
|
|
65
62
|
|
|
66
63
|
Environment Variables:
|
|
67
|
-
CLOUD_LLM_HUB_URL Cloud LLM Hub URL
|
|
68
64
|
MCP_HTTP_PORT HTTP server port (default: 3001)
|
|
69
65
|
MCP_SSE_PORT SSE server port (default: 3002)
|
|
70
66
|
MCP_HTTP_HOST HTTP server host (default: 0.0.0.0)
|
|
@@ -75,19 +71,14 @@ Environment Variables:
|
|
|
75
71
|
Examples:
|
|
76
72
|
mcp-abap-adt-proxy # Use default transport
|
|
77
73
|
mcp-abap-adt-proxy --transport=stdio --btp=ai # Use stdio transport with --btp
|
|
78
|
-
mcp-abap-adt-proxy --transport=stdio --mcp=trial # Use stdio with --mcp only (local testing, no BTP auth)
|
|
79
|
-
mcp-abap-adt-proxy --transport=stdio --mcp-url=http://localhost:3000/mcp # Use stdio with direct MCP URL (local testing)
|
|
80
|
-
mcp-abap-adt-proxy --transport=stdio --btp=ai --mcp=trial # Use stdio with both destinations
|
|
81
74
|
mcp-abap-adt-proxy --transport=http # HTTP mode (port 3001)
|
|
82
75
|
mcp-abap-adt-proxy --transport=http --http-port=8080 # HTTP mode on custom port
|
|
83
|
-
mcp-abap-adt-proxy --transport=sse --btp=ai
|
|
84
|
-
mcp-abap-adt-proxy --transport=sse --mcp=trial # SSE mode with --mcp only (local testing)
|
|
85
|
-
mcp-abap-adt-proxy --transport=sse --mcp-url=http://localhost:3000/mcp # SSE mode with direct MCP URL
|
|
76
|
+
mcp-abap-adt-proxy --transport=sse --btp=ai # SSE mode with BTP destination
|
|
86
77
|
mcp-abap-adt-proxy --transport=sse --sse-port=3002 # SSE mode on port 3002
|
|
87
|
-
mcp-abap-adt-proxy --btp=ai
|
|
88
|
-
mcp-abap-adt-proxy --
|
|
89
|
-
mcp-abap-adt-proxy --
|
|
90
|
-
mcp-abap-adt-proxy
|
|
78
|
+
mcp-abap-adt-proxy --btp=ai # With BTP destination override
|
|
79
|
+
mcp-abap-adt-proxy --btp=ai --unsafe # With file-based session storage
|
|
80
|
+
mcp-abap-adt-proxy --config=proxy-config.yaml # Load configuration from YAML file
|
|
81
|
+
mcp-abap-adt-proxy -c proxy-config.yml # Load configuration from YAML file (short form)
|
|
91
82
|
|
|
92
83
|
Transport Modes:
|
|
93
84
|
- stdio (default if stdin is not TTY): For MCP clients like Cline/Cursor
|
|
@@ -99,42 +90,25 @@ Usage Modes:
|
|
|
99
90
|
1. BTP Authentication Mode (with --btp):
|
|
100
91
|
- Adds Authorization: Bearer <token> header from BTP destination
|
|
101
92
|
- Gets MCP server URL from BTP destination service key
|
|
102
|
-
- Works with any BTP service
|
|
93
|
+
- Works with any BTP service
|
|
103
94
|
Example: mcp-abap-adt-proxy --btp=ai
|
|
104
95
|
|
|
105
|
-
2. BTP + SAP Configuration Mode (--btp + --mcp):
|
|
106
|
-
- Adds Authorization: Bearer <token> header from BTP destination
|
|
107
|
-
- Adds SAP headers (x-sap-jwt-token, x-sap-url, etc.) from MCP destination
|
|
108
|
-
- Gets MCP server URL from BTP destination service key
|
|
109
|
-
- Suitable for SAP ABAP systems that require both BTP and SAP authentication
|
|
110
|
-
Example: mcp-abap-adt-proxy --btp=ai --mcp=trial
|
|
111
|
-
|
|
112
|
-
3. Local Testing Mode (only --mcp or --mcp-url):
|
|
113
|
-
- No BTP authentication required
|
|
114
|
-
- Gets MCP server URL from MCP destination service key (--mcp) or uses direct URL (--mcp-url)
|
|
115
|
-
- Optional SAP token (won't fail if unavailable)
|
|
116
|
-
- Enables local integration testing without BTP authentication
|
|
117
|
-
Example: mcp-abap-adt-proxy --mcp=trial
|
|
118
|
-
Example: mcp-abap-adt-proxy --mcp-url=http://localhost:3000/mcp
|
|
119
|
-
|
|
120
96
|
Headers (for HTTP/SSE transports):
|
|
121
97
|
- x-btp-destination: Destination for BTP Cloud authorization (optional if --btp is used)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
At least one of the above headers (or corresponding --btp/--mcp/--mcp-url parameter) is required.
|
|
98
|
+
|
|
99
|
+
At least one of the above headers (or corresponding --btp parameter) is required.
|
|
126
100
|
|
|
127
101
|
Service Keys:
|
|
128
102
|
Service keys should be placed in:
|
|
129
103
|
- Unix: ~/.config/mcp-abap-adt/service-keys/<destination>.json
|
|
130
104
|
- Windows: %USERPROFILE%\\Documents\\mcp-abap-adt\\service-keys\\<destination>.json
|
|
131
|
-
|
|
105
|
+
|
|
132
106
|
For BTP destination, service key should contain:
|
|
133
107
|
{
|
|
134
108
|
"uaa": { "url": "...", "clientid": "...", "clientsecret": "..." },
|
|
135
109
|
"abap": { "url": "https://your-mcp-server.com" }
|
|
136
110
|
}
|
|
137
|
-
|
|
111
|
+
|
|
138
112
|
The "abap.url" field is used as the MCP server URL (even for non-SAP services).
|
|
139
113
|
|
|
140
114
|
For more information, see: https://github.com/fr0ster/mcp-abap-adt-proxy
|
|
@@ -243,4 +217,3 @@ function main() {
|
|
|
243
217
|
|
|
244
218
|
// Run launcher
|
|
245
219
|
main();
|
|
246
|
-
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
/**
|
|
3
2
|
* MCP ABAP ADT Proxy Server
|
|
4
3
|
*
|
|
5
4
|
* Proxies local MCP requests to MCP servers with optional JWT authentication.
|
|
6
5
|
* Routes requests based on authentication headers:
|
|
7
6
|
* - x-btp-destination (or --btp): BTP Cloud authorization with JWT token
|
|
8
|
-
* - x-mcp-destination (or --mcp): SAP ABAP connection configuration
|
|
9
7
|
*
|
|
10
|
-
* Supports
|
|
11
|
-
* 1. BTP authentication mode: Requires x-btp-destination or --btp parameter
|
|
12
|
-
* 2. Local testing mode: Works with only x-mcp-destination or --mcp parameter (no BTP authentication)
|
|
8
|
+
* Supports BTP authentication mode: Requires x-btp-destination or --btp parameter
|
|
13
9
|
*/
|
|
14
|
-
import { TransportConfig } from
|
|
10
|
+
import { type TransportConfig } from './lib/transportConfig.js';
|
|
15
11
|
/**
|
|
16
12
|
* MCP ABAP ADT Proxy Server
|
|
17
13
|
*/
|
|
@@ -20,17 +16,12 @@ export declare class McpAbapAdtProxyServer {
|
|
|
20
16
|
private transportConfig;
|
|
21
17
|
private config;
|
|
22
18
|
private httpServer?;
|
|
23
|
-
private
|
|
19
|
+
private btpProxy?;
|
|
24
20
|
constructor(transportConfig?: TransportConfig, configPath?: string);
|
|
25
21
|
/**
|
|
26
22
|
* Setup MCP handlers
|
|
27
23
|
*/
|
|
28
24
|
private setupHandlers;
|
|
29
|
-
/**
|
|
30
|
-
* Handle stdio request by proxying to MCP server
|
|
31
|
-
* Supports both BTP authentication mode (--btp) and local testing mode (--mcp without --btp)
|
|
32
|
-
*/
|
|
33
|
-
private handleStdioRequest;
|
|
34
25
|
/**
|
|
35
26
|
* Run the proxy server
|
|
36
27
|
*/
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAiBH,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,0BAA0B,CAAC;AAsBlC;;GAEG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,MAAM,CAAgC;IAC9C,OAAO,CAAC,UAAU,CAAC,CAAa;IAChC,OAAO,CAAC,QAAQ,CAAC,CAAW;gBAEhB,eAAe,CAAC,EAAE,eAAe,EAAE,UAAU,CAAC,EAAE,MAAM;IA0ClE;;OAEG;IACH,OAAO,CAAC,aAAa;IAMrB;;OAEG;IACG,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAuE1B;;OAEG;YACW,eAAe;IA4M7B;;OAEG;YACW,kBAAkB;IAyOhC;;OAEG;YACW,cAAc;IA0S5B;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAmBhC;AAGD,eAAe,qBAAqB,CAAC"}
|