@nestjs-mcp/server 0.1.0-alpha.10

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 (100) hide show
  1. package/.copilotignore +38 -0
  2. package/.devcontainer/Dockerfile.dev +28 -0
  3. package/.devcontainer/devcontainer.json +56 -0
  4. package/.devcontainer/docker-compose.yml +15 -0
  5. package/.dockerignore +37 -0
  6. package/.prettierrc +4 -0
  7. package/LICENSE +21 -0
  8. package/README.md +540 -0
  9. package/dist/controllers/sse/index.d.ts +2 -0
  10. package/dist/controllers/sse/index.js +19 -0
  11. package/dist/controllers/sse/index.js.map +1 -0
  12. package/dist/controllers/sse/sse.controller.d.ts +10 -0
  13. package/dist/controllers/sse/sse.controller.js +57 -0
  14. package/dist/controllers/sse/sse.controller.js.map +1 -0
  15. package/dist/controllers/sse/sse.service.d.ts +16 -0
  16. package/dist/controllers/sse/sse.service.js +78 -0
  17. package/dist/controllers/sse/sse.service.js.map +1 -0
  18. package/dist/controllers/streamable/index.d.ts +2 -0
  19. package/dist/controllers/streamable/index.js +19 -0
  20. package/dist/controllers/streamable/index.js.map +1 -0
  21. package/dist/controllers/streamable/streamable.controller.d.ts +9 -0
  22. package/dist/controllers/streamable/streamable.controller.js +62 -0
  23. package/dist/controllers/streamable/streamable.controller.js.map +1 -0
  24. package/dist/controllers/streamable/streamable.service.d.ts +24 -0
  25. package/dist/controllers/streamable/streamable.service.js +118 -0
  26. package/dist/controllers/streamable/streamable.service.js.map +1 -0
  27. package/dist/decorators/capabilities.constants.d.ts +4 -0
  28. package/dist/decorators/capabilities.constants.js +8 -0
  29. package/dist/decorators/capabilities.constants.js.map +1 -0
  30. package/dist/decorators/capabilities.decorators.d.ts +8 -0
  31. package/dist/decorators/capabilities.decorators.js +49 -0
  32. package/dist/decorators/capabilities.decorators.js.map +1 -0
  33. package/dist/decorators/index.d.ts +2 -0
  34. package/dist/decorators/index.js +19 -0
  35. package/dist/decorators/index.js.map +1 -0
  36. package/dist/index.d.ts +4 -0
  37. package/dist/index.js +21 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/interceptors/message.interceptor.d.ts +10 -0
  40. package/dist/interceptors/message.interceptor.js +61 -0
  41. package/dist/interceptors/message.interceptor.js.map +1 -0
  42. package/dist/interfaces/capabilities.interface.d.ts +52 -0
  43. package/dist/interfaces/capabilities.interface.js +3 -0
  44. package/dist/interfaces/capabilities.interface.js.map +1 -0
  45. package/dist/interfaces/context.interface.d.ts +6 -0
  46. package/dist/interfaces/context.interface.js +3 -0
  47. package/dist/interfaces/context.interface.js.map +1 -0
  48. package/dist/interfaces/index.d.ts +2 -0
  49. package/dist/interfaces/index.js +19 -0
  50. package/dist/interfaces/index.js.map +1 -0
  51. package/dist/interfaces/mcp-server-options.interface.d.ts +42 -0
  52. package/dist/interfaces/mcp-server-options.interface.js +3 -0
  53. package/dist/interfaces/mcp-server-options.interface.js.map +1 -0
  54. package/dist/interfaces/message.types.d.ts +8 -0
  55. package/dist/interfaces/message.types.js +3 -0
  56. package/dist/interfaces/message.types.js.map +1 -0
  57. package/dist/mcp.module.d.ts +13 -0
  58. package/dist/mcp.module.js +193 -0
  59. package/dist/mcp.module.js.map +1 -0
  60. package/dist/registry/discovery.service.d.ts +16 -0
  61. package/dist/registry/discovery.service.js +85 -0
  62. package/dist/registry/discovery.service.js.map +1 -0
  63. package/dist/registry/index.d.ts +2 -0
  64. package/dist/registry/index.js +19 -0
  65. package/dist/registry/index.js.map +1 -0
  66. package/dist/registry/logger.service.d.ts +16 -0
  67. package/dist/registry/logger.service.js +97 -0
  68. package/dist/registry/logger.service.js.map +1 -0
  69. package/dist/registry/registry.service.d.ts +16 -0
  70. package/dist/registry/registry.service.js +170 -0
  71. package/dist/registry/registry.service.js.map +1 -0
  72. package/dist/services/message.service.d.ts +7 -0
  73. package/dist/services/message.service.js +25 -0
  74. package/dist/services/message.service.js.map +1 -0
  75. package/dist/tsconfig.build.tsbuildinfo +1 -0
  76. package/eslint.config.mjs +40 -0
  77. package/package.json +109 -0
  78. package/src/controllers/sse/index.ts +2 -0
  79. package/src/controllers/sse/sse.controller.ts +25 -0
  80. package/src/controllers/sse/sse.service.ts +90 -0
  81. package/src/controllers/streamable/index.ts +2 -0
  82. package/src/controllers/streamable/streamable.controller.ts +24 -0
  83. package/src/controllers/streamable/streamable.service.ts +169 -0
  84. package/src/decorators/capabilities.constants.ts +7 -0
  85. package/src/decorators/capabilities.decorators.ts +150 -0
  86. package/src/decorators/index.ts +2 -0
  87. package/src/index.ts +11 -0
  88. package/src/interceptors/message.interceptor.ts +70 -0
  89. package/src/interfaces/capabilities.interface.ts +95 -0
  90. package/src/interfaces/context.interface.ts +18 -0
  91. package/src/interfaces/index.ts +2 -0
  92. package/src/interfaces/mcp-server-options.interface.ts +105 -0
  93. package/src/interfaces/message.types.ts +13 -0
  94. package/src/mcp.module.ts +250 -0
  95. package/src/mcp.service.spec.ts +28 -0
  96. package/src/registry/discovery.service.ts +116 -0
  97. package/src/registry/index.ts +2 -0
  98. package/src/registry/logger.service.ts +143 -0
  99. package/src/registry/registry.service.ts +282 -0
  100. package/src/services/message.service.ts +18 -0
