@rekog/mcp-nest 1.4.0-beta.2 → 1.4.0
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 +29 -0
- package/coverage/clover.xml +264 -263
- package/coverage/coverage-final.json +18 -18
- package/coverage/lcov-report/index.html +13 -13
- package/coverage/lcov-report/tests/index.html +1 -1
- package/coverage/lcov-report/tests/utils.ts.html +10 -10
- package/coverage/lcov.info +381 -376
- package/dist/controllers/custom-decorator.spec.d.ts +2 -0
- package/dist/controllers/custom-decorator.spec.d.ts.map +1 -0
- package/dist/controllers/custom-decorator.spec.js +34 -0
- package/dist/controllers/custom-decorator.spec.js.map +1 -0
- package/dist/controllers/sse.controller.factory.d.ts +1 -1
- package/dist/controllers/sse.controller.factory.d.ts.map +1 -1
- package/dist/controllers/sse.controller.factory.js +5 -2
- package/dist/controllers/sse.controller.factory.js.map +1 -1
- package/dist/controllers/streamable-http.controller.factory.d.ts +1 -1
- package/dist/controllers/streamable-http.controller.factory.d.ts.map +1 -1
- package/dist/controllers/streamable-http.controller.factory.js +2 -1
- package/dist/controllers/streamable-http.controller.factory.js.map +1 -1
- package/dist/interfaces/mcp-options.interface.d.ts +1 -0
- package/dist/interfaces/mcp-options.interface.d.ts.map +1 -1
- package/dist/mcp.module.d.ts.map +1 -1
- package/dist/mcp.module.js +3 -2
- package/dist/mcp.module.js.map +1 -1
- package/package.json +6 -8
- package/tests/mcp.version.e2e.spec.ts +75 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/playground/stateless-http-client.ts +0 -93
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@ A NestJS module to effortlessly expose tools, resources, and prompts for AI, fro
|
|
|
21
21
|
- 💯 Zod-based request validation
|
|
22
22
|
- 📊 Progress notifications
|
|
23
23
|
- 🔒 Guard-based authentication
|
|
24
|
+
- ⏱️ Automatic SSE ping to maintain long connections
|
|
24
25
|
|
|
25
26
|
## Installation
|
|
26
27
|
|
|
@@ -161,3 +162,31 @@ export class AppModule {}
|
|
|
161
162
|
```
|
|
162
163
|
|
|
163
164
|
That's it! The rest is the same as NestJS Guards.
|
|
165
|
+
|
|
166
|
+
## SSE Ping Service
|
|
167
|
+
|
|
168
|
+
The module includes an SSE ping service that helps maintain long-lived SSE connections by preventing browser/client timeouts. This is especially useful for clients such as IDE's using your MCP server remotely.
|
|
169
|
+
|
|
170
|
+
### Configuration
|
|
171
|
+
|
|
172
|
+
You can configure the SSE ping behavior when importing the module:
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
// app.module.ts
|
|
176
|
+
import { Module } from '@nestjs/common';
|
|
177
|
+
import { McpModule } from '@rekog/mcp-nest';
|
|
178
|
+
|
|
179
|
+
@Module({
|
|
180
|
+
imports: [
|
|
181
|
+
McpModule.forRoot({
|
|
182
|
+
name: 'my-mcp-server',
|
|
183
|
+
version: '1.0.0',
|
|
184
|
+
sse: {
|
|
185
|
+
pingEnabled: true, // Default is true
|
|
186
|
+
pingIntervalMs: 30000, // Default is 30 seconds (30000ms)
|
|
187
|
+
},
|
|
188
|
+
}),
|
|
189
|
+
],
|
|
190
|
+
})
|
|
191
|
+
export class AppModule {}
|
|
192
|
+
```
|