@mcp-abap-adt/proxy 0.1.4 → 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.
Files changed (39) hide show
  1. package/CHANGELOG.md +66 -1
  2. package/README.md +73 -63
  3. package/bin/mcp-abap-adt-proxy.js +15 -42
  4. package/dist/index.d.ts +3 -12
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +440 -273
  7. package/dist/lib/config.d.ts +13 -4
  8. package/dist/lib/config.d.ts.map +1 -1
  9. package/dist/lib/config.js +110 -92
  10. package/dist/lib/errorHandler.d.ts +3 -3
  11. package/dist/lib/errorHandler.d.ts.map +1 -1
  12. package/dist/lib/errorHandler.js +31 -28
  13. package/dist/lib/logger.d.ts.map +1 -1
  14. package/dist/lib/logger.js +15 -1
  15. package/dist/lib/stores.d.ts +7 -6
  16. package/dist/lib/stores.d.ts.map +1 -1
  17. package/dist/lib/stores.js +121 -8
  18. package/dist/lib/transportConfig.d.ts +1 -1
  19. package/dist/lib/transportConfig.d.ts.map +1 -1
  20. package/dist/lib/transportConfig.js +58 -38
  21. package/dist/proxy/btpProxy.d.ts +102 -0
  22. package/dist/proxy/btpProxy.d.ts.map +1 -0
  23. package/dist/proxy/btpProxy.js +833 -0
  24. package/dist/proxy/cloudLlmHubProxy.d.ts +1 -60
  25. package/dist/proxy/cloudLlmHubProxy.d.ts.map +1 -1
  26. package/dist/proxy/cloudLlmHubProxy.js +1 -378
  27. package/dist/router/headerAnalyzer.d.ts +14 -18
  28. package/dist/router/headerAnalyzer.d.ts.map +1 -1
  29. package/dist/router/headerAnalyzer.js +40 -67
  30. package/dist/router/requestInterceptor.d.ts +5 -11
  31. package/dist/router/requestInterceptor.d.ts.map +1 -1
  32. package/dist/router/requestInterceptor.js +33 -30
  33. package/package.json +33 -14
  34. package/dist/router/directCloudRouter.d.ts +0 -32
  35. package/dist/router/directCloudRouter.d.ts.map +0 -1
  36. package/dist/router/directCloudRouter.js +0 -179
  37. package/dist/router/localBasicRouter.d.ts +0 -23
  38. package/dist/router/localBasicRouter.d.ts.map +0 -1
  39. package/dist/router/localBasicRouter.js +0 -140
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 `doc/USAGE.md`
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 cloud-llm-hub with JWT authentication.
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 (like `cloud-llm-hub`) with automatic JWT token management via `@mcp-abap-adt/auth-broker`. The proxy adds authentication headers and forwards requests transparently.
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 command line overrides
36
- mcp-abap-adt-proxy --btp=ai --mcp=trial
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
- # With all options
42
- mcp-abap-adt-proxy --btp=ai --mcp=trial --unsafe
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 (Cline)
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
- The proxy uses two service keys (URLs are obtained from service keys):
68
+ **Quick Example (Cline)**:
48
69
 
