@mcp-abap-adt/core 2.2.0 → 2.2.2

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 CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [2.2.1] - 2026-02-10
6
+ ### Changed
7
+ - **Configurator split**: Removed `mcp-abap-adt-configure` from core. Use `@mcp-abap-adt/configurator` (repo: `mcp-abap-adt-conf`) with `mcp-conf` instead.
8
+
5
9
  ## [2.2.0] - 2026-02-09
6
10
  ### Added
7
11
  - **MCP Registry metadata**: Added `server.json` and `mcpName` for registry publishing.
package/README.md CHANGED
@@ -8,6 +8,22 @@
8
8
 
9
9
  This project provides a server that allows you to interact with SAP ABAP systems using the Model Context Protocol (MCP). Think of it as a bridge that lets tools like [Cline](https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev) (a VS Code extension) talk to your ABAP system and retrieve information like source code, table structures, and more.
10
10
 
11
+ ## Configure Clients Fast (Recommended)
12
+
13
+ Use the configurator to generate client config files instead of hand‑editing JSON/TOML:
14
+
15
+ ```bash
16
+ npm install -g @mcp-abap-adt/configurator
17
+
18
+ # stdio (destination)
19
+ mcp-conf --client cline --name abap --mcp TRIAL
20
+
21
+ # HTTP (streamable HTTP)
22
+ mcp-conf --client copilot --name abap --transport http --url http://localhost:3000/mcp/stream/http --header x-mcp-destination=trial
23
+ ```
24
+
25
+ Full usage: `docs/CLIENT_INSTALLERS.md` in the `mcp-abap-adt-conf` repo.
26
+
11
27
  ## Architecture
12
28
 
13
29
  The project provides two main usage patterns:
@@ -35,9 +51,10 @@ await server.connect(transport);
35
51
 
36
52
  ## Quick Start
37
53
 
38
- 1. **Install**: See [Installation Guide](docs/installation/INSTALLATION.md)
39
- 2. **Configure**: See [Client Configuration](docs/user-guide/CLIENT_CONFIGURATION.md)
40
- 3. **Use**: See [Available Tools](docs/user-guide/AVAILABLE_TOOLS.md)
54
+ 1. **Install server**: See [Installation Guide](docs/installation/INSTALLATION.md)
55
+ 2. **Configure client (auto)**: Use `mcp-conf` from `@mcp-abap-adt/configurator` (repo: `mcp-abap-adt-conf`)
56
+ 3. **Configure client (manual)**: See [Client Configuration](docs/user-guide/CLIENT_CONFIGURATION.md)
57
+ 4. **Use**: See [Available Tools](docs/user-guide/AVAILABLE_TOOLS.md)
41
58
 
42
59
  ## MCP Registry
43
60
 
@@ -70,6 +87,7 @@ Published in the official MCP Registry. See `docs/deployment/MCP_REGISTRY.md` fo
70
87
  ### For Users
71
88
  - **[Installation Guide](docs/installation/INSTALLATION.md)** - Installation instructions for all platforms
72
89
  - **[Client Configuration](docs/user-guide/CLIENT_CONFIGURATION.md)** - How to configure MCP clients
90
+ - **Configurator**: `@mcp-abap-adt/configurator` (repo: `mcp-abap-adt-conf`) provides the `mcp-conf` CLI to auto-configure clients.
73
91
  - **[Available Tools](docs/user-guide/AVAILABLE_TOOLS.md)** - Complete list of available MCP tools
74
92
 
75
93
  ### For Administrators
@@ -61,6 +61,7 @@ export declare class StreamableHttpServer extends BaseMcpServer {
61
61
  private readonly defaultDestination?;
62
62
  private readonly path;
63
63
  private readonly externalApp?;
64
+ private readonly version;
64
65
  constructor(handlersRegistry: IHandlersRegistry, authBrokerFactory: AuthBrokerFactory, opts?: StreamableHttpServerOptions);
65
66
  /**
66
67
  * Creates the request handler function
@@ -90,5 +91,6 @@ export declare class StreamableHttpServer extends BaseMcpServer {
90
91
  * Check if request has SAP connection headers
91
92
  */
92
93
  private hasSapConnectionHeaders;
94
+ private createPerRequestServer;
93
95
  }
