@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.
- package/.copilotignore +38 -0
- package/.devcontainer/Dockerfile.dev +28 -0
- package/.devcontainer/devcontainer.json +56 -0
- package/.devcontainer/docker-compose.yml +15 -0
- package/.dockerignore +37 -0
- package/.prettierrc +4 -0
- package/LICENSE +21 -0
- package/README.md +540 -0
- package/dist/controllers/sse/index.d.ts +2 -0
- package/dist/controllers/sse/index.js +19 -0
- package/dist/controllers/sse/index.js.map +1 -0
- package/dist/controllers/sse/sse.controller.d.ts +10 -0
- package/dist/controllers/sse/sse.controller.js +57 -0
- package/dist/controllers/sse/sse.controller.js.map +1 -0
- package/dist/controllers/sse/sse.service.d.ts +16 -0
- package/dist/controllers/sse/sse.service.js +78 -0
- package/dist/controllers/sse/sse.service.js.map +1 -0
- package/dist/controllers/streamable/index.d.ts +2 -0
- package/dist/controllers/streamable/index.js +19 -0
- package/dist/controllers/streamable/index.js.map +1 -0
- package/dist/controllers/streamable/streamable.controller.d.ts +9 -0
- package/dist/controllers/streamable/streamable.controller.js +62 -0
- package/dist/controllers/streamable/streamable.controller.js.map +1 -0
- package/dist/controllers/streamable/streamable.service.d.ts +24 -0
- package/dist/controllers/streamable/streamable.service.js +118 -0
- package/dist/controllers/streamable/streamable.service.js.map +1 -0
- package/dist/decorators/capabilities.constants.d.ts +4 -0
- package/dist/decorators/capabilities.constants.js +8 -0
- package/dist/decorators/capabilities.constants.js.map +1 -0
- package/dist/decorators/capabilities.decorators.d.ts +8 -0
- package/dist/decorators/capabilities.decorators.js +49 -0
- package/dist/decorators/capabilities.decorators.js.map +1 -0
- package/dist/decorators/index.d.ts +2 -0
- package/dist/decorators/index.js +19 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/interceptors/message.interceptor.d.ts +10 -0
- package/dist/interceptors/message.interceptor.js +61 -0
- package/dist/interceptors/message.interceptor.js.map +1 -0
- package/dist/interfaces/capabilities.interface.d.ts +52 -0
- package/dist/interfaces/capabilities.interface.js +3 -0
- package/dist/interfaces/capabilities.interface.js.map +1 -0
- package/dist/interfaces/context.interface.d.ts +6 -0
- package/dist/interfaces/context.interface.js +3 -0
- package/dist/interfaces/context.interface.js.map +1 -0
- package/dist/interfaces/index.d.ts +2 -0
- package/dist/interfaces/index.js +19 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interfaces/mcp-server-options.interface.d.ts +42 -0
- package/dist/interfaces/mcp-server-options.interface.js +3 -0
- package/dist/interfaces/mcp-server-options.interface.js.map +1 -0
- package/dist/interfaces/message.types.d.ts +8 -0
- package/dist/interfaces/message.types.js +3 -0
- package/dist/interfaces/message.types.js.map +1 -0
- package/dist/mcp.module.d.ts +13 -0
- package/dist/mcp.module.js +193 -0
- package/dist/mcp.module.js.map +1 -0
- package/dist/registry/discovery.service.d.ts +16 -0
- package/dist/registry/discovery.service.js +85 -0
- package/dist/registry/discovery.service.js.map +1 -0
- package/dist/registry/index.d.ts +2 -0
- package/dist/registry/index.js +19 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/logger.service.d.ts +16 -0
- package/dist/registry/logger.service.js +97 -0
- package/dist/registry/logger.service.js.map +1 -0
- package/dist/registry/registry.service.d.ts +16 -0
- package/dist/registry/registry.service.js +170 -0
- package/dist/registry/registry.service.js.map +1 -0
- package/dist/services/message.service.d.ts +7 -0
- package/dist/services/message.service.js +25 -0
- package/dist/services/message.service.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/eslint.config.mjs +40 -0
- package/package.json +109 -0
- package/src/controllers/sse/index.ts +2 -0
- package/src/controllers/sse/sse.controller.ts +25 -0
- package/src/controllers/sse/sse.service.ts +90 -0
- package/src/controllers/streamable/index.ts +2 -0
- package/src/controllers/streamable/streamable.controller.ts +24 -0
- package/src/controllers/streamable/streamable.service.ts +169 -0
- package/src/decorators/capabilities.constants.ts +7 -0
- package/src/decorators/capabilities.decorators.ts +150 -0
- package/src/decorators/index.ts +2 -0
- package/src/index.ts +11 -0
- package/src/interceptors/message.interceptor.ts +70 -0
- package/src/interfaces/capabilities.interface.ts +95 -0
- package/src/interfaces/context.interface.ts +18 -0
- package/src/interfaces/index.ts +2 -0
- package/src/interfaces/mcp-server-options.interface.ts +105 -0
- package/src/interfaces/message.types.ts +13 -0
- package/src/mcp.module.ts +250 -0
- package/src/mcp.service.spec.ts +28 -0
- package/src/registry/discovery.service.ts +116 -0
- package/src/registry/index.ts +2 -0
- package/src/registry/logger.service.ts +143 -0
- package/src/registry/registry.service.ts +282 -0
- 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
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.
|