@nestjs-adk/mcp 0.0.2 → 1.0.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 +51 -5
- package/package.json +12 -3
package/README.md
CHANGED
|
@@ -1,13 +1,59 @@
|
|
|
1
1
|
# @nestjs-adk/mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MCP tools for [`@nestjs-adk/core`](https://www.npmjs.com/package/@nestjs-adk/core) agents.
|
|
4
|
+
|
|
5
|
+
The [Model Context Protocol](https://modelcontextprotocol.io) is an open standard that exposes tools from external servers, like GitHub, filesystems or your own services. This package connects your NestJS agents to those servers. The server's catalog becomes agent tools automatically, with each JSON Schema converted to Zod.
|
|
6
|
+
|
|
7
|
+
## Setup
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i @nestjs-adk/core @nestjs-adk/mcp
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Register the servers once:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { McpModule } from "@nestjs-adk/mcp";
|
|
17
|
+
|
|
18
|
+
@Module({
|
|
19
|
+
imports: [
|
|
20
|
+
AdkModule.forRoot({ ... }),
|
|
21
|
+
McpModule.forRoot({
|
|
22
|
+
servers: [
|
|
23
|
+
{ name: "github", transport: { type: "stdio", command: "npx", args: ["-y", "@modelcontextprotocol/server-github"] } },
|
|
24
|
+
],
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
27
|
+
})
|
|
28
|
+
export class AppModule {}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Transports are `stdio` for local processes, `http` for streamable HTTP servers and `sse` for legacy SSE servers.
|
|
32
|
+
|
|
33
|
+
## Giving the tools to an agent
|
|
34
|
+
|
|
35
|
+
Use `toolset` in the agent's tool list. You can expose the whole catalog or pick specific tools:
|
|
4
36
|
|
|
5
37
|
```ts
|
|
6
|
-
|
|
38
|
+
import { toolset } from "@nestjs-adk/core";
|
|
7
39
|
|
|
8
|
-
@Agent({
|
|
40
|
+
@Agent({
|
|
41
|
+
name: "dev_assistant",
|
|
42
|
+
description: "Helps with repository tasks.",
|
|
43
|
+
prompt: "You help the team manage GitHub issues.",
|
|
44
|
+
tools: [toolset("github", ["create_issue", "list_issues"])],
|
|
45
|
+
})
|
|
46
|
+
export class DevAssistantAgent extends AdkAgent {}
|
|
9
47
|
```
|
|
10
48
|
|
|
11
|
-
|
|
49
|
+
Omit the second argument to expose every tool the server offers.
|
|
50
|
+
|
|
51
|
+
## Behavior you can rely on
|
|
52
|
+
|
|
53
|
+
The catalog is fetched once at startup and cached. If a server is down at boot the app fails fast with a typed `McpConnectionError`, unless you mark that server with `optional: true`, in which case it is skipped with a warning.
|
|
54
|
+
|
|
55
|
+
At runtime, a tool call that fails on the server side does not crash the run. The error is returned to the model as `{ error }`, so the agent can react, retry or explain the problem to the user.
|
|
56
|
+
|
|
57
|
+
## Learn more
|
|
12
58
|
|
|
13
|
-
|
|
59
|
+
The full documentation lives in [`@nestjs-adk/core`](https://www.npmjs.com/package/@nestjs-adk/core) and in the repository at [github.com/gabrieljsilva/nestjs-adk](https://github.com/gabrieljsilva/nestjs-adk).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs-adk/mcp",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "MCP client integration for nestjs-adk: consume external MCP servers as agent tools.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -27,15 +27,24 @@
|
|
|
27
27
|
"@modelcontextprotocol/sdk": "^1.12.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@nestjs-adk/core": "^0.0
|
|
30
|
+
"@nestjs-adk/core": "^1.0.0",
|
|
31
31
|
"@nestjs/common": "^10.0.0 || ^11.0.0",
|
|
32
32
|
"@nestjs/core": "^10.0.0 || ^11.0.0",
|
|
33
33
|
"zod": "^3.23.0 || ^4.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@nestjs-adk/core": "^0.0
|
|
36
|
+
"@nestjs-adk/core": "^1.0.0"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/gabrieljsilva/nestjs-adk.git",
|
|
44
|
+
"directory": "packages/mcp"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/gabrieljsilva/nestjs-adk#readme",
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://github.com/gabrieljsilva/nestjs-adk/issues"
|
|
40
49
|
}
|
|
41
50
|
}
|