94
96
  //# sourceMappingURL=StreamableHttpServer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StreamableHttpServer.d.ts","sourceRoot":"","sources":["../../src/server/StreamableHttpServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM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AAI,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAU;IAC7C,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAS;IAC7C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAmB;IAChD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAGd,gBAAgB,EAAE,iBAAiB,EACnC,iBAAiB,EAAE,iBAAiB,EACrD,IAAI,CAAC,EAAE,2BAA2B;IAkBpC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IA2E5B;;;;;;OAMG;IACH,cAAc,CACZ,GAAG,EAAE,gBAAgB,EACrB,QAAQ,CAAC,EAAE,wBAAwB,GAClC,IAAI;IAwBP;;OAEG;IACH,OAAO,IAAI,MAAM;IAIjB;;;;;OAKG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA4B5B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAY/B,OAAO,CAAC,sBAAsB;CA0C/B"}
@@ -27,6 +27,7 @@ class StreamableHttpServer extends BaseMcpServer_js_1.BaseMcpServer {
27
27
  defaultDestination;
28
28
  path;
29
29
  externalApp;
30
+ version;
30
31
  constructor(handlersRegistry, authBrokerFactory, opts) {
31
32
  super({
32
33
  name: 'mcp-abap-adt',
@@ -35,6 +36,7 @@ class StreamableHttpServer extends BaseMcpServer_js_1.BaseMcpServer {
35
36
  });
36
37
  this.handlersRegistry = handlersRegistry;
37
38
  this.authBrokerFactory = authBrokerFactory;
39
+ this.version = opts?.version ?? DEFAULT_VERSION;
38
40
  this.host = opts?.host ?? '127.0.0.1';
39
41
  this.port = opts?.port ?? 3000;
40
42
  this.enableJsonResponse = opts?.enableJsonResponse ?? true;
@@ -53,6 +55,7 @@ class StreamableHttpServer extends BaseMcpServer_js_1.BaseMcpServer {
53
55
  const clientId = `${req.socket.remoteAddress}:${req.socket.remotePort}`;
54
56
  console.error(`[StreamableHttpServer] ${req.method} ${req.path} from ${clientId}`);
55
57
  try {
58
+ const server = this.createPerRequestServer();
56
59
  let destination;
57
60
  let broker;
58
61
  // Priority 1: Check x-mcp-destination header
@@ -69,20 +72,22 @@ class StreamableHttpServer extends BaseMcpServer_js_1.BaseMcpServer {
69
72
  // No destination, no broker - create connection directly from headers
70
73
  destination = undefined;
71
74
  broker = undefined;
72
- this.setConnectionContextFromHeaders(req.headers);
75
+ server.setConnectionContextFromHeadersPublic(req.headers);
73
76
  }
74
77
  // Priority 3: Use default destination
75
78
  else if (this.defaultDestination) {
76
79
  destination = this.defaultDestination;
77
- broker =
78
- await this.authBrokerFactory.getOrCreateAuthBroker(destination);
80
+ // Use default broker for --mcp/--env startup config
81
+ broker = await this.authBrokerFactory.getOrCreateAuthBroker();
79
82
  }
80
83
  // Priority 4: No auth params at all
81
84
  // Allow request to proceed - metadata methods (tools/list, etc.) will work
82
85
  // tools/call will fail with appropriate error in handler
83
- // Set connection context only if we have destination or broker
86
+ if (destination && !broker) {
87
+ throw new Error(`Auth broker not initialized for destination: ${destination}`);
88
+ }
84
89
  if (destination && broker) {
85
- await this.setConnectionContext(destination, broker);
90
+ await server.setConnectionContextPublic(destination, broker);
86
91
  }
87
92
  const transport = new streamableHttp_js_1.StreamableHTTPServerTransport({
88
93
  sessionIdGenerator: undefined, // stateless mode to avoid ID collisions
@@ -91,7 +96,7 @@ class StreamableHttpServer extends BaseMcpServer_js_1.BaseMcpServer {
91
96
  res.on('close', () => {
92
97
  void transport.close();
93
98
  });
94
- await this.connect(transport);
99
+ await server.connect(transport);
95
100
  await transport.handleRequest(req, res, req.body);
96
101
  }
97
102
  catch (err) {
@@ -114,9 +119,9 @@ class StreamableHttpServer extends BaseMcpServer_js_1.BaseMcpServer {
114
119
  // Only handle POST requests - GET SSE streams cause abort errors on disconnect
115
120
  app.post(this.path, handler);
116
121
  // Return 405 for other methods to avoid SSE stream issues
117
- app.all(this.path, ((_req, res) => {
122
+ app.all(this.path, (_req, res) => {
118
123
  res.status(405).send('Method Not Allowed');
119
- }));
124
+ });
120
125
  console.error(`[StreamableHttpServer] Routes registered on external app at ${this.path}`);
121
126
  console.error(`[StreamableHttpServer] JSON response mode: ${this.enableJsonResponse}`);
122
127
  if (this.defaultDestination) {
@@ -165,6 +170,26 @@ class StreamableHttpServer extends BaseMcpServer_js_1.BaseMcpServer {
165
170
  (headers['x-sap-password'] || headers['X-SAP-Password']);
166
171
  return !!(hasUrl && (hasJwtAuth || hasBasicAuth));
167
172
  }
173
+ createPerRequestServer() {
174
+ class PerRequestServer extends BaseMcpServer_js_1.BaseMcpServer {
175
+ registry;
176
+ constructor(registry, version, logger) {
177
+ super({ name: 'mcp-abap-adt', version, logger });
178
+ this.registry = registry;
179
+ this.registerHandlers(this.registry);
180
+ }
181
+ setConnectionContextPublic(destination, broker) {
182
+ if (!broker) {
183
+ return Promise.resolve();
184
+ }
185
+ return this.setConnectionContext(destination, broker);
186
+ }
187
+ setConnectionContextFromHeadersPublic(headers) {
188
+ this.setConnectionContextFromHeaders(headers);
189
+ }
190
+ }
191
+ return new PerRequestServer(this.handlersRegistry, this.version, this.logger);
192
+ }
168
193
  }
169
194
  exports.StreamableHttpServer = StreamableHttpServer;
170
195
  //# sourceMappingURL=StreamableHttpServer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StreamableHttpServer.js","sourceRoot":"","sources":["../../src/server/StreamableHttpServer.ts"],"names":[],"mappings":";;;;;;AACA,0FAAmG;AACnG,sDAA+D;AAE/D,8DAAqD;AAErD,yDAAmD;AAMnD,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,OAAO,CAAC;AA2CnE;;;;;;;;GAQG;AACH,MAAa,oBAAqB,SAAQ,gCAAa;IASlC;IACA;IATF,IAAI,CAAS;IACb,IAAI,CAAS;IACb,kBAAkB,CAAU;IAC5B,kBAAkB,CAAU;IAC5B,IAAI,CAAS;IACb,WAAW,CAAoB;IAEhD,YACmB,gBAAmC,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YACxD,CAAC;YAEM,qCAAqC,CAC1C,OAAsD;gBAEtD,IAAI,CAAC,+BAA+B,CAAC,OAAO,CAAC,CAAC;YAChD,CAAC;SACF;QACD,OAAO,IAAI,gBAAgB,CACzB,IAAI,CAAC,gBAAgB,EACrB,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,MAAM,CACZ,CAAC;IACJ,CAAC;CACF;AAjPD,oDAiPC"}
package/docs/README.md CHANGED
@@ -17,6 +17,7 @@ Complete installation instructions for different platforms and environments.
17
17
  Documentation for end users: configuration, usage, and available tools.
18
18
 
19
19
  - `CLIENT_CONFIGURATION.md` - How to configure MCP clients to connect to the server
20
+ - Configurator (auto-config): `@mcp-abap-adt/configurator` (repo: `mcp-abap-adt-conf`)
20
21
  - `AVAILABLE_TOOLS.md` - Complete list of available MCP tools and their descriptions
21
22
  - `CLI_OPTIONS.md` - Complete command-line options reference
22
23
 
@@ -49,7 +50,6 @@ Documentation for developers: testing, development guides, and internal document
49
50
  - **User Configuration**: [Client Configuration](user-guide/CLIENT_CONFIGURATION.md)
50
51
  - **Server Configuration**: [YAML Config](configuration/YAML_CONFIG.md) | [CLI Options](user-guide/CLI_OPTIONS.md)
51
52
  - **Deployment**: [MCP Registry](deployment/MCP_REGISTRY.md) | [Docker](deployment/DOCKER.md)
52
- - **Client Configuration**: [Auto-Configure](installation/CLIENT_INSTALLERS.md)
53
53
  - **Available Tools**: [Tools List](user-guide/AVAILABLE_TOOLS.md)
54
54
  - **Architecture**: [Stateful Sessions](architecture/STATEFUL_SESSION_GUIDE.md) | [Architecture Docs](architecture/README.md)
55
55
  - **Development**: [Development Documentation](development/)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mcp-abap-adt/core",
3
3
  "mcpName": "io.github.fr0ster/mcp-abap-adt",
4
- "version": "2.2.0",
4
+ "version": "2.2.2",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -127,7 +127,6 @@
127
127
  "@mcp-abap-adt/interfaces": "^0.2.15",
128
128
  "@mcp-abap-adt/logger": "^0.1.4",
129
129
  "@modelcontextprotocol/sdk": "^1.26.0",
130
- "@iarna/toml": "^2.2.5",
131
130
  "axios": "^1.13.5",
132
131
  "fast-xml-parser": "^5.3.5",
133
132
  "js-yaml": "^4.1.1",
@@ -150,8 +149,7 @@
150
149
  ],
151
150
  "bin": {
152
151
  "mcp-abap-adt": "./bin/mcp-abap-adt.js",
153
- "mcp-abap-adt-v2": "./bin/mcp-abap-adt-v2.js",
154
- "mcp-abap-adt-configure": "./bin/mcp-abap-adt-configure.js"
152
+ "mcp-abap-adt-v2": "./bin/mcp-abap-adt-v2.js"
155
153
  },
156
154
  "jest": {
157
155
  "preset": "ts-jest",
@@ -1,514 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require("fs");
4
- const path = require("path");
5
- const os = require("os");
6
-
7
- let yaml;
8
- try {
9
- // Optional dependency already in package.json
10
- // eslint-disable-next-line import/no-extraneous-dependencies
11
- yaml = require("yaml");
12
- } catch {
13
- yaml = null;
14
- }
15
-
16
- let toml;
17
- try {
18
- // eslint-disable-next-line import/no-extraneous-dependencies
19
- toml = require("@iarna/toml");
20
- } catch {
21
- toml = null;
22
- }
23
-
24
- const args = process.argv.slice(2);
25
- const options = {
26
- clients: [],
27
- envPath: null,
28
- mcpDestination: null,
29
- name: null,
30
- transport: "stdio",
31
- command: "mcp-abap-adt",
32
- dryRun: false,
33
- force: false,
34
- project: null,
35
- disabled: false,
36
- toggle: false,
37
- remove: false,
38
- configPath: null,
39
- };
40
-
41
- if (args.includes("--help") || args.includes("-h")) {
42
- printHelp();
43
- process.exit(0);
44
- }
45
-
46
- for (let i = 0; i < args.length; i += 1) {
47
- const arg = args[i];
48
- if (arg === "--client") {
49
- options.clients.push(args[i + 1]);
50
- i += 1;
51
- } else if (arg === "--env") {
52
- options.envPath = args[i + 1];
53
- i += 1;
54
- } else if (arg === "--mcp") {
55
- options.mcpDestination = args[i + 1];
56
- i += 1;
57
- } else if (arg === "--name") {
58
- options.name = args[i + 1];
59
- i += 1;
60
- } else if (arg === "--transport") {
61
- options.transport = args[i + 1];
62
- i += 1;
63
- } else if (arg === "--command") {
64
- options.command = args[i + 1];
65
- i += 1;
66
- } else if (arg === "--project") {
67
- options.project = args[i + 1];
68
- i += 1;
69
- } else if (arg === "--config") {
70
- options.configPath = args[i + 1];
71
- i += 1;
72
- } else if (arg === "--disable") {
73
- options.disabled = true;
74
- options.toggle = true;
75
- } else if (arg === "--enable") {
76
- options.disabled = false;
77
- options.toggle = true;
78
- } else if (arg === "--remove") {
79
- options.remove = true;
80
- } else if (arg === "--dry-run") {
81
- options.dryRun = true;
82
- } else if (arg === "--force") {
83
- options.force = true;
84
- }
85
- }
86
-
87
- if (options.clients.length === 0) {
88
- fail("Provide at least one --client.");
89
- }
90
-
91
- if (!options.name) {
92
- fail("Provide --name <serverName> (required).");
93
- }
94
-
95
- if (options.transport !== "stdio") {
96
- fail("Only --transport stdio is supported by this installer.");
97
- }
98
-
99
- const requiresConnectionParams = !options.remove && !options.toggle;
100
-
101
- if (requiresConnectionParams) {
102
- if (!options.envPath && !options.mcpDestination) {
103
- fail("Provide either --env <path> or --mcp <destination>.");
104
- }
105
-
106
- if (options.envPath && options.mcpDestination) {
107
- fail("Use only one of --env or --mcp.");
108
- }
109
- }
110
-
111
- const platform = process.platform;
112
- const home = os.homedir();
113
- const appData =
114
- process.env.APPDATA || path.join(home, "AppData", "Roaming");
115
- const userProfile = process.env.USERPROFILE || home;
116
-
117
- const serverArgsRaw = options.remove || options.toggle
118
- ? []
119
- : [
120
- `--transport=${options.transport}`,
121
- options.envPath
122
- ? `--env=${options.envPath}`
123
- : options.mcpDestination
124
- ? `--mcp=${options.mcpDestination.toLowerCase()}`
125
- : undefined,
126
- ];
127
- const serverArgs = serverArgsRaw.filter(Boolean);
128
-
129
- for (const client of options.clients) {
130
- switch (client) {
131
- case "cline":
132
- writeJsonConfig(
133
- getClinePath(platform, home, appData),
134
- options.name,
135
- serverArgs,
136
- "cline"
137
- );
138
- break;
139
- case "codex":
140
- writeCodexConfig(getCodexPath(platform, home, userProfile), options.name, serverArgs);
141
- break;
142
- case "claude":
143
- writeClaudeConfig(
144
- getClaudePath(platform, home, appData, options.configPath),
145
- options.name,
146
- serverArgs
147
- );
148
- break;
149
- case "goose":
150
- writeGooseConfig(
151
- getGoosePath(platform, home, appData),
152
- options.name,
153
- serverArgs
154
- );
155
- break;
156
- case "cursor":
157
- writeJsonConfig(
158
- getCursorPath(platform, home, userProfile),
159
- options.name,
160
- serverArgs,
161
- "cursor"
162
- );
163
- break;
164
- case "windsurf":
165
- writeJsonConfig(
166
- getWindsurfPath(platform, home, userProfile),
167
- options.name,
168
- serverArgs,
169
- "windsurf"
170
- );
171
- break;
172
- default:
173
- fail(`Unknown client: ${client}`);
174
- }
175
- }
176
-
177
- function getClinePath(platformValue, homeDir, appDataDir) {
178
- if (platformValue === "win32") {
179
- return path.join(
180
- appDataDir,
181
- "Code",
182
- "User",
183
- "globalStorage",
184
- "saoudrizwan.claude-dev",
185
- "settings",
186
- "cline_mcp_settings.json"
187
- );
188
- }
189
- return path.join(
190
- homeDir,
191
- ".config",
192
- "Code",
193
- "User",
194
- "globalStorage",
195
- "saoudrizwan.claude-dev",
196
- "settings",
197
- "cline_mcp_settings.json"
198
- );
199
- }
200
-
201
- function getCodexPath(platformValue, homeDir, userProfileDir) {
202
- if (platformValue === "win32") {
203
- return path.join(userProfileDir, ".codex", "config.toml");
204
- }
205
- return path.join(homeDir, ".codex", "config.toml");
206
- }
207
-
208
- function getClaudePath(platformValue, homeDir, appDataDir, overridePath) {
209
- if (overridePath) {
210
- return overridePath;
211
- }
212
- if (platformValue === "darwin") {
213
- return path.join(
214
- homeDir,
215
- "Library",
216
- "Application Support",
217
- "Claude",
218
- "claude_desktop_config.json"
219
- );
220
- }
221
- if (platformValue === "win32") {
222
- return path.join(appDataDir, "Claude", "claude_desktop_config.json");
223
- }
224
- return path.join(homeDir, ".claude.json");
225
- }
226
-
227
- function getGoosePath(platformValue, homeDir, appDataDir) {
228
- if (platformValue === "win32") {
229
- return path.join(appDataDir, "Block", "goose", "config", "config.yaml");
230
- }
231
- return path.join(homeDir, ".config", "goose", "config.yaml");
232
- }
233
-
234
- function getCursorPath(_platformValue, homeDir, userProfileDir) {
235
- const base = _platformValue === "win32" ? userProfileDir : homeDir;
236
- return path.join(base, ".cursor", "mcp.json");
237
- }
238
-
239
- function getWindsurfPath(platformValue, homeDir, userProfileDir) {
240
- if (platformValue === "win32") {
241
- return path.join(userProfileDir, ".codeium", "windsurf", "mcp_config.json");
242
- }
243
- return path.join(homeDir, ".codeium", "windsurf", "mcp_config.json");
244
- }
245
-
246
- function getDefaultDisabled(clientType) {
247
- return ["cline", "codex", "windsurf", "goose"].includes(clientType);
248
- }
249
-
250
- function writeJsonConfig(filePath, serverName, argsArray, clientType) {
251
- ensureDir(filePath);
252
- const data = readJson(filePath);
253
- data.mcpServers = data.mcpServers || {};
254
- if (options.toggle && clientType === "cursor") {
255
- fail("Cursor does not support enable/disable. Use --remove instead.");
256
- }
257
- if (options.toggle) {
258
- if (!data.mcpServers[serverName]) {
259
- fail(`Server "${serverName}" not found in ${filePath}.`);
260
- }
261
- data.mcpServers[serverName] = {
262
- ...data.mcpServers[serverName],
263
- disabled: options.disabled || undefined,
264
- };
265
- writeFile(filePath, JSON.stringify(data, null, 2));
266
- return;
267
- }
268
- if (options.remove) {
269
- if (!data.mcpServers[serverName]) {
270
- fail(`Server "${serverName}" not found in ${filePath}.`);
271
- }
272
- delete data.mcpServers[serverName];
273
- writeFile(filePath, JSON.stringify(data, null, 2));
274
- return;
275
- }
276
- if (data.mcpServers[serverName] && !options.force) {
277
- fail(
278
- `Server "${serverName}" already exists in ${filePath}. Use --force to overwrite.`
279
- );
280
- }
281
- data.mcpServers[serverName] = {
282
- command: options.command,
283
- args: argsArray,
284
- disabled:
285
- options.disabled || (getDefaultDisabled(clientType) ? true : undefined),
286
- };
287
- writeFile(filePath, JSON.stringify(data, null, 2));
288
- }
289
-
290
- function writeClaudeConfig(filePath, serverName, argsArray) {
291
- ensureDir(filePath);
292
- const data = readJson(filePath);
293
- if (!options.project) {
294
- options.project = process.cwd();
295
- }
296
- data.projects = data.projects || {};
297
- if (!data.projects[options.project]) {
298
- data.projects[options.project] = {
299
- allowedTools: [],
300
- mcpContextUris: [],
301
- mcpServers: {},
302
- };
303
- }
304
- data.projects[options.project].mcpServers =
305
- data.projects[options.project].mcpServers || {};
306
- if (options.toggle) {
307
- fail("Claude does not support enable/disable. Use --remove instead.");
308
- }
309
- if (options.remove) {
310
- if (!data.projects[options.project].mcpServers[serverName]) {
311
- fail(`Server "${serverName}" not found for ${options.project}.`);
312
- }
313
- delete data.projects[options.project].mcpServers[serverName];
314
- writeFile(filePath, JSON.stringify(data, null, 2));
315
- return;
316
- }
317
- if (data.projects[options.project].mcpServers[serverName] && !options.force) {
318
- fail(
319
- `Server "${serverName}" already exists for ${options.project}. Use --force to overwrite.`
320
- );
321
- }
322
- data.projects[options.project].mcpServers[serverName] = {
323
- type: "stdio",
324
- command: options.command,
325
- args: argsArray,
326
- env: {},
327
- };
328
- writeFile(filePath, JSON.stringify(data, null, 2));
329
- }
330
-
331
- function writeCodexConfig(filePath, serverName, argsArray) {
332
- ensureDir(filePath);
333
- if (!toml) {
334
- fail("TOML dependency not available. Install dependencies and retry.");
335
- }
336
-
337
- const data = readToml(filePath);
338
- data.mcp_servers = data.mcp_servers || {};
339
- const defaultEnabled = !getDefaultDisabled("codex");
340
-
341
- if (options.remove) {
342
- if (!data.mcp_servers[serverName]) {
343
- fail(`Server "${serverName}" not found in ${filePath}.`);
344
- }
345
- delete data.mcp_servers[serverName];
346
- writeFile(filePath, toml.stringify(data));
347
- return;
348
- }
349
-
350
- if (options.toggle) {
351
- if (!data.mcp_servers[serverName]) {
352
- fail(`Server "${serverName}" not found in ${filePath}.`);
353
- }
354
- data.mcp_servers[serverName] = {
355
- ...data.mcp_servers[serverName],
356
- enabled: !options.disabled,
357
- };
358
- writeFile(filePath, toml.stringify(data));
359
- return;
360
- }
361
-
362
- if (data.mcp_servers[serverName] && !options.force) {
363
- fail(
364
- `Server "${serverName}" already exists in ${filePath}. Use --force to overwrite.`
365
- );
366
- }
367
-
368
- data.mcp_servers[serverName] = {
369
- command: options.command,
370
- args: argsArray,
371
- enabled: options.disabled ? false : defaultEnabled,
372
- };
373
-
374
- writeFile(filePath, toml.stringify(data));
375
- }
376
-
377
- function writeGooseConfig(filePath, serverName, argsArray) {
378
- if (!yaml) {
379
- fail("YAML dependency not available. Install dependencies and retry.");
380
- }
381
- ensureDir(filePath);
382
- const data = readYaml(filePath);
383
- data.extensions = data.extensions || {};
384
- if (options.toggle) {
385
- if (!data.extensions[serverName]) {
386
- fail(`Server "${serverName}" not found in ${filePath}.`);
387
- }
388
- data.extensions[serverName] = {
389
- ...data.extensions[serverName],
390
- enabled: !options.disabled,
391
- };
392
- writeFile(filePath, yaml.stringify(data));
393
- return;
394
- }
395
- if (options.remove) {
396
- if (!data.extensions[serverName]) {
397
- fail(`Server "${serverName}" not found in ${filePath}.`);
398
- }
399
- delete data.extensions[serverName];
400
- writeFile(filePath, yaml.stringify(data));
401
- return;
402
- }
403
- if (data.extensions[serverName] && !options.force) {
404
- fail(
405
- `Server "${serverName}" already exists in ${filePath}. Use --force to overwrite.`
406
- );
407
- }
408
- data.extensions[serverName] = {
409
- name: "MCP ABAP ADT",
410
- cmd: options.command,
411
- args: argsArray,
412
- type: "stdio",
413
- enabled: options.disabled ? false : !getDefaultDisabled("goose"),
414
- timeout: 300,
415
- };
416
- writeFile(filePath, yaml.stringify(data));
417
- }
418
-
419
- function readJson(filePath) {
420
- if (!fs.existsSync(filePath)) {
421
- return {};
422
- }
423
- const raw = fs.readFileSync(filePath, "utf8").trim();
424
- if (!raw) {
425
- return {};
426
- }
427
- try {
428
- return JSON.parse(raw);
429
- } catch {
430
- fail(`Invalid JSON: ${filePath}`);
431
- }
432
- }
433
-
434
- function readYaml(filePath) {
435
- if (!fs.existsSync(filePath)) {
436
- return {};
437
- }
438
- const raw = fs.readFileSync(filePath, "utf8").trim();
439
- if (!raw) {
440
- return {};
441
- }
442
- try {
443
- return yaml.parse(raw) || {};
444
- } catch {
445
- fail(`Invalid YAML: ${filePath}`);
446
- }
447
- }
448
-
449
- function readToml(filePath) {
450
- if (!fs.existsSync(filePath)) {
451
- return {};
452
- }
453
- const raw = fs.readFileSync(filePath, "utf8").trim();
454
- if (!raw) {
455
- return {};
456
- }
457
- try {
458
- return toml.parse(raw) || {};
459
- } catch {
460
- fail(`Invalid TOML: ${filePath}`);
461
- }
462
- }
463
-
464
- function ensureDir(filePath) {
465
- const dir = path.dirname(filePath);
466
- if (!fs.existsSync(dir)) {
467
- fs.mkdirSync(dir, { recursive: true });
468
- }
469
- }
470
-
471
- function writeFile(filePath, content) {
472
- if (options.dryRun) {
473
- process.stdout.write(`\n# ${filePath}\n${content}\n`);
474
- return;
475
- }
476
- fs.writeFileSync(filePath, content, "utf8");
477
- process.stdout.write(`Updated ${filePath}\n`);
478
- }
479
-
480
- function escapeRegex(value) {
481
- return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
482
- }
483
-
484
- function fail(message) {
485
- process.stderr.write(`${message}\n`);
486
- process.exit(1);
487
- }
488
-
489
- function printHelp() {
490
- process.stdout.write(`mcp-abap-adt-configure
491
-
492
- Usage:
493
- mcp-abap-adt-configure --client <name> --name <serverName> [--env <path> | --mcp <dest>] [options]
494
-
495
- Options:
496
- --client <name> cline | codex | claude | goose | cursor | windsurf (repeatable)
497
- --name <serverName> required MCP server name key
498
- --env <path> .env path (add/update only)
499
- --mcp <dest> destination name (add/update only)
500
- --transport <type> only stdio supported
501
- --command <bin> command to run (default: mcp-abap-adt)
502
- --project <path> Claude project path (defaults to cwd)
503
- --config <path> override client config path (Claude Linux)
504
- --disable disable entry (Codex/Cline/Windsurf/Goose only)
505
- --enable enable entry (Codex/Cline/Windsurf/Goose only)
506
- --remove remove entry
507
- --force overwrite existing entry (add/update)
508
- --dry-run print changes without writing files
509
- -h, --help show this help
510
-
511
- Notes:
512
- New entries for Cline/Codex/Windsurf/Goose are added disabled by default.
513
- `);
514
- }
@@ -1,91 +0,0 @@
1
- # Client Auto-Configure
2
-
3
- This helper writes MCP configuration entries for popular clients.
4
-
5
- ## Install
6
-
7
- ```bash
8
- npm install -g @mcp-abap-adt/core
9
- ```
10
-
11
- ## Usage
12
-
13
- ```bash
14
- mcp-abap-adt-configure --client cline --env /path/to/.env --name abap
15
- mcp-abap-adt-configure --client cline --mcp TRIAL --name abap
16
- mcp-abap-adt-configure --client cline --env /path/to/.env --name abap --transport stdio
17
- mcp-abap-adt-configure --client claude --mcp TRIAL --name abap --project /home/user/prj/myproj
18
- mcp-abap-adt-configure --client codex --name abap --remove
19
- ```
20
-
21
- ## Common Tasks
22
-
23
- Add MCP:
24
- ```bash
25
- mcp-abap-adt-configure --client codex --mcp TRIAL --name abap
26
- mcp-abap-adt-configure --client cline --env /path/to/.env --name abap
27
- mcp-abap-adt-configure --client claude --mcp TRIAL --name abap --project /home/user/prj/myproj
28
- ```
29
-
30
- Disable MCP:
31
- ```bash
32
- mcp-abap-adt-configure --client codex --name abap --disable
33
- mcp-abap-adt-configure --client cline --name abap --disable
34
- ```
35
-
36
- Enable MCP:
37
- ```bash
38
- mcp-abap-adt-configure --client codex --name abap --enable
39
- mcp-abap-adt-configure --client cline --name abap --enable
40
- ```
41
-
42
- Remove MCP:
43
- ```bash
44
- mcp-abap-adt-configure --client codex --name abap --remove
45
- mcp-abap-adt-configure --client cline --name abap --remove
46
- mcp-abap-adt-configure --client claude --name abap --project /home/user/prj/myproj --remove
47
- ```
48
-
49
- Options:
50
- - `--client <name>` (repeatable): `cline`, `codex`, `claude`, `goose`, `cursor`, `windsurf`
51
- - `--env <path>`: use a specific `.env` file
52
- - `--mcp <destination>`: use service key destination
53
- - `--name <serverName>`: MCP server name (required)
54
- - `--transport <type>`: transport type (only `stdio` supported)
55
- - `--command <bin>`: command to run (default: `mcp-abap-adt`)
56
- - `--project <path>`: project path for Claude Desktop (defaults to current directory)
57
- - `--config <path>`: override client config path (optional for Claude on Linux; default: `~/.claude.json`)
58
- - `--disable`: disable server entry (Codex: `enabled = false`, Cline: `disabled = true`)
59
- - `--enable`: enable server entry (Codex: `enabled = true`, Cline: `disabled = false`)
60
- - `--remove`: remove server entry from client config
61
-
62
- Notes:
63
- - `--disable` and `--remove` do not require `--env` or `--mcp`.
64
- - Cursor ignores enable/disable via `mcp.json`; use `--remove` instead.
65
- - New entries for Cline, Codex, Windsurf, and Goose are added **disabled by default**. Use `--enable` to turn them on.
66
- - `--enable`/`--disable` only work if the server entry already exists. Use add commands with `--env` or `--mcp` first.
67
- - `--dry-run`: print changes without writing files
68
- - `--force`: overwrite existing server entry if it exists
69
-
70
- ## Config Locations
71
-
72
- Paths are client-specific and OS-dependent. The installer writes config files in:
73
-
74
- - **Cline**:
75
- - Linux/macOS: `~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json`
76
- - Windows: `%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json`
77
- - **Codex**:
78
- - Linux/macOS: `~/.codex/config.toml`
79
- - Windows: `%USERPROFILE%\.codex\config.toml`
80
- - **Claude Desktop**:
81
- - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
82
- - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
83
- - **Goose**:
84
- - Linux/macOS: `~/.config/goose/config.yaml`
85
- - Windows: `%APPDATA%\Block\goose\config\config.yaml`
86
- - **Cursor**:
87
- - Linux/macOS: `~/.cursor/mcp.json`
88
- - Windows: `%USERPROFILE%\.cursor\mcp.json`
89
- - **Windsurf**:
90
- - Linux/macOS: `~/.codeium/windsurf/mcp_config.json`
91
- - Windows: `%USERPROFILE%\.codeium\windsurf\mcp_config.json`