@nest-mcp/client 0.1.0 → 0.1.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.
Files changed (3) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +74 -0
  3. package/package.json +3 -3
package/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, btwld
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,74 @@
1
+ # @nest-mcp/client
2
+
3
+ NestJS module for connecting to and consuming [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) servers with typed injection, notifications, health checks, and reconnection support.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @nest-mcp/client @modelcontextprotocol/sdk
9
+ npm install @nestjs/common @nestjs/core reflect-metadata rxjs
10
+ ```
11
+
12
+ ## Quick start
13
+
14
+ ```typescript
15
+ // app.module.ts
16
+ import { Module } from '@nestjs/common';
17
+ import { McpClientModule } from '@nest-mcp/client';
18
+ import { McpTransportType } from '@nest-mcp/common';
19
+
20
+ @Module({
21
+ imports: [
22
+ McpClientModule.forRoot({
23
+ connections: [
24
+ {
25
+ name: 'my-server',
26
+ transport: {
27
+ type: McpTransportType.STREAMABLE_HTTP,
28
+ url: 'http://localhost:3000/mcp',
29
+ },
30
+ },
31
+ ],
32
+ }),
33
+ ],
34
+ })
35
+ export class AppModule {}
36
+ ```
37
+
38
+ ```typescript
39
+ // my.service.ts
40
+ import { Injectable } from '@nestjs/common';
41
+ import { InjectMcpClient, McpClient } from '@nest-mcp/client';
42
+
43
+ @Injectable()
44
+ export class MyService {
45
+ constructor(@InjectMcpClient('my-server') private client: McpClient) {}
46
+
47
+ async greet(name: string) {
48
+ return this.client.callTool({ name: 'greet', arguments: { name } });
49
+ }
50
+ }
51
+ ```
52
+
53
+ ## Features
54
+
55
+ - **`@InjectMcpClient(name)`** — inject a named client into any service
56
+ - **`McpClientsService`** — programmatic access to all clients by name
57
+ - **`@OnMcpNotification(method)`** — subscribe to server-sent notifications
58
+ - **`McpClientHealthIndicator`** — health check integration (NestJS Terminus)
59
+ - **Automatic reconnection** with configurable backoff
60
+ - **OAuth** support for authenticated servers
61
+
62
+ ## Transports
63
+
64
+ - Streamable HTTP (`McpTransportType.STREAMABLE_HTTP`)
65
+ - SSE (`McpTransportType.SSE`)
66
+ - STDIO (`McpTransportType.STDIO`)
67
+
68
+ ## Documentation
69
+
70
+ Full documentation: [github.com/btwld/nest-mcp/docs/client](https://github.com/btwld/nest-mcp/blob/main/docs/client/README.md)
71
+
72
+ ## License
73
+
74
+ BSD-3-Clause
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@nest-mcp/client",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "NestJS MCP Client - Connect to and consume MCP servers from NestJS",
5
- "license": "MIT",
5
+ "license": "BSD-3-Clause",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "exports": {
@@ -19,7 +19,7 @@
19
19
  "access": "public"
20
20
  },
21
21
  "dependencies": {
22
- "@nest-mcp/common": "0.1.0"
22
+ "@nest-mcp/common": "0.1.2"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@modelcontextprotocol/sdk": "^1.10.0",