Skip to content

feat: expose knowledge-base documentation through an MCP server - #119

Open
oto-macenauer-absa wants to merge 1 commit into
feat/mcp-runtimefrom
feat/mcp-server
Open

oto-macenauer-absa wants to merge 1 commit into
feat/mcp-runtimefrom
feat/mcp-server

Conversation

@oto-macenauer-absa

@oto-macenauer-absa oto-macenauer-absa commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

What

Expose generated documentation through a public, read-only MCP endpoint so compatible AI agents can discover, search, and read Knowledge Base content without authentication.

This is the top of a three-PR stack. The PRs below it add the search index (#128) and the MCP server (#129). This one deploys the server and documents it.

Changes

  • Dockerfile:

    • copies the Node binary from a digest-pinned node:24-alpine donor into the unprivileged nginx image;
    • moves dist/_mcp (the search index and the server bundle) out of the web root, to /opt/kb-mcp;
    • fails the build if the bundle, the index or the 404 page is missing.
  • docker/kb-entrypoint.sh supervises the loopback Node MCP process next to nginx. The healthcheck covers both.

  • nginx.conf:

    • POST/OPTIONS /knowledge-base/mcp (and its subpaths) proxy to the local server. Node owns the Origin, size and rate limits, so production and the test mirror share one implementation;
    • the static OPTIONS shortcut leaves the MCP preflight to Node;
    • every 404 is served from the designed not-found.html.
  • contract/DEPLOYMENT.md adds two requirements: the gateway must forward unauthenticated POST /knowledge-base/mcp, and the KB_MCP_* settings are documented.

  • Docs:

    • docs/mcp.md for users and operators: endpoint, client setup, surface, configuration, security, troubleshooting;
    • docs/mcp-development.md for contributors: layout, adding a search backend, tests, bundle, framework choice.

    README, CLAUDE.md, AGENTS.md and CONTRIBUTING.md are updated to match.

  • Tests:

    • nginx config assertions: the MCP locations, the preflight exclusion, the 404 page and both base images pinned;
    • container coverage of the designed 404s.

Release notes

Knowledge Base deployments now expose an unauthenticated, read-only MCP endpoint at /knowledge-base/mcp. Deployment owners must allow unauthenticated POST forwarding for this path and set KB_MCP_PUBLIC_ORIGIN when agents need absolute document links.

Verification

  • make lint: green
  • npm audit --omit=dev --audit-level=high: green
  • npm test: 500 passed
  • npm run test:mcp: 39 passed
  • npx playwright test --config=playwright.config.ci.js: 23 passed
  • npm run test:container: 37 passed (fresh image)

Contract impact

contract/DEPLOYMENT.md changes deployment runtime and gateway requirements; artifact contract schemas remain unchanged.

Closes #117

🤖 Generated with Claude Code

The image copies the Node binary from a digest-pinned node:24-alpine
donor into unprivileged nginx, moves dist/_mcp out of the web root to
/opt/kb-mcp, and fails the build when the bundle, the search index or
the 404 page is missing. docker/kb-entrypoint.sh supervises the
loopback MCP process next to nginx; the healthcheck covers both.

nginx proxies POST/OPTIONS /knowledge-base/mcp (and its subpaths) to
it, leaves the MCP preflight to Node, and serves every 404 from the
designed not-found page. contract/DEPLOYMENT.md records the gateway
requirement and the KB_MCP_* settings.

docs/mcp.md is the user and operator guide; docs/mcp-development.md
the contributor guide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: expose knowledge-base documentation through an MCP server

1 participant