49
70
  ```json
50
71
  {
@@ -55,88 +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 (one of the following):**
67
- - `x-btp-destination` - Destination name for BTP Cloud authorization token and MCP server URL (for BTP authentication mode)
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 (for BTP authentication mode, takes precedence)
76
- - `--mcp=<destination>` - Overrides `x-mcp-destination` header (for local testing or SAP config, takes precedence)
77
- - `--mcp-url=<url>` - Direct MCP server URL (for local testing without authentication, takes precedence)
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
- **BTP Authentication Mode** (with `x-btp-destination` or `--btp`):
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-Only Mode** (with only `x-btp-destination`/`--btp`, without `x-mcp-destination`):
88
- - Works with any BTP service, not just SAP ABAP
89
- - Only adds `Authorization: Bearer <token>` header (no SAP headers)
90
- - MCP server URL obtained from BTP destination service key
91
- - Suitable for BTP services that don't require SAP ABAP configuration
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
- **Local Testing Mode** (with only `x-mcp-destination`/`--mcp` or `x-mcp-url`/`--mcp-url`):
94
- 1. `x-mcp-url` (or `--mcp-url`) → Direct URL to MCP server (no authentication)
95
- 2. `x-mcp-destination` (or `--mcp`) → Gets MCP server URL from service key for MCP destination (optional token)
96
- 3. No BTP authentication required - enables local integration testing
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
- - **[Configuration Guide](./doc/CONFIGURATION.md)** - Complete configuration reference
101
- - **[Usage Examples](./doc/USAGE.md)** - Practical usage examples and patterns
102
- - **[API Documentation](./doc/API.md)** - API reference and interfaces
103
- - **[Architecture](./doc/ARCHITECTURE.md)** - System architecture and design
104
- - **[Troubleshooting](./doc/TROUBLESHOOTING.md)** - Common issues and solutions
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
105
123
  - **[Roadmap](./ROADMAP.md)** - Development roadmap and progress
106
124
 
107
125
  ## How It Works
108
126
 
109
127
  The proxy performs the following steps for each request:
110
128
 
111
- 1. **Extract Headers**: Reads `x-btp-destination`, `x-mcp-destination`, and `x-mcp-url` headers
112
- 2. **Apply Command Line Overrides**: `--btp`, `--mcp`, and `--mcp-url` parameters override headers (if provided)
113
- 3. **Validate Routing Requirements**: Requires at least one of: `x-btp-destination/--btp`, `x-mcp-destination/--mcp`, or `x-mcp-url/--mcp-url`
114
- 4. **Get MCP Server URL** (priority order):
115
- - From `x-mcp-url` header or `--mcp-url` parameter (direct URL)
116
- - From service key for `x-btp-destination` (if provided)
117
- - From service key for `x-mcp-destination` (if only MCP destination is provided)
118
- 5. **Get BTP Cloud Token** (if `x-btp-destination` or `--btp` is provided): Retrieves JWT token for BTP Cloud authorization
119
- 6. **Get SAP ABAP Config** (if `x-mcp-destination` or `--mcp` is provided): Retrieves JWT token and SAP configuration (URL, client, etc.) - optional, won't fail if unavailable
120
- 7. **Build Request**:
121
- - Adds `Authorization: Bearer <token>` from `x-btp-destination` (or `--btp`) - **only if BTP destination is provided**
122
- - Adds SAP headers (`x-sap-jwt-token`, `x-sap-url`, etc.) from `x-mcp-destination` (or `--mcp`) - **only if provided**
123
- 8. **Forward Request**: Sends request to MCP server URL (from `x-mcp-url`, service key, or direct URL)
124
- 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
125
141
 
126
142
  ### Example Request Flow
127
143
 
128
144
  ```
129
- Cline → Proxy (adds BTP token + SAP config) → Target MCP Server → Proxy → Cline
145
+ Cline → Proxy (adds BTP token) → Target MCP Server → Proxy → Cline
130
146
  ```
131
147
 
132
148
  The proxy is transparent - it only adds authentication headers and forwards requests.
133
149
 
134
150
  ## Configuration
135
151
 
152
+ ### Configuration
153
+
136
154
  ### Environment Variables
137
155
 
138
156
  ```bash
139
- export CLOUD_LLM_HUB_URL="https://cloud-llm-hub.example.com"
140
157
  export MCP_HTTP_PORT=3001
141
158
  export LOG_LEVEL=info
142
159
  export MCP_PROXY_UNSAFE=true # Enable file-based session storage (optional)
@@ -148,7 +165,6 @@ Create `mcp-proxy-config.json`:
148
165
 