package/.copilotignore ADDED
@@ -0,0 +1,38 @@
1
+ # Ignore dependencies and lock files
2
+ node_modules/
3
+ pnpm-lock.yaml
4
+ package-lock.json
5
+ yarn.lock
6
+
7
+ # Ignore environment configuration files
8
+ .env
9
+ .env.*
10
+
11
+ # Ignore build outputs and temporary directories
12
+ dist/
13
+ build/
14
+ out/
15
+ .tmp/
16
+ .cache/
17
+
18
+ # Ignore Docker and container configuration files
19
+ .dockerignore
20
+ Dockerfile*
21
+ .docker/
22
+
23
+ # Ignore IDE and system configuration files
24
+ .vscode/
25
+ .idea/
26
+ *.swp
27
+
28
+ # Ignore log files
29
+ *.log
30
+
31
+ # Ignore test and coverage files
32
+ coverage/
33
+ *.test.*
34
+ *.spec.*
35
+
36
+ # Ignore internal instruction files
37
+ .github/
38
+ copilot-instructions.md
@@ -0,0 +1,28 @@
1
+ FROM node:22.14
2
+
3
+ # Set working directory
4
+ WORKDIR /package
5
+
6
+ # Install required system dependencies
7
+ RUN apt-get update && \
8
+ apt-get install -y --no-install-recommends \
9
+ git \
10
+ curl \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Install PNPM and NestJS CLI
14
+ RUN npm install -g pnpm@10 @nestjs/cli
15
+
16
+ # Copy package files
17
+ COPY package.json pnpm-lock.yaml ./
18
+
19
+ # Install dependencies as root first
20
+ RUN pnpm install
21
+
22
+ # Copy the rest of the application code
23
+ COPY . .
24
+
25
+ EXPOSE 3000 9229 6277
26
+
27
+ # Command to start development server
28
+ CMD ["tail", "-f", "/dev/null"]
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "NestJS MCP Server",
3
+ "dockerComposeFile": "docker-compose.yml",
4
+ "service": "package",
5
+ "workspaceFolder": "/package",
6
+ "remoteUser": "node",
7
+ "features": {
8
+ "ghcr.io/devcontainers/features/git:1": {}
9
+ },
10
+ "customizations": {
11
+ "vscode": {
12
+ "extensions": [
13
+ // TypeScript & NestJS
14
+ "vscode.typescript-language-features",
15
+ "christian-kohler.path-intellisense",
16
+ "yoavbls.pretty-ts-errors",
17
+ "meganrogge.template-string-converter",
18
+
19
+ // ESLint & Prettier
20
+ "dbaeumer.vscode-eslint",
21
+ "esbenp.prettier-vscode",
22
+
23
+ // Testing
24
+ "orta.vscode-jest",
25
+ "firsttris.vscode-jest-runner",
26
+
27
+ // Docker
28
+ "ms-azuretools.vscode-docker",
29
+
30
+ // Database
31
+ "mtxr.sqltools",
32
+ "mtxr.sqltools-driver-pg",
33
+
34
+ // Git
35
+ "eamodio.gitlens",
36
+ "github.vscode-github-actions",
37
+ "mhutchie.git-graph",
38
+
39
+ // Environment & Configuration
40
+ "mikestead.dotenv",
41
+ "redhat.vscode-yaml",
42
+ "editorconfig.editorconfig",
43
+
44
+ // Documentation
45
+ "yzhang.markdown-all-in-one",
46
+ "bierner.markdown-mermaid",
47
+
48
+ // Utilities
49
+ "visualstudioexptteam.vscodeintellicode",
50
+ "wayou.vscode-todo-highlight",
51
+ "gruntfuggly.todo-tree",
52
+ "pkief.material-icon-theme"
53
+ ]
54
+ }
55
+ }
56
+ }
@@ -0,0 +1,15 @@
1
+ version: '3.8'
2
+
3
+ services:
4
+ package:
5
+ container_name: nestjs-mcp-server
6
+ build:
7
+ context: ..
8
+ dockerfile: .devcontainer/Dockerfile.dev
9
+ ports:
10
+ - 3000:3000
11
+ - 9229:9229
12
+ - 6277:6277
13
+ volumes:
14
+ - ..:/package
15
+ - /package/node_modules
package/.dockerignore ADDED
@@ -0,0 +1,37 @@
1
+ # Development files and directories
2
+ node_modules
3
+ npm-debug.log
4
+ yarn-debug.log
5
+ yarn-error.log
6
+ *.log
7
+ .git
8
+ .github
9
+ .vscode
10
+ .idea
11
+ *.iml
12
+ .DS_Store
13
+ Thumbs.db
14
+
15
+ # Environment and local configuration files
16
+ .env
17
+ .env.*
18
+ .eslintcache
19
+ .stylelintcache
20
+ *.tsbuildinfo
21
+
22
+ # Build and test files
23
+ dist
24
+ coverage
25
+ .nyc_output
26
+
27
+ # Temporary files
28
+ *.swp
29
+ *.bak
30
+ *.tmp
31
+ .temp/
32
+
33
+ # Documentation and files not needed at runtime
34
+ README.md
35
+ CHANGELOG.md
36
+ LICENSE
37
+ jest.config.ts
package/.prettierrc ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "singleQuote": true,
3
+ "trailingComma": "all"
4
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Adrián Darío Hidalgo Flores
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.