@nest-mcp/client 0.2.7 → 0.2.8

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.
@@ -157,11 +157,8 @@ 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];
160
+ const descriptor = Object.getOwnPropertyDescriptor(prototype, methodName);
161
+ const method = descriptor?.value;
165
162
  if (typeof method !== 'function')
166
163
  continue;
167
164
  // NestJS SetMetadata stores metadata on the descriptor.value (the method
@@ -176,7 +173,7 @@ class McpClientBootstrap {
176
173
  `no client named "${metadata.connectionName}" found, skipping`);
177
174
  continue;
178
175
  }
179
- const boundHandler = instance[methodName].bind(instance);
176
+ const boundHandler = method.bind(instance);
180
177
  client.onNotification(metadata.method, boundHandler);
181
178
  wiredCount++;
182
179
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nest-mcp/client",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
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",