149
166
  ```json
150
167
  {
151
- "cloudLlmHubUrl": "https://cloud-llm-hub.example.com",
152
168
  "httpPort": 3001,
153
169
  "logLevel": "info",
154
170
  "maxRetries": 3,
@@ -161,7 +177,7 @@ Create `mcp-proxy-config.json`:
161
177
  - `unsafe: false` (default) - Session data stored in-memory (secure, lost on restart)
162
178
  - `unsafe: true` - Session data persisted to disk (tokens saved to `.env` files)
163
179
 
164
- See [Configuration Guide](./doc/CONFIGURATION.md) for complete options.
180
+ See [Configuration Guide](./docs/CONFIGURATION.md) for complete options.
165
181
 
166
182
  ## Error Handling & Resilience
167
183
 
@@ -189,9 +205,6 @@ npm run test:servers
189
205
  # Direct execution
190
206
  node tools/start-servers.js
191
207
 
192
- # With MCP destination (local testing)
193
- node tools/start-servers.js --mcp=trial
194
-
195
208
  # With SSE transport
196
209
  node tools/start-servers.js --transport=sse
197
210
  ```
@@ -211,7 +224,6 @@ See [tools/README.md](./tools/README.md) for complete documentation.
211
224
  - ✅ Project Setup & Foundation
212
225
  - ✅ Request Interception & Analysis
213
226
  - ✅ JWT Token Management & Proxy Forwarding
214
- - ✅ Local Testing Mode (without BTP authentication)
215
227
  - ✅ Configuration & Environment
216
228
  - ✅ Error Handling & Resilience
217
229
  - ✅ Testing Tools (`tools/start-servers.js`)
@@ -235,6 +247,4 @@ MIT
235
247
  - **Issues**: https://github.com/fr0ster/mcp-abap-adt-proxy/issues
236
248
  - **Related Packages**:
237
249
  - [@mcp-abap-adt/auth-broker](https://github.com/fr0ster/mcp-abap-adt-auth-broker)
238
- - [@mcp-abap-adt/connection](https://github.com/fr0ster/mcp-abap-adt-connection)
239
250
  - [@mcp-abap-adt/header-validator](https://github.com/fr0ster/mcp-abap-adt-header-validator)
240
-
@@ -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
- Optional: either --btp, --mcp, or --mcp-url is required for stdio/SSE transports
56
- --mcp=<destination> Override x-mcp-destination header (for SAP ABAP connection)
57
- Optional: either --btp, --mcp, or --mcp-url is required for stdio/SSE transports
58
- Can be used without --btp for local testing (no BTP authentication)
59
- --mcp-url=<url> Direct MCP server URL (for local testing without BTP)
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 --mcp=trial # SSE mode with destinations
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 --mcp=trial # With destination overrides
88
- mcp-abap-adt-proxy --mcp=trial # Local testing mode (no BTP authentication)
89
- mcp-abap-adt-proxy --mcp-url=http://localhost:3000/mcp # Local testing with direct MCP URL (no authentication)
90
- mcp-abap-adt-proxy --btp=ai --mcp=trial --unsafe # With file-based session storage
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, not just SAP ABAP
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
- - x-mcp-destination: Destination for SAP ABAP connection (optional if --mcp is used)
123
- - x-mcp-url: Direct MCP server URL (optional if --mcp-url is used)
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 two modes:
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 "./lib/transportConfig.js";
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 cloudLlmHubProxy?;
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
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;GAWG;AAOH,OAAO,EAAwB,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAOjF;;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,gBAAgB,CAAC,CAAmB;gBAEhC,eAAe,CAAC,EAAE,eAAe,EAAE,UAAU,CAAC,EAAE,MAAM;IAqClE;;OAEG;IACH,OAAO,CAAC,aAAa;IAMrB;;;OAGG;YACW,kBAAkB;IA4EhC;;OAEG;IACG,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAkD1B;;OAEG;YACW,eAAe;IAsH7B;;OAEG;YACW,kBAAkB;IAsEhC;;OAEG;YACW,cAAc;IA+R5B;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAmBhC;AAGD,eAAe,qBAAqB,CAAC"}
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"}