mirror of
https://github.com/suitenumerique/docs.git
synced 2026-09-27 03:55:01 +02:00
✨(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:
+23
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user