✨(mcp) add the docs-mcp server

Add `src/frontend/servers/mcp`, a stateless TypeScript (Express +
`@modelcontextprotocol/sdk`) MCP server exposing `search_documents`,
`read_document` and `create_document` over Streamable HTTP.

It is an OAuth resource server holding no credentials of its own: it
verifies the caller's Keycloak token against the realm JWKS
(`src/auth/jwtVerifier.ts`), checks the `docs-mcp` audience, then
forwards the same token unchanged to Django's
`/api/v1.0/mcp/documents/*` endpoints (`src/docsApiClient.ts`),
which stays the sole authority on document permissions.
No token exchange.

Ship the `mcp-development` compose service, its `env.d/development/mcp`
env file, a `build-mcp` Makefile helper, and
`documentation/mcp_server.md` describing the full flow and
how to connect MCP clients.
This commit is contained in:
Anthony LC
2026-09-25 12:07:58 +02:00
parent c3e82d9cac
commit e596b73bce
27 changed files with 1406 additions and 15 deletions
+23
View File
@@ -286,6 +286,29 @@ services:
minio:
condition: service_healthy
mcp-development:
user: ${DOCKER_USER:-1000}
build:
context: .
dockerfile: ./src/frontend/servers/mcp/Dockerfile
target: mcp-development
image: impress:mcp-development
restart: unless-stopped
env_file:
- env.d/development/mcp
- env.d/development/mcp.local
ports:
- "4455:4455"
volumes:
- ./src/frontend/:/home/frontend
- /home/frontend/node_modules
- /home/frontend/servers/mcp/node_modules
depends_on:
app-dev:
condition: service_started
keycloak:
condition: service_healthy
kc_postgresql:
image: postgres:14.3
healthcheck: