@nestjs-mcp/server 0.1.1 → 0.2.0-alpha.1
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 +66 -0
- package/dist/controllers/sse/sse.controller.d.ts +3 -1
- package/dist/controllers/sse/sse.controller.js +8 -2
- package/dist/controllers/sse/sse.controller.js.map +1 -1
- package/dist/controllers/sse/sse.service.d.ts +3 -2
- package/dist/controllers/sse/sse.service.js +21 -6
- package/dist/controllers/sse/sse.service.js.map +1 -1
- package/dist/controllers/streamable/streamable.service.d.ts +6 -11
- package/dist/controllers/streamable/streamable.service.js +36 -11
- package/dist/controllers/streamable/streamable.service.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/capabilities.interface.d.ts +32 -2
- package/dist/interfaces/capabilities.interface.js +51 -0
- package/dist/interfaces/capabilities.interface.js.map +1 -1
- 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 -1
- package/dist/interfaces/index.js +2 -1
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/mcp-server-options.interface.d.ts +2 -2
- package/dist/interfaces/message.types.d.ts +8 -0
- package/dist/interfaces/{guards.interface.js → message.types.js} +1 -1
- package/dist/interfaces/message.types.js.map +1 -0
- package/dist/mcp.module.js +13 -1
- package/dist/mcp.module.js.map +1 -1
- package/dist/registry/registry.service.d.ts +7 -1
- package/dist/registry/registry.service.js +72 -6
- package/dist/registry/registry.service.js.map +1 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +18 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/session.manager.d.ts +14 -0
- package/dist/services/session.manager.js +27 -0
- package/dist/services/session.manager.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +23 -16
- package/.copilotignore +0 -38
- package/.devcontainer/Dockerfile.dev +0 -28
- package/.devcontainer/devcontainer.json +0 -56
- package/.devcontainer/docker-compose.yml +0 -15
- package/.dockerignore +0 -37
- package/.prettierrc +0 -4
- package/coverage/clover.xml +0 -507
- package/coverage/coverage-final.json +0 -19
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -206
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/src/controllers/sse/index.html +0 -146
- package/coverage/lcov-report/src/controllers/sse/index.ts.html +0 -91
- package/coverage/lcov-report/src/controllers/sse/sse.controller.ts.html +0 -160
- package/coverage/lcov-report/src/controllers/sse/sse.service.ts.html +0 -403
- package/coverage/lcov-report/src/controllers/streamable/index.html +0 -146
- package/coverage/lcov-report/src/controllers/streamable/index.ts.html +0 -91
- package/coverage/lcov-report/src/controllers/streamable/streamable.controller.ts.html +0 -157
- package/coverage/lcov-report/src/controllers/streamable/streamable.service.ts.html +0 -655
- package/coverage/lcov-report/src/decorators/capabilities.constants.ts.html +0 -106
- package/coverage/lcov-report/src/decorators/capabilities.decorators.ts.html +0 -535
- package/coverage/lcov-report/src/decorators/index.html +0 -146
- package/coverage/lcov-report/src/decorators/index.ts.html +0 -91
- package/coverage/lcov-report/src/index.html +0 -131
- package/coverage/lcov-report/src/index.ts.html +0 -118
- package/coverage/lcov-report/src/interfaces/capabilities.interface.ts.html +0 -703
- package/coverage/lcov-report/src/interfaces/index.html +0 -131
- package/coverage/lcov-report/src/interfaces/index.ts.html +0 -91
- package/coverage/lcov-report/src/mcp.module.ts.html +0 -817
- package/coverage/lcov-report/src/registry/discovery.service.ts.html +0 -433
- package/coverage/lcov-report/src/registry/index.html +0 -161
- package/coverage/lcov-report/src/registry/index.ts.html +0 -91
- package/coverage/lcov-report/src/registry/logger.service.ts.html +0 -514
- package/coverage/lcov-report/src/registry/registry.service.ts.html +0 -1183
- package/coverage/lcov-report/src/services/index.html +0 -116
- package/coverage/lcov-report/src/services/session.manager.ts.html +0 -163
- package/coverage/lcov.info +0 -912
- package/dist/interfaces/guards.interface.d.ts +0 -4
- package/dist/interfaces/guards.interface.js.map +0 -1
- package/eslint.config.mjs +0 -40
- package/src/controllers/sse/index.ts +0 -2
- package/src/controllers/sse/sse.controller.ts +0 -25
- package/src/controllers/sse/sse.service.ts +0 -106
- package/src/controllers/streamable/index.ts +0 -2
- package/src/controllers/streamable/streamable.controller.ts +0 -24
- package/src/controllers/streamable/streamable.service.ts +0 -190
- package/src/decorators/capabilities.constants.ts +0 -7
- package/src/decorators/capabilities.decorators.ts +0 -150
- package/src/decorators/index.ts +0 -2
- package/src/index.ts +0 -11
- package/src/interfaces/capabilities.interface.ts +0 -206
- package/src/interfaces/context.interface.ts +0 -33
- package/src/interfaces/index.ts +0 -2
- package/src/interfaces/mcp-server-options.interface.ts +0 -105
- package/src/interfaces/message.types.ts +0 -13
- package/src/mcp.module.ts +0 -244
- package/src/mcp.service.spec.ts +0 -28
- package/src/registry/discovery.service.ts +0 -116
- package/src/registry/index.ts +0 -2
- package/src/registry/logger.service.ts +0 -143
- package/src/registry/registry.service.ts +0 -366
- package/src/services/session.manager.ts +0 -26
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs-mcp/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-alpha.1",
|
|
4
4
|
"description": "Modular library for building scalable MCP servers with NestJS, providing decorators and integration patterns as a wrapper for the official MCP TypeScript SDK.",
|
|
5
5
|
"author": "Adrián Darío Hidalgo Flores",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
14
19
|
"main": "dist/index.js",
|
|
15
20
|
"types": "dist/index.d.ts",
|
|
16
21
|
"repository": {
|
|
@@ -37,6 +42,22 @@
|
|
|
37
42
|
"typescript",
|
|
38
43
|
"yarn"
|
|
39
44
|
],
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "nest build",
|
|
47
|
+
"prepare": "husky install",
|
|
48
|
+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
49
|
+
"start:example": "npx -y ts-node-dev --respawn examples/$EXAMPLE/main.ts",
|
|
50
|
+
"start:inspector": "npx -y @modelcontextprotocol/inspector",
|
|
51
|
+
"lint": "eslint \"{src,test,examples}/**/*.ts\" --fix",
|
|
52
|
+
"typecheck": "tsc --noEmit",
|
|
53
|
+
"test": "jest",
|
|
54
|
+
"test:watch": "jest --watch",
|
|
55
|
+
"test:cov": "jest --coverage",
|
|
56
|
+
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
57
|
+
"test:e2e": "jest --config ./test/jest-e2e.json",
|
|
58
|
+
"test:publish": "node scripts/test-npm-publish.js",
|
|
59
|
+
"npm:publish": "node scripts/npm-publish.js"
|
|
60
|
+
},
|
|
40
61
|
"peerDependencies": {
|
|
41
62
|
"@nestjs/common": "^11.0.1",
|
|
42
63
|
"@nestjs/core": "^11.0.1",
|
|
@@ -93,19 +114,5 @@
|
|
|
93
114
|
],
|
|
94
115
|
"coverageDirectory": "../coverage",
|
|
95
116
|
"testEnvironment": "node"
|
|
96
|
-
},
|
|
97
|
-
"scripts": {
|
|
98
|
-
"build": "nest build",
|
|
99
|
-
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
100
|
-
"start:example": "npx -y ts-node-dev --respawn examples/$EXAMPLE/main.ts",
|
|
101
|
-
"start:inspector": "npx -y @modelcontextprotocol/inspector",
|
|
102
|
-
"lint": "eslint \"{src,test,examples}/**/*.ts\" --fix",
|
|
103
|
-
"typecheck": "tsc --noEmit",
|
|
104
|
-
"test": "jest",
|
|
105
|
-
"test:watch": "jest --watch",
|
|
106
|
-
"test:cov": "jest --coverage",
|
|
107
|
-
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
|
108
|
-
"test:e2e": "jest --config ./test/jest-e2e.json",
|
|
109
|
-
"npm:publish": "node scripts/npm-publish.js"
|
|
110
117
|
}
|
|
111
|
-
}
|
|
118
|
+
}
|
package/.copilotignore
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
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
|
|
@@ -1,28 +0,0 @@
|
|
|
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"]
|
|
@@ -1,56 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
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
DELETED