@abapify/adt-mcp 0.0.0 → 0.3.5
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 +620 -1
- package/package.json +56 -3
package/README.md
CHANGED
|
@@ -1,3 +1,622 @@
|
|
|
1
1
|
# @abapify/adt-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MCP (Model Context Protocol) server that exposes SAP ADT operations as structured tools for AI assistants, IDE integrations, and automation pipelines.
|
|
4
|
+
|
|
5
|
+
This package ships **two transports**:
|
|
6
|
+
|
|
7
|
+
| Binary | Transport | State model |
|
|
8
|
+
| -------------- | --------------------------- | --------------------------------------------------------- |
|
|
9
|
+
| `adt-mcp` | stdio (JSON-RPC over pipes) | Stateless — connection-per-call. |
|
|
10
|
+
| `adt-mcp-http` | Streamable HTTP | Session-scoped cached `AdtClient`, locks, and changesets. |
|
|
11
|
+
|
|
12
|
+
See [`docs/deployment/mcp-http.md`](../../docs/deployment/mcp-http.md) for the complete HTTP deployment guide (Docker, Okta, multi-system, troubleshooting). The rest of this README focuses on stdio.
|
|
13
|
+
|
|
14
|
+
## Quick Start (stdio)
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Run via npx (no install required)
|
|
18
|
+
npx @abapify/adt-mcp
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Configure in Claude Desktop
|
|
22
|
+
|
|
23
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or the equivalent path on your OS:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"mcpServers": {
|
|
28
|
+
"adt": {
|
|
29
|
+
"command": "npx",
|
|
30
|
+
"args": ["@abapify/adt-mcp"]
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Configure in VS Code (GitHub Copilot agent mode)
|
|
37
|
+
|
|
38
|
+
Add to `.vscode/mcp.json` in your workspace, or to your user settings under `"mcp"`:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"servers": {
|
|
43
|
+
"adt": {
|
|
44
|
+
"type": "stdio",
|
|
45
|
+
"command": "npx",
|
|
46
|
+
"args": ["@abapify/adt-mcp"]
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Configure in Cursor / Windsurf
|
|
53
|
+
|
|
54
|
+
Add to your MCP server list:
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"mcpServers": {
|
|
59
|
+
"adt": {
|
|
60
|
+
"command": "npx",
|
|
61
|
+
"args": ["@abapify/adt-mcp"]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## HTTP transport (since Wave 1)
|
|
70
|
+
|
|
71
|
+
`adt-mcp-http` is the Streamable HTTP entry-point. It targets shared / remote deployments (Docker, Kubernetes, Kiro, teams).
|
|
72
|
+
|
|
73
|
+
Minimal run:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
bunx nx build adt-mcp
|
|
77
|
+
node packages/adt-mcp/dist/bin/adt-mcp-http.mjs --port 3000 --auth-token "$(openssl rand -hex 32)"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Minimal smoke test:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
TOKEN=<your token>
|
|
84
|
+
curl -sf http://127.0.0.1:3000/healthz
|
|
85
|
+
curl -H "Authorization: Bearer $TOKEN" \
|
|
86
|
+
-H 'Content-Type: application/json' \
|
|
87
|
+
-X POST http://127.0.0.1:3000/mcp \
|
|
88
|
+
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"demo","version":"0"}}}'
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Capture the `Mcp-Session-Id` response header, then call `sap_connect`, the tools you need, and finally `sap_disconnect` — or close the transport to trigger cleanup automatically.
|
|
92
|
+
|
|
93
|
+
**Auth modes:** `none` (dev / loopback), `bearer` (shared secret), `proxy` (trust `x-forwarded-user` from an upstream proxy), `oauth` (OIDC JWT validation against Okta / Entra ID / Cognito). Full flag + env matrix in [`docs/deployment/mcp-http.md`](../../docs/deployment/mcp-http.md#cli-reference).
|
|
94
|
+
|
|
95
|
+
### Session lifecycle tools
|
|
96
|
+
|
|
97
|
+
Only available on the HTTP transport:
|
|
98
|
+
|
|
99
|
+
| Tool | Purpose |
|
|
100
|
+
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
101
|
+
| `sap_connect` | Perform the SAP security-session handshake once per MCP session. Accepts inline credentials or a `systemId` resolved against `SAP_SYSTEMS_JSON` / `SAP_SYSTEMS_FILE`. |
|
|
102
|
+
| `sap_disconnect` | Release locks, DELETE the SAP security session, and drop the cached client. |
|
|
103
|
+
|
|
104
|
+
### Transactional changesets (since Wave 3)
|
|
105
|
+
|
|
106
|
+
Bundle multiple ADT writes into a single atomic unit:
|
|
107
|
+
|
|
108
|
+
| Tool | Purpose |
|
|
109
|
+
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
110
|
+
| `changeset_begin` | Open a transactional unit-of-work bound to the current MCP session (one at a time). |
|
|
111
|
+
| `changeset_add` | Stage an object write — acquires a lock and PUTs the supplied source. Defers activate. |
|
|
112
|
+
| `changeset_commit` | Batch-activate every staged object in a single call, then release all locks. |
|
|
113
|
+
| `changeset_rollback` | Release every held lock and mark the changeset rolled back. Source PUTs are not reverted (SAP has no transactional discard). |
|
|
114
|
+
|
|
115
|
+
See [`docs/deployment/mcp-http.md#transactional-changesets`](../../docs/deployment/mcp-http.md#transactional-changesets) for a worked example.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Connection Parameters
|
|
120
|
+
|
|
121
|
+
Every tool requires these connection parameters (passed per-call, never stored):
|
|
122
|
+
|
|
123
|
+
| Parameter | Type | Required | Description |
|
|
124
|
+
| ---------- | ------ | -------- | -------------------------------------------------------------- |
|
|
125
|
+
| `baseUrl` | string | ✅ | SAP system base URL, e.g. `https://my-system.example.com:8000` |
|
|
126
|
+
| `client` | string | — | SAP client number, e.g. `100` |
|
|
127
|
+
| `username` | string | — | Username for basic auth |
|
|
128
|
+
| `password` | string | — | Password for basic auth |
|
|
129
|
+
|
|
130
|
+
> **Security note:** credentials are forwarded directly to the SAP system per request. The MCP server holds no state and persists no credentials.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Tools Reference
|
|
135
|
+
|
|
136
|
+
### Discovery & System
|
|
137
|
+
|
|
138
|
+
#### `discovery`
|
|
139
|
+
|
|
140
|
+
Discover available ADT services on the SAP system. Useful for checking what endpoints the system supports before using other tools.
|
|
141
|
+
|
|
142
|
+
**Parameters:** connection only
|
|
143
|
+
|
|
144
|
+
**Returns:** JSON object with available service collections and their links.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
#### `system_info`
|
|
149
|
+
|
|
150
|
+
Get SAP system and/or session information.
|
|
151
|
+
|
|
152
|
+
**Parameters:**
|
|
153
|
+
|
|
154
|
+
| Parameter | Type | Default | Description |
|
|
155
|
+
| --------- | ------------------------------------- | -------- | ---------------------------- |
|
|
156
|
+
| `scope` | `"session"` \| `"system"` \| `"both"` | `"both"` | What information to retrieve |
|
|
157
|
+
|
|
158
|
+
**Returns:**
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"session": { "user": "DEVELOPER", "client": "100", "language": "EN", ... },
|
|
163
|
+
"system": { "systemId": "DEV", "release": "757", ... }
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
### Object Repository
|
|
170
|
+
|
|
171
|
+
#### `search_objects`
|
|
172
|
+
|
|
173
|
+
Search for ABAP objects in the repository. Supports wildcards.
|
|
174
|
+
|
|
175
|
+
**Parameters:**
|
|
176
|
+
|
|
177
|
+
| Parameter | Type | Default | Description |
|
|
178
|
+
| ------------ | ------ | ------- | --------------------------------------- |
|
|
179
|
+
| `query` | string | ✅ | Search term, e.g. `ZCL_*` or `MY_CLASS` |
|
|
180
|
+
| `maxResults` | number | `50` | Maximum number of results |
|
|
181
|
+
|
|
182
|
+
**Returns:**
|
|
183
|
+
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"count": 3,
|
|
187
|
+
"objects": [
|
|
188
|
+
{ "name": "ZCL_MY_CLASS", "type": "CLAS/OC", "uri": "/sap/bc/adt/oo/classes/zcl_my_class", ... }
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
#### `get_object`
|
|
196
|
+
|
|
197
|
+
Get details about a specific ABAP object by name. Performs an exact-match search and returns the object metadata plus a list of similar objects if no exact match is found.
|
|
198
|
+
|
|
199
|
+
**Parameters:**
|
|
200
|
+
|
|
201
|
+
| Parameter | Type | Description |
|
|
202
|
+
| ------------ | ------ | --------------------------- |
|
|
203
|
+
| `objectName` | string | ABAP object name to look up |
|
|
204
|
+
|
|
205
|
+
**Returns:**
|
|
206
|
+
|
|
207
|
+
```json
|
|
208
|
+
{ "found": true, "object": { "name": "ZCL_MY_CLASS", "type": "CLAS/OC", "uri": "...", ... } }
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
or, when not found:
|
|
212
|
+
|
|
213
|
+
```json
|
|
214
|
+
{ "found": false, "message": "Object 'FOO' not found", "similar": [...] }
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
### Source Code
|
|
220
|
+
|
|
221
|
+
#### `get_source`
|
|
222
|
+
|
|
223
|
+
Fetch the raw ABAP source code for a program, class, interface, or function group.
|
|
224
|
+
|
|
225
|
+
**Parameters:**
|
|
226
|
+
|
|
227
|
+
| Parameter | Type | Description |
|
|
228
|
+
| ------------ | ------- | ---------------------------------------------------------------------------------------- |
|
|
229
|
+
| `objectName` | string | ABAP object name |
|
|
230
|
+
| `objectType` | string? | Object type hint (`PROG`, `CLAS`, `INTF`, …). Skips the search round-trip when provided. |
|
|
231
|
+
|
|
232
|
+
**Returns:** Plain ABAP source text.
|
|
233
|
+
|
|
234
|
+
**Tip:** Always pass `objectType` when you already know it — it saves one network round-trip.
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
#### `update_source`
|
|
239
|
+
|
|
240
|
+
Write new ABAP source code to an existing object. Internally performs the full SAP ADT lock→PUT→unlock cycle.
|
|
241
|
+
|
|
242
|
+
**Parameters:**
|
|
243
|
+
|
|
244
|
+
| Parameter | Type | Description |
|
|
245
|
+
| ------------ | ------- | ------------------------------------------------------------- |
|
|
246
|
+
| `objectName` | string | ABAP object name |
|
|
247
|
+
| `objectType` | string? | Object type hint |
|
|
248
|
+
| `sourceCode` | string | New ABAP source code |
|
|
249
|
+
| `transport` | string? | Transport request number (required for transportable objects) |
|
|
250
|
+
|
|
251
|
+
**Returns:**
|
|
252
|
+
|
|
253
|
+
```json
|
|
254
|
+
{ "status": "updated", "object": "ZCL_MY_CLASS" }
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
> ⚠️ **Always activate after updating** — inactive source is not compiled and cannot be executed.
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
#### `get_test_classes`
|
|
262
|
+
|
|
263
|
+
Retrieve the test class definitions (`FOR TESTING`) embedded in an ABAP class. Returns the raw source of the testclasses include.
|
|
264
|
+
|
|
265
|
+
**Parameters:**
|
|
266
|
+
|
|
267
|
+
| Parameter | Type | Description |
|
|
268
|
+
| ----------- | ------ | ------------------------------------ |
|
|
269
|
+
| `className` | string | ABAP class name, e.g. `ZCL_MY_CLASS` |
|
|
270
|
+
|
|
271
|
+
**Returns:** Plain ABAP source of the local test class include.
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
### Activation & Syntax
|
|
276
|
+
|
|
277
|
+
#### `activate_object`
|
|
278
|
+
|
|
279
|
+
Activate one or more ABAP objects. Supports single-object and batch modes.
|
|
280
|
+
|
|
281
|
+
**Single object mode:**
|
|
282
|
+
|
|
283
|
+
| Parameter | Type | Description |
|
|
284
|
+
| ------------ | ------ | --------------------------------------- |
|
|
285
|
+
| `objectName` | string | ABAP object name |
|
|
286
|
+
| `objectType` | string | Object type (`PROG`, `CLAS`, `INTF`, …) |
|
|
287
|
+
|
|
288
|
+
**Batch mode:**
|
|
289
|
+
|
|
290
|
+
| Parameter | Type | Description |
|
|
291
|
+
| --------- | --------------------------------- | ---------------------------------- |
|
|
292
|
+
| `objects` | `Array<{objectName, objectType}>` | Objects to activate in one request |
|
|
293
|
+
|
|
294
|
+
**Returns:**
|
|
295
|
+
|
|
296
|
+
```json
|
|
297
|
+
{ "status": "activated", "count": 2, "objects": [{ "name": "ZCL_FOO", "type": "CLAS" }, ...] }
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
#### `check_syntax`
|
|
303
|
+
|
|
304
|
+
Run an ABAP syntax check on an object and return structured check messages. Uses the `checkrun` schema — no XML parsing in tool code.
|
|
305
|
+
|
|
306
|
+
**Parameters:**
|
|
307
|
+
|
|
308
|
+
| Parameter | Type | Default | Description |
|
|
309
|
+
| ------------ | ------------------------------------- | ---------- | -------------------------------------- |
|
|
310
|
+
| `objectName` | string | ✅ | ABAP object name |
|
|
311
|
+
| `objectType` | string? | — | Object type hint for faster resolution |
|
|
312
|
+
| `version` | `"active"` \| `"inactive"` \| `"new"` | `"active"` | Version to check |
|
|
313
|
+
|
|
314
|
+
**Returns:**
|
|
315
|
+
|
|
316
|
+
```json
|
|
317
|
+
{
|
|
318
|
+
"hasErrors": false,
|
|
319
|
+
"hasWarnings": true,
|
|
320
|
+
"reports": [
|
|
321
|
+
{
|
|
322
|
+
"reporter": "syntax",
|
|
323
|
+
"triggeringUri": "/sap/bc/adt/oo/classes/zcl_foo",
|
|
324
|
+
"checkMessageList": {
|
|
325
|
+
"checkMessage": [{ "type": "W", "shortText": "Variable X is unused", ... }]
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
]
|
|
329
|
+
}
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
### Unit Testing
|
|
335
|
+
|
|
336
|
+
#### `run_unit_tests`
|
|
337
|
+
|
|
338
|
+
Run ABAP Unit tests on an object or package and receive pass/fail counts broken down by test method.
|
|
339
|
+
|
|
340
|
+
**Parameters:**
|
|
341
|
+
|
|
342
|
+
| Parameter | Type | Default | Description |
|
|
343
|
+
| -------------- | ------- | ------- | ---------------------------------------- |
|
|
344
|
+
| `objectName` | string | ✅ | Object name (class, program, or package) |
|
|
345
|
+
| `objectType` | string? | — | Type hint (`CLAS`, `PROG`, `DEVC`, …) |
|
|
346
|
+
| `withCoverage` | boolean | `false` | Whether to collect code coverage data |
|
|
347
|
+
|
|
348
|
+
**Returns:**
|
|
349
|
+
|
|
350
|
+
```json
|
|
351
|
+
{
|
|
352
|
+
"totalTests": 5,
|
|
353
|
+
"passCount": 4,
|
|
354
|
+
"failCount": 1,
|
|
355
|
+
"errorCount": 0,
|
|
356
|
+
"programs": [ ... ]
|
|
357
|
+
}
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
### Package Management
|
|
363
|
+
|
|
364
|
+
#### `list_package_objects`
|
|
365
|
+
|
|
366
|
+
List ABAP objects contained in a package. Uses `quickSearch` with a `packageName` filter.
|
|
367
|
+
|
|
368
|
+
**Parameters:**
|
|
369
|
+
|
|
370
|
+
| Parameter | Type | Default | Description |
|
|
371
|
+
| ------------- | ------- | ------- | ---------------------------------- |
|
|
372
|
+
| `packageName` | string | ✅ | Package name, e.g. `ZPACKAGE` |
|
|
373
|
+
| `objectType` | string? | — | Filter by type (`CLAS`, `PROG`, …) |
|
|
374
|
+
| `maxResults` | number | `200` | Maximum result count |
|
|
375
|
+
|
|
376
|
+
**Returns:**
|
|
377
|
+
|
|
378
|
+
```json
|
|
379
|
+
{
|
|
380
|
+
"packageName": "ZPACKAGE",
|
|
381
|
+
"count": 12,
|
|
382
|
+
"objects": [{ "name": "ZCL_FOO", "type": "CLAS/OC", ... }]
|
|
383
|
+
}
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
### Change & Transport System (CTS)
|
|
389
|
+
|
|
390
|
+
#### `cts_list_transports`
|
|
391
|
+
|
|
392
|
+
List transport requests from the CTS.
|
|
393
|
+
|
|
394
|
+
**Parameters:**
|
|
395
|
+
|
|
396
|
+
| Parameter | Type | Default |
|
|
397
|
+
| ------------ | ------ | ------- |
|
|
398
|
+
| `maxResults` | number | `50` |
|
|
399
|
+
|
|
400
|
+
**Returns:** Array of transport request descriptors.
|
|
401
|
+
|
|
402
|
+
---
|
|
403
|
+
|
|
404
|
+
#### `cts_get_transport`
|
|
405
|
+
|
|
406
|
+
Get details for a specific transport request.
|
|
407
|
+
|
|
408
|
+
**Parameters:**
|
|
409
|
+
|
|
410
|
+
| Parameter | Type | Description |
|
|
411
|
+
| ------------- | ------ | ----------------------------------- |
|
|
412
|
+
| `transportId` | string | Transport number, e.g. `DEVK900001` |
|
|
413
|
+
|
|
414
|
+
**Returns:** Full transport descriptor including tasks and objects.
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
#### `cts_create_transport`
|
|
419
|
+
|
|
420
|
+
Create a new transport request.
|
|
421
|
+
|
|
422
|
+
**Parameters:**
|
|
423
|
+
|
|
424
|
+
| Parameter | Type | Default | Description |
|
|
425
|
+
| ------------- | -------------- | ------- | ------------------------------------ |
|
|
426
|
+
| `description` | string | ✅ | Transport description |
|
|
427
|
+
| `type` | `"K"` \| `"W"` | `"K"` | Workbench (`K`) or Customizing (`W`) |
|
|
428
|
+
|
|
429
|
+
> 🚧 Not yet implemented — returns a clear error until the underlying client method is available.
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
#### `cts_release_transport`
|
|
434
|
+
|
|
435
|
+
Release a transport request.
|
|
436
|
+
|
|
437
|
+
**Parameters:**
|
|
438
|
+
|
|
439
|
+
| Parameter | Type | Description |
|
|
440
|
+
| ------------- | ------ | ---------------- |
|
|
441
|
+
| `transportId` | string | Transport number |
|
|
442
|
+
|
|
443
|
+
> 🚧 Not yet implemented.
|
|
444
|
+
|
|
445
|
+
---
|
|
446
|
+
|
|
447
|
+
#### `cts_delete_transport`
|
|
448
|
+
|
|
449
|
+
Delete a transport request.
|
|
450
|
+
|
|
451
|
+
**Parameters:**
|
|
452
|
+
|
|
453
|
+
| Parameter | Type | Description |
|
|
454
|
+
| ------------- | ------ | ---------------- |
|
|
455
|
+
| `transportId` | string | Transport number |
|
|
456
|
+
|
|
457
|
+
---
|
|
458
|
+
|
|
459
|
+
### ABAP Test Cockpit (ATC)
|
|
460
|
+
|
|
461
|
+
#### `atc_run`
|
|
462
|
+
|
|
463
|
+
Run ABAP Test Cockpit checks on an object or package and return the resulting findings worklist.
|
|
464
|
+
|
|
465
|
+
**Parameters:**
|
|
466
|
+
|
|
467
|
+
| Parameter | Type | Description |
|
|
468
|
+
| ----------- | ------ | ----------------------------------------------------------- |
|
|
469
|
+
| `objectUri` | string | ADT URI of the target, e.g. `/sap/bc/adt/packages/ZPACKAGE` |
|
|
470
|
+
|
|
471
|
+
**Returns:**
|
|
472
|
+
|
|
473
|
+
```json
|
|
474
|
+
{ "status": "completed", "worklist": { ... } }
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
---
|
|
478
|
+
|
|
479
|
+
## Common Workflows
|
|
480
|
+
|
|
481
|
+
### Read → Edit → Save → Activate
|
|
482
|
+
|
|
483
|
+
```
|
|
484
|
+
1. get_source objectName=ZCL_FOO objectType=CLAS
|
|
485
|
+
2. update_source objectName=ZCL_FOO objectType=CLAS sourceCode="..." transport=DEVK900001
|
|
486
|
+
3. check_syntax objectName=ZCL_FOO objectType=CLAS version=inactive
|
|
487
|
+
4. activate_object objectName=ZCL_FOO objectType=CLAS
|
|
488
|
+
5. run_unit_tests objectName=ZCL_FOO objectType=CLAS
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
### Explore a Package
|
|
492
|
+
|
|
493
|
+
```
|
|
494
|
+
1. list_package_objects packageName=ZPACKAGE
|
|
495
|
+
2. get_object objectName=ZCL_FOO
|
|
496
|
+
3. get_source objectName=ZCL_FOO objectType=CLAS
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
### Quality Gate
|
|
500
|
+
|
|
501
|
+
```
|
|
502
|
+
1. check_syntax objectName=ZCL_FOO objectType=CLAS
|
|
503
|
+
2. atc_run objectUri=/sap/bc/adt/oo/classes/zcl_foo
|
|
504
|
+
3. run_unit_tests objectName=ZCL_FOO objectType=CLAS
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
---
|
|
508
|
+
|
|
509
|
+
## Architecture
|
|
510
|
+
|
|
511
|
+
```
|
|
512
|
+
┌──────────────┐ stdio (JSON-RPC) ┌──────────────────────────────┐
|
|
513
|
+
│ MCP Client │ ◄───────────────────► │ @abapify/adt-mcp │
|
|
514
|
+
│ (AI / IDE) │ │ McpServer (17 tools) │
|
|
515
|
+
└──────────────┘ └──────────────┬───────────────┘
|
|
516
|
+
│ calls
|
|
517
|
+
┌──────────────▼───────────────┐
|
|
518
|
+
│ @abapify/adt-client │
|
|
519
|
+
│ (typed contracts via speci) │
|
|
520
|
+
└──────────────┬───────────────┘
|
|
521
|
+
│ HTTP/HTTPS
|
|
522
|
+
┌──────────────▼───────────────┐
|
|
523
|
+
│ SAP System (ADT REST) │
|
|
524
|
+
└──────────────────────────────┘
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
**Design principles:**
|
|
528
|
+
|
|
529
|
+
- **No logic duplication** – tools delegate to `@abapify/adt-client` services.
|
|
530
|
+
- **Schema-based serialisation** – request/response XML is handled via typed schemas from `@abapify/adt-schemas`. No manual XML building, no third-party XML parser.
|
|
531
|
+
- **Structured JSON** – every tool returns JSON, never raw console output.
|
|
532
|
+
- **Zod validation** – all tool inputs are validated before reaching the SAP system.
|
|
533
|
+
- **Connection-per-call** – each tool call creates its own ADT client; the server is stateless.
|
|
534
|
+
|
|
535
|
+
---
|
|
536
|
+
|
|
537
|
+
## Programmatic Usage
|
|
538
|
+
|
|
539
|
+
```typescript
|
|
540
|
+
import { createMcpServer } from '@abapify/adt-mcp';
|
|
541
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
542
|
+
|
|
543
|
+
const server = createMcpServer();
|
|
544
|
+
const transport = new StdioServerTransport();
|
|
545
|
+
await server.connect(transport);
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
### Custom client factory (e.g. for testing or SSO)
|
|
549
|
+
|
|
550
|
+
```typescript
|
|
551
|
+
import { createMcpServer } from '@abapify/adt-mcp';
|
|
552
|
+
|
|
553
|
+
const server = createMcpServer({
|
|
554
|
+
clientFactory: (params) =>
|
|
555
|
+
createAdtClient({
|
|
556
|
+
baseUrl: params.baseUrl,
|
|
557
|
+
username: params.username ?? '',
|
|
558
|
+
password: params.password ?? '',
|
|
559
|
+
client: params.client,
|
|
560
|
+
}),
|
|
561
|
+
});
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
---
|
|
565
|
+
|
|
566
|
+
## Testing
|
|
567
|
+
|
|
568
|
+
Integration tests use Node.js native test runner (`node:test`) and a built-in mock ADT server that needs no SAP system.
|
|
569
|
+
|
|
570
|
+
```bash
|
|
571
|
+
# Run all integration tests
|
|
572
|
+
cd packages/adt-mcp
|
|
573
|
+
node --test --import tsx tests/integration.test.ts
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
### Using the mock server in your own tests
|
|
577
|
+
|
|
578
|
+
```typescript
|
|
579
|
+
import { createMockAdtServer } from '@abapify/adt-mcp/mock';
|
|
580
|
+
|
|
581
|
+
const mock = createMockAdtServer();
|
|
582
|
+
const { port } = await mock.start();
|
|
583
|
+
// ... test against http://localhost:${port}
|
|
584
|
+
await mock.stop();
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
---
|
|
588
|
+
|
|
589
|
+
## Development
|
|
590
|
+
|
|
591
|
+
```bash
|
|
592
|
+
bunx nx build adt-mcp # build
|
|
593
|
+
bunx nx typecheck adt-mcp # type check
|
|
594
|
+
bunx nx lint adt-mcp # lint
|
|
595
|
+
bunx nx test adt-mcp # tests (runs integration suite)
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
---
|
|
599
|
+
|
|
600
|
+
## Feature Parity Map
|
|
601
|
+
|
|
602
|
+
| CLI Command | MCP Tool | Status |
|
|
603
|
+
| ---------------------- | ----------------------- | ---------- |
|
|
604
|
+
| `adt discovery` | `discovery` | ✅ |
|
|
605
|
+
| `adt info` | `system_info` | ✅ |
|
|
606
|
+
| `adt search` | `search_objects` | ✅ |
|
|
607
|
+
| `adt get` | `get_object` | ✅ |
|
|
608
|
+
| `adt source get` | `get_source` | ✅ |
|
|
609
|
+
| `adt source put` | `update_source` | ✅ |
|
|
610
|
+
| `adt activate` | `activate_object` | ✅ |
|
|
611
|
+
| `adt check` | `check_syntax` | ✅ |
|
|
612
|
+
| `adt aunit run` | `run_unit_tests` | ✅ |
|
|
613
|
+
| `adt atc run` | `atc_run` | ✅ |
|
|
614
|
+
| `adt cts tr list` | `cts_list_transports` | ✅ |
|
|
615
|
+
| `adt cts tr get` | `cts_get_transport` | ✅ |
|
|
616
|
+
| `adt cts tr delete` | `cts_delete_transport` | ✅ |
|
|
617
|
+
| `adt cts tr create` | `cts_create_transport` | 🚧 Not yet |
|
|
618
|
+
| `adt cts tr release` | `cts_release_transport` | 🚧 Not yet |
|
|
619
|
+
| `adt ls` | — | 🔜 Future |
|
|
620
|
+
| `adt cts search` | — | 🔜 Future |
|
|
621
|
+
| `adt import package` | — | 🔜 Future |
|
|
622
|
+
| `adt import transport` | — | 🔜 Future |
|
package/package.json
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abapify/adt-mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
|
|
3
|
+
"version": "0.3.5",
|
|
4
|
+
"description": "MCP server for SAP ADT operations – exposes adt-cli features as MCP tools",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"types": "./dist/index.d.mts",
|
|
11
|
+
"bin": {
|
|
12
|
+
"adt-mcp": "./dist/bin/adt-mcp.mjs",
|
|
13
|
+
"adt-mcp-http": "./dist/bin/adt-mcp-http.mjs"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./dist/index.mjs",
|
|
17
|
+
"./bin/adt-mcp": "./dist/bin/adt-mcp.mjs",
|
|
18
|
+
"./bin/adt-mcp-http": "./dist/bin/adt-mcp-http.mjs",
|
|
19
|
+
"./mock": "./dist/mock.mjs",
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"README.md"
|
|
25
|
+
],
|
|
26
|
+
"keywords": [
|
|
27
|
+
"sap",
|
|
28
|
+
"adt",
|
|
29
|
+
"abap",
|
|
30
|
+
"mcp",
|
|
31
|
+
"model-context-protocol"
|
|
32
|
+
],
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@modelcontextprotocol/sdk": "^1.27.0",
|
|
35
|
+
"@abapify/adt-cli": "0.3.5",
|
|
36
|
+
"@abapify/adt-client": "0.3.5",
|
|
37
|
+
"@abapify/adt-contracts": "0.3.5",
|
|
38
|
+
"@abapify/adt-fixtures": "0.3.5",
|
|
39
|
+
"@abapify/adt-locks": "0.3.5",
|
|
40
|
+
"@abapify/adt-schemas": "0.3.5",
|
|
41
|
+
"@abapify/adk": "0.3.5",
|
|
42
|
+
"@abapify/adt-aunit": "0.3.5",
|
|
43
|
+
"@abapify/adt-plugin-abapgit": "0.3.5",
|
|
44
|
+
"@abapify/adt-rfc": "0.3.5",
|
|
45
|
+
"@xmldom/xmldom": "^0.9.9",
|
|
46
|
+
"jose": "^6.2.1",
|
|
47
|
+
"zod": "^3.24.0"
|
|
48
|
+
},
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git+https://github.com/abapify/adt-cli.git",
|
|
52
|
+
"directory": "packages/adt-mcp"
|
|
53
|
+
},
|
|
54
|
+
"homepage": "https://github.com/abapify/adt-cli/tree/main/packages/adt-mcp#readme",
|
|
55
|
+
"bugs": {
|
|
56
|
+
"url": "https://github.com/abapify/adt-cli/issues"
|
|
57
|
+
}
|
|
58
|
+
}
|