@mcp-abap-adt/core 2.0.0 → 2.0.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 +12 -0
- package/README.md +14 -6
- package/dist/handlers/system/readonly/handleGetWhereUsed.d.ts +12 -7
- package/dist/handlers/system/readonly/handleGetWhereUsed.d.ts.map +1 -1
- package/dist/handlers/system/readonly/handleGetWhereUsed.js +20 -31
- package/dist/handlers/system/readonly/handleGetWhereUsed.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [2.0.2] - 2025-12-30
|
|
6
|
+
### Changed
|
|
7
|
+
- **GetWhereUsed handler**: Now uses `getWhereUsedList()` from adt-clients and returns parsed JSON with structured references instead of raw XML
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- **Release workflow**: Simplified to use npm registry instead of uploading tgz artifacts
|
|
11
|
+
|
|
12
|
+
## [2.0.1] - 2025-12-30
|
|
13
|
+
### Documentation
|
|
14
|
+
- Added glama.ai badge with security/license/quality grades
|
|
15
|
+
- Updated README example to use `EmbeddableMcpServer` instead of deprecated `HandlerExporter.registerOnServer()`
|
|
16
|
+
|
|
5
17
|
## [2.0.0] - 2025-12-30
|
|
6
18
|
### Added
|
|
7
19
|
- **EmbeddableMcpServer**: New server class for external integration (e.g., cloud-llm-hub)
|
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# mcp-abap-adt: Your Gateway to ABAP Development Tools (ADT)
|
|
2
2
|
|
|
3
|
+
<a href="https://glama.ai/mcp/servers/@fr0ster/mcp-abap-adt">
|
|
4
|
+
<img width="380" height="200" src="https://glama.ai/mcp/servers/@fr0ster/mcp-abap-adt/badge" />
|
|
5
|
+
</a>
|
|
6
|
+
|
|
3
7
|
> **Acknowledgment**: This project was originally inspired by [mario-andreschak/mcp-abap-adt](https://github.com/mario-andreschak/mcp-abap-adt). We started with the core concept and then evolved it into an independent project with our own architecture and features.
|
|
4
8
|
|
|
5
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.
|
|
@@ -16,13 +20,17 @@ mcp-abap-adt --transport=http # HTTP mode
|
|
|
16
20
|
mcp-abap-adt --transport=sse # SSE mode
|
|
17
21
|
```
|
|
18
22
|
|
|
19
|
-
### 2.
|
|
20
|
-
|
|
23
|
+
### 2. Embeddable Server (For Integration)
|
|
24
|
+
Embed MCP server into existing applications (e.g., SAP CAP/CDS, Express):
|
|
21
25
|
```typescript
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
+
import { EmbeddableMcpServer } from '@mcp-abap-adt/core/server';
|
|
27
|
+
|
|
28
|
+
const server = new EmbeddableMcpServer({
|
|
29
|
+
connection, // Your AbapConnection instance
|
|
30
|
+
logger, // Optional logger
|
|
31
|
+
exposition: ['readonly', 'high'], // Handler groups to expose
|
|
32
|
+
});
|
|
33
|
+
await server.connect(transport);
|
|
26
34
|
```
|
|
27
35
|
|
|
28
36
|
## Quick Start
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WhereUsed handler using AdtClient utilities
|
|
3
3
|
* Endpoint: /sap/bc/adt/repository/informationsystem/usageReferences
|
|
4
|
-
* Uses
|
|
4
|
+
* Uses getWhereUsedList for parsed results
|
|
5
5
|
*/
|
|
6
6
|
import type { HandlerContext } from '../../../lib/handlers/interfaces';
|
|
7
7
|
export declare const TOOL_DEFINITION: {
|
|
8
8
|
readonly name: "GetWhereUsed";
|
|
9
|
-
readonly description: "[read-only] Retrieve where-used references for ABAP objects via ADT usageReferences.
|
|
9
|
+
readonly description: "[read-only] Retrieve where-used references for ABAP objects via ADT usageReferences. Returns parsed list of referencing objects with their types and packages.";
|
|
10
10
|
readonly inputSchema: {
|
|
11
11
|
readonly type: "object";
|
|
12
12
|
readonly properties: {
|
|
@@ -34,10 +34,7 @@ interface WhereUsedArgs {
|
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* Returns where-used references for ABAP objects using AdtClient utilities.
|
|
37
|
-
*
|
|
38
|
-
* Two-step workflow:
|
|
39
|
-
* 1. Fetch scope configuration (if enable_all_types is true)
|
|
40
|
-
* 2. Execute where-used search with scope
|
|
37
|
+
* Uses getWhereUsedList for parsed structured results.
|
|
41
38
|
*/
|
|
42
39
|
export declare function handleGetWhereUsed(context: HandlerContext, args: WhereUsedArgs): Promise<{
|
|
43
40
|
isError: boolean;
|
|
@@ -48,7 +45,15 @@ export declare function handleGetWhereUsed(context: HandlerContext, args: WhereU
|
|
|
48
45
|
object_type: string;
|
|
49
46
|
enable_all_types: boolean;
|
|
50
47
|
total_references: number;
|
|
51
|
-
|
|
48
|
+
result_description: string;
|
|
49
|
+
references: {
|
|
50
|
+
name: string;
|
|
51
|
+
type: string;
|
|
52
|
+
uri: string;
|
|
53
|
+
package_name: string | undefined;
|
|
54
|
+
responsible: string | undefined;
|
|
55
|
+
usage_information: string | undefined;
|
|
56
|
+
}[];
|
|
52
57
|
};
|
|
53
58
|
}[];
|
|
54
59
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleGetWhereUsed.d.ts","sourceRoot":"","sources":["../../../../src/handlers/system/readonly/handleGetWhereUsed.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAGvE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;CAyBlB,CAAC;AAEX,UAAU,aAAa;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED
|
|
1
|
+
{"version":3,"file":"handleGetWhereUsed.d.ts","sourceRoot":"","sources":["../../../../src/handlers/system/readonly/handleGetWhereUsed.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAGvE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;CAyBlB,CAAC;AAEX,UAAU,aAAa;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEpB"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* WhereUsed handler using AdtClient utilities
|
|
4
4
|
* Endpoint: /sap/bc/adt/repository/informationsystem/usageReferences
|
|
5
|
-
* Uses
|
|
5
|
+
* Uses getWhereUsedList for parsed results
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.TOOL_DEFINITION = void 0;
|
|
@@ -12,7 +12,7 @@ const getObjectsListCache_1 = require("../../../lib/getObjectsListCache");
|
|
|
12
12
|
const utils_1 = require("../../../lib/utils");
|
|
13
13
|
exports.TOOL_DEFINITION = {
|
|
14
14
|
name: 'GetWhereUsed',
|
|
15
|
-
description: '[read-only] Retrieve where-used references for ABAP objects via ADT usageReferences.
|
|
15
|
+
description: '[read-only] Retrieve where-used references for ABAP objects via ADT usageReferences. Returns parsed list of referencing objects with their types and packages.',
|
|
16
16
|
inputSchema: {
|
|
17
17
|
type: 'object',
|
|
18
18
|
properties: {
|
|
@@ -35,10 +35,7 @@ exports.TOOL_DEFINITION = {
|
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
37
|
* Returns where-used references for ABAP objects using AdtClient utilities.
|
|
38
|
-
*
|
|
39
|
-
* Two-step workflow:
|
|
40
|
-
* 1. Fetch scope configuration (if enable_all_types is true)
|
|
41
|
-
* 2. Execute where-used search with scope
|
|
38
|
+
* Uses getWhereUsedList for parsed structured results.
|
|
42
39
|
*/
|
|
43
40
|
async function handleGetWhereUsed(context, args) {
|
|
44
41
|
const { connection, logger } = context;
|
|
@@ -55,36 +52,28 @@ async function handleGetWhereUsed(context, args) {
|
|
|
55
52
|
// Create AdtClient and get utilities
|
|
56
53
|
const client = new adt_clients_1.AdtClient(connection, logger);
|
|
57
54
|
const utils = client.getUtils();
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (typedArgs.enable_all_types === true) {
|
|
61
|
-
logger?.info('Fetching scope with all types enabled (Eclipse "select all" behavior)');
|
|
62
|
-
const scopeResponse = await utils.getWhereUsedScope({
|
|
63
|
-
object_name: typedArgs.object_name,
|
|
64
|
-
object_type: typedArgs.object_type,
|
|
65
|
-
});
|
|
66
|
-
// Modify scope to enable all types
|
|
67
|
-
scopeXml = utils.modifyWhereUsedScope(scopeResponse.data, {
|
|
68
|
-
enableAll: true,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
// Step 2: Execute where-used search
|
|
72
|
-
// If scopeXml is undefined, getWhereUsed will auto-fetch default scope
|
|
73
|
-
const result = await utils.getWhereUsed({
|
|
55
|
+
// Use getWhereUsedList for parsed results
|
|
56
|
+
const result = await utils.getWhereUsedList({
|
|
74
57
|
object_name: typedArgs.object_name,
|
|
75
58
|
object_type: typedArgs.object_type,
|
|
76
|
-
|
|
59
|
+
enableAllTypes: typedArgs.enable_all_types,
|
|
77
60
|
});
|
|
78
|
-
logger?.debug(`Where-used search completed for ${typedArgs.object_type}/${typedArgs.object_name}`);
|
|
79
|
-
//
|
|
80
|
-
const numberOfResults = result.data?.match(/numberOfResults="(\d+)"/)?.[1] || '0';
|
|
81
|
-
// Format response
|
|
61
|
+
logger?.debug(`Where-used search completed for ${typedArgs.object_type}/${typedArgs.object_name}: ${result.totalReferences} references`);
|
|
62
|
+
// Format response with parsed data
|
|
82
63
|
const formattedResponse = {
|
|
83
|
-
object_name:
|
|
84
|
-
object_type:
|
|
64
|
+
object_name: result.objectName,
|
|
65
|
+
object_type: result.objectType,
|
|
85
66
|
enable_all_types: typedArgs.enable_all_types || false,
|
|
86
|
-
total_references:
|
|
87
|
-
|
|
67
|
+
total_references: result.totalReferences,
|
|
68
|
+
result_description: result.resultDescription,
|
|
69
|
+
references: result.references.map((ref) => ({
|
|
70
|
+
name: ref.name,
|
|
71
|
+
type: ref.type,
|
|
72
|
+
uri: ref.uri,
|
|
73
|
+
package_name: ref.packageName,
|
|
74
|
+
responsible: ref.responsible,
|
|
75
|
+
usage_information: ref.usageInformation,
|
|
76
|
+
})),
|
|
88
77
|
};
|
|
89
78
|
const mcpResult = {
|
|
90
79
|
isError: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleGetWhereUsed.js","sourceRoot":"","sources":["../../../../src/handlers/system/readonly/handleGetWhereUsed.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;
|
|
1
|
+
{"version":3,"file":"handleGetWhereUsed.js","sourceRoot":"","sources":["../../../../src/handlers/system/readonly/handleGetWhereUsed.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AA4CH,gDA2EC;AArHD,2DAAsD;AACtD,0EAAoE;AAEpE,8CAAyD;AAE5C,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,cAAc;IACpB,WAAW,EACT,gKAAgK;IAClK,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yBAAyB;aACvC;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,kEAAkE;aACrE;YACD,gBAAgB,EAAE;gBAChB,IAAI,EA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