@ama-mcp/core 13.3.0-prerelease.11

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/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ Copyright Amadeus SAS
2
+
3
+ Redistribution and use in source and binary forms, with or without modification,
4
+ are permitted provided that the following conditions are met:
5
+
6
+ 1. Redistributions of source code must retain the above copyright notice, this
7
+ list of conditions and the following disclaimer.
8
+
9
+ 2. Redistributions in binary form must reproduce the above copyright notice,
10
+ this list of conditions and the following disclaimer in the documentation and/or
11
+ other materials provided with the distribution.
12
+
13
+ 3. Neither the name of the copyright holder nor the names of its contributors
14
+ may be used to endorse or promote products derived from this software without
15
+ specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
21
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ <h1 align="center">Otter MCP</h1>
2
+ <p align="center">
3
+ <img src="https://raw.githubusercontent.com/AmadeusITGroup/otter/main/assets/logo/otter.png" alt="Super cute Otter!" width="40%"/>
4
+ </p>
5
+
6
+ <br />
7
+ <br />
8
+
9
+ ## Description
10
+
11
+ This module provides utilities to interact inside an MCP server.
package/package.json ADDED
@@ -0,0 +1,158 @@
1
+ {
2
+ "name": "@ama-mcp/core",
3
+ "version": "13.3.0-prerelease.11",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "description": "This module provides utilities to interact inside an MCP server",
8
+ "keywords": [
9
+ "mcp",
10
+ "otter",
11
+ "otter-module"
12
+ ],
13
+ "module": "src/public_api.js",
14
+ "typings": "src/public_api.d.ts",
15
+ "sideEffects": false,
16
+ "exports": {
17
+ "./package.json": {
18
+ "default": "./package.json"
19
+ },
20
+ ".": {
21
+ "typings": "./src/public_api.d.ts",
22
+ "default": "./src/public_api.js"
23
+ }
24
+ },
25
+ "scripts": {
26
+ "nx": "nx",
27
+ "ng": "yarn nx",
28
+ "build": "yarn nx build ama-mcp-github",
29
+ "compile": "tsc -b ./tsconfig.build.json && yarn cpy package.json dist && patch-package-json-main"
30
+ },
31
+ "peerDependencies": {
32
+ "@modelcontextprotocol/sdk": "^1.19.0"
33
+ },
34
+ "dependencies": {
35
+ "tslib": "^2.6.2"
36
+ },
37
+ "devDependencies": {
38
+ "@angular/common": "~20.3.0",
39
+ "@angular/compiler": "~20.3.0",
40
+ "@angular/compiler-cli": "~20.3.0",
41
+ "@angular/core": "~20.3.0",
42
+ "@angular/platform-browser": "~20.3.0",
43
+ "@angular/platform-browser-dynamic": "~20.3.0",
44
+ "@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
45
+ "@modelcontextprotocol/sdk": "~1.19.0",
46
+ "@nx/eslint": "~21.6.0",
47
+ "@nx/eslint-plugin": "~21.6.0",
48
+ "@nx/jest": "~21.6.0",
49
+ "@nx/js": "~21.6.0",
50
+ "@o3r/build-helpers": "^13.3.0-prerelease.11",
51
+ "@o3r/eslint-config": "^13.3.0-prerelease.11",
52
+ "@o3r/eslint-plugin": "^13.3.0-prerelease.11",
53
+ "@o3r/test-helpers": "^13.3.0-prerelease.11",
54
+ "@stylistic/eslint-plugin": "~5.4.0",
55
+ "@types/jest": "~29.5.2",
56
+ "@types/node": "~22.18.0",
57
+ "@typescript-eslint/parser": "~8.46.0",
58
+ "angular-eslint": "~20.3.0",
59
+ "cpy-cli": "^6.0.0",
60
+ "eslint": "~9.37.0",
61
+ "eslint-import-resolver-node": "~0.3.9",
62
+ "eslint-import-resolver-typescript": "~4.4.0",
63
+ "eslint-plugin-import": "~2.32.0",
64
+ "eslint-plugin-import-newlines": "~1.4.0",
65
+ "eslint-plugin-jest": "~29.0.0",
66
+ "eslint-plugin-jsdoc": "~54.7.0",
67
+ "eslint-plugin-prefer-arrow": "~1.2.3",
68
+ "eslint-plugin-unicorn": "~60.0.0",
69
+ "eslint-plugin-unused-imports": "~4.2.0",
70
+ "globals": "^16.0.0",
71
+ "jest": "~29.7.0",
72
+ "jest-environment-jsdom": "~29.7.0",
73
+ "jest-junit": "~16.0.0",
74
+ "jest-preset-angular": "~14.6.0",
75
+ "jest-util": "~29.7.0",
76
+ "jsonc-eslint-parser": "~2.4.0",
77
+ "nx": "~21.6.0",
78
+ "rxjs": "^7.8.1",
79
+ "ts-jest": "~29.4.0",
80
+ "ts-node": "~10.9.2",
81
+ "type-fest": "^4.30.1",
82
+ "typescript": "~5.9.2",
83
+ "typescript-eslint": "~8.46.0",
84
+ "zone.js": "~0.15.0"
85
+ },
86
+ "engines": {
87
+ "node": "^20.19.0 || ^22.17.0 || ^24.0.0"
88
+ },
89
+ "contributors": [
90
+ {
91
+ "name": "Yannick Adam",
92
+ "url": "https://github.com/yannickadam",
93
+ "email": "yannickadam@users.noreply.github.com"
94
+ },
95
+ {
96
+ "name": "Kilian Panot",
97
+ "url": "https://github.com/kpanot",
98
+ "email": "kpanot@users.noreply.github.com"
99
+ },
100
+ {
101
+ "name": "Jeremy Bourgeois",
102
+ "url": "https://github.com/jbourgeois-1A",
103
+ "email": "jbourgeois-1A@users.noreply.github.com"
104
+ },
105
+ {
106
+ "name": "Pierre Henri Ginoux",
107
+ "url": "https://github.com/pginoux-1A",
108
+ "email": "pginoux-1A@users.noreply.github.com"
109
+ },
110
+ {
111
+ "name": "Mircea Vasile Rednic",
112
+ "url": "https://github.com/mrednic-1A",
113
+ "email": "mrednic-1A@users.noreply.github.com"
114
+ },
115
+ {
116
+ "name": "Stephane Dalle",
117
+ "url": "https://github.com/sdalle-1A",
118
+ "email": "sdalle-1A@users.noreply.github.com"
119
+ },
120
+ {
121
+ "name": "Nicolas Hoffmann",
122
+ "url": "https://github.com/nhoffmann-1A",
123
+ "email": "nhoffmann-1A@users.noreply.github.com"
124
+ },
125
+ {
126
+ "name": "Victor Scaiceanu",
127
+ "url": "https://github.com/vscaiceanu-1a",
128
+ "email": "vscaiceanu-1A@users.noreply.github.com"
129
+ },
130
+ {
131
+ "name": "Florian Paul",
132
+ "url": "https://github.com/fpaul-1A",
133
+ "email": "fpaul-1A@users.noreply.github.com"
134
+ },
135
+ {
136
+ "name": "Corinne Paulve",
137
+ "url": "https://github.com/cpaulve-1A",
138
+ "email": "cpaulve-1A@users.noreply.github.com"
139
+ },
140
+ {
141
+ "name": "Matthieu Crouzet",
142
+ "url": "https://github.com/matthieu-crouzet",
143
+ "email": "matthieu-crouzet@users.noreply.github.com"
144
+ },
145
+ {
146
+ "name": "Salome Do",
147
+ "url": "https://github.com/sdo-1A",
148
+ "email": "sdo-1A@users.noreply.github.com"
149
+ }
150
+ ],
151
+ "bugs": "https://github.com/AmadeusITGroup/otter/issues",
152
+ "repository": {
153
+ "type": "git",
154
+ "url": "git+https://github.com/AmadeusITGroup/otter.git"
155
+ },
156
+ "license": "BSD-3-Clause",
157
+ "homepage": "https://amadeusitgroup.github.io/otter/"
158
+ }
@@ -0,0 +1,18 @@
1
+ type Level = 'error' | 'warn' | 'info' | 'debug';
2
+ /**
3
+ * Logger type for MCP server
4
+ */
5
+ export type Logger = {
6
+ [K in Level]?: (message: string, meta?: any) => any;
7
+ };
8
+ /**
9
+ * Logger for MCP server
10
+ */
11
+ export declare const logger: {
12
+ readonly error: (message: string, meta?: any) => any;
13
+ readonly warn: (message: string, meta?: any) => any;
14
+ readonly info: (message: string, meta?: any) => any;
15
+ readonly debug: (message: string, meta?: any) => any;
16
+ };
17
+ export {};
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/logger/index.ts"],"names":[],"mappings":"AAAA,KAAK,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG;KAMlB,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,GAAG;CACpD,CAAC;AAcF;;GAEG;AACH,eAAO,MAAM,MAAM;8BAlBQ,MAAM,SAAS,GAAG,KAAK,GAAG;6BAA1B,MAAM,SAAS,GAAG,KAAK,GAAG;6BAA1B,MAAM,SAAS,GAAG,KAAK,GAAG;8BAA1B,MAAM,SAAS,GAAG,KAAK,GAAG;CAuB1B,CAAC"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.logger = void 0;
4
+ /**
5
+ * Logging as error as recommended by modelcontextprotocol.io (https://modelcontextprotocol.io/quickstart/server#quick-examples-2)
6
+ * @param level
7
+ */
8
+ const logInStderr = (level) => (message, meta) => process.stderr.write(JSON.stringify({
9
+ level,
10
+ message,
11
+ meta
12
+ }) + '\n');
13
+ /**
14
+ * Logger for MCP server
15
+ */
16
+ exports.logger = {
17
+ error: logInStderr('error'),
18
+ warn: logInStderr('warn'),
19
+ info: logInStderr('info'),
20
+ debug: logInStderr('debug')
21
+ };
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/logger/index.ts"],"names":[],"mappings":";;;AAcA;;;GAGG;AACH,MAAM,WAAW,GAAG,CAAC,KAAY,EAA2B,EAAE,CAAC,CAAC,OAAe,EAAE,IAAU,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAClH,IAAI,CAAC,SAAS,CAAC;IACb,KAAK;IACL,OAAO;IACP,IAAI;CACL,CAAC,GAAG,IAAI,CACV,CAAC;AAEF;;GAEG;AACU,QAAA,MAAM,GAAG;IACpB,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC;IAC3B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC;IACzB,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC;IACzB,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC;CACF,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './logger/index';
2
+ export * from './resource/index';
3
+ export * from './testing/index';
4
+ export * from './tool/index';
5
+ //# sourceMappingURL=public_api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public_api.d.ts","sourceRoot":"","sources":["../../src/public_api.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./logger/index"), exports);
5
+ tslib_1.__exportStar(require("./resource/index"), exports);
6
+ tslib_1.__exportStar(require("./testing/index"), exports);
7
+ tslib_1.__exportStar(require("./tool/index"), exports);
8
+ //# sourceMappingURL=public_api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public_api.js","sourceRoot":"","sources":["../../src/public_api.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,2DAAiC;AACjC,0DAAgC;AAChC,uDAA6B"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * A registry to store resources in memory and retrieve them by their URI.
3
+ * key: resource URI
4
+ * value: resource content
5
+ */
6
+ export declare const resourceRegistry: Map<string, string>;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resource/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,qBAA4B,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resourceRegistry = void 0;
4
+ /**
5
+ * A registry to store resources in memory and retrieve them by their URI.
6
+ * key: resource URI
7
+ * value: resource content
8
+ */
9
+ exports.resourceRegistry = new Map();
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resource/index.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,IAAI,GAAG,EAAkB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
2
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ /**
4
+ * Set up an MCP client and server for testing purposes.
5
+ * DO NOT USE OUTSIDE OF TESTS.
6
+ * @param mcpServer
7
+ */
8
+ export declare const setUpClientAndServerForTesting: (mcpServer: McpServer) => Promise<{
9
+ mcpServer: McpServer;
10
+ client: Client<{
11
+ method: string;
12
+ params?: {
13
+ [x: string]: unknown;
14
+ _meta?: {
15
+ [x: string]: unknown;
16
+ progressToken?: string | number | undefined;
17
+ } | undefined;
18
+ } | undefined;
19
+ }, {
20
+ method: string;
21
+ params?: {
22
+ [x: string]: unknown;
23
+ _meta?: {
24
+ [x: string]: unknown;
25
+ } | undefined;
26
+ } | undefined;
27
+ }, {
28
+ [x: string]: unknown;
29
+ _meta?: {
30
+ [x: string]: unknown;
31
+ } | undefined;
32
+ }>;
33
+ }>;
34
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACP,MAAM,2CAA2C,CAAC;AAInD,OAAO,KAAK,EACV,SAAS,EACV,MAAM,yCAAyC,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,GAAU,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;EAWxE,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setUpClientAndServerForTesting = void 0;
4
+ const index_js_1 = require("@modelcontextprotocol/sdk/client/index.js");
5
+ const inMemory_js_1 = require("@modelcontextprotocol/sdk/inMemory.js");
6
+ /**
7
+ * Set up an MCP client and server for testing purposes.
8
+ * DO NOT USE OUTSIDE OF TESTS.
9
+ * @param mcpServer
10
+ */
11
+ const setUpClientAndServerForTesting = async (mcpServer) => {
12
+ const [clientTransport, serverTransport] = inMemory_js_1.InMemoryTransport.createLinkedPair();
13
+ const client = new index_js_1.Client({
14
+ name: 'test-client',
15
+ version: '1.0.0'
16
+ });
17
+ await Promise.all([
18
+ client.connect(clientTransport),
19
+ mcpServer.server.connect(serverTransport)
20
+ ]);
21
+ return { mcpServer, client };
22
+ };
23
+ exports.setUpClientAndServerForTesting = setUpClientAndServerForTesting;
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/testing/index.ts"],"names":[],"mappings":";;;AAAA,wEAEmD;AACnD,uEAE+C;AAK/C;;;;GAIG;AACI,MAAM,8BAA8B,GAAG,KAAK,EAAE,SAAoB,EAAE,EAAE;IAC3E,MAAM,CAAC,eAAe,EAAE,eAAe,CAAC,GAAG,+BAAiB,CAAC,gBAAgB,EAAE,CAAC;IAChF,MAAM,MAAM,GAAG,IAAI,iBAAM,CAAC;QACxB,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IACH,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;QAC/B,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;KAC1C,CAAC,CAAC;IACH,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AAC/B,CAAC,CAAC;AAXW,QAAA,8BAA8B,kCAWzC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Possible override for tool definition
3
+ */
4
+ export interface ToolDefinition {
5
+ /**
6
+ * Tool name
7
+ */
8
+ toolName?: string;
9
+ /**
10
+ * Tool description
11
+ */
12
+ toolDescription?: string;
13
+ /**
14
+ * Tool title
15
+ */
16
+ toolTitle?: string;
17
+ }
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tool/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tool/index.ts"],"names":[],"mappings":""}