feat(mcp): MCP server for AI clients, consuming the REST API

New app apps/mcp (NestJS + @nestjs-mcp/server 2): Streamable HTTP at
POST /mcp, stateless.

- 24 tools: projects (mine, public, details with settings, board, stats,
  analytics, activity), tickets (my work, search, details with comments and
  history, create, update, move, assign, release, comment, link), releases
  (list, upcoming, details with progress and burnup, create, publish) and
  users (whoami, search). Admin operations stay in the web.
- No credentials of its own: each call's Authorization header (a Pireon
  token) is forwarded to the API; without it only public projects are read.
- Typed REST client generated from apps/api/openapi.json (openapi-fetch +
  openapi-typescript via `nx run mcp:openapi-types`); API refusals become
  readable tool errors; parameters validated with zod.
- Tests: the real MCP against a simulated API (token forwarding, errors,
  validation, writes).
- Docker target `mcp` (Node 24) and an optional compose service under the
  `mcp` profile; zod declared as a root dependency.
- Docs: chapter 9 «Servidor MCP», references in 01/06/07 and the index;
  Word/PDF regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-07 18:59:38 +02:00
parent 71dc2d6f2d
commit 9236cb73c6
36 changed files with 6054 additions and 38 deletions

View File

@@ -18,6 +18,8 @@
"@apollo/server": "^5.5.1",
"@as-integrations/express5": "^1.1.2",
"@graphql-typed-document-node/core": "^3.2.0",
"@modelcontextprotocol/server": "^2.3.1",
"@nestjs-mcp/server": "^2.0.0",
"@nestjs/apollo": "^13.4.5",
"@nestjs/common": "^11.0.0",
"@nestjs/config": "^4.0.4",
@@ -43,12 +45,14 @@
"ioredis": "^5.11.1",
"joi": "^18.2.9",
"mongoose": "^8.24.4",
"openapi-fetch": "^0.17.0",
"pg": "^8.23.1",
"reflect-metadata": "^0.2.0",
"rxjs": "^7.8.0",
"tslib": "^2.8.1",
"typeorm": "^0.3.31",
"ws": "^8.22.0"
"ws": "^8.22.0",
"zod": "^4.6.5"
},
"devDependencies": {
"@analogjs/vite-plugin-angular": "~2.6.0",