@nest-mcp/client 0.2.4 → 0.2.6
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 +1 -1
- package/dist/mcp-client.module.js +10 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ NestJS module for connecting to and consuming [Model Context Protocol (MCP)](htt
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
npm install @nest-mcp/client @modelcontextprotocol/sdk
|
|
13
|
+
npm install @nest-mcp/client @modelcontextprotocol/sdk zod@^4
|
|
14
14
|
npm install @nestjs/common @nestjs/core reflect-metadata rxjs
|
|
15
15
|
```
|
|
16
16
|
|
|
@@ -157,10 +157,17 @@ class McpClientBootstrap {
|
|
|
157
157
|
const prototype = Object.getPrototypeOf(instance);
|
|
158
158
|
const methodNames = Object.getOwnPropertyNames(prototype).filter((name) => name !== 'constructor');
|
|
159
159
|
for (const methodName of methodNames) {
|
|
160
|
+
// Prototype own-property names can include non-function values
|
|
161
|
+
// (e.g. `Object.prototype.__proto__` on `useValue: {}` providers, or
|
|
162
|
+
// accessor properties on library classes). `Reflect.getMetadata`
|
|
163
|
+
// throws TypeError on non-object targets, so skip non-functions.
|
|
164
|
+
const method = prototype[methodName];
|
|
165
|
+
if (typeof method !== 'function')
|
|
166
|
+
continue;
|
|
160
167
|
// NestJS SetMetadata stores metadata on the descriptor.value (the method
|
|
161
|
-
// function itself), so we read from
|
|
162
|
-
//
|
|
163
|
-
const metadata = Reflect.getMetadata(on_notification_decorator_1.MCP_NOTIFICATION_METADATA,
|
|
168
|
+
// function itself), so we read from the method rather than using the
|
|
169
|
+
// (target, propertyKey) overload.
|
|
170
|
+
const metadata = Reflect.getMetadata(on_notification_decorator_1.MCP_NOTIFICATION_METADATA, method);
|
|
164
171
|
if (!metadata)
|
|
165
172
|
continue;
|
|
166
173
|
const client = this.clients.find((c) => c.name === metadata.connectionName);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nest-mcp/client",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "NestJS MCP Client - Connect to and consume MCP servers from NestJS",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@nest-mcp/common": "0.
|
|
43
|
+
"@nest-mcp/common": "0.2.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@modelcontextprotocol/sdk": "^1.10.0",
|