Skip to content

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

Open
oto-macenauer-absa wants to merge 6 commits into
masterfrom
feat/mcp-server
Open

oto-macenauer-absa wants to merge 6 commits into
masterfrom
feat/mcp-server

Conversation

@oto-macenauer-absa

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.

Changes

  • Generate a sanitised, deterministic MCP corpus and bundled Streamable HTTP server at build time.
  • Serve POST /knowledge-base/mcp through nginx; supervise loopback Node MCP process with nginx.
  • Add resource and document-discovery tools, validation, response limits, rate limiting, and Origin checks.
  • Document MCP client setup, deployment gateway requirement, configuration, limits, and security model.
  • Add extraction, search/ranking, user-query, MCP protocol, nginx-mirror, and container coverage.

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

  • node scripts/setup-test-apps.mjs && npm run build:headless — green
  • npm test — 237 passed
  • npx playwright test --config=playwright.config.ci.js — 23 passed
  • npx playwright test tests/mcp-server.spec.js — 6 passed
  • npm run test:container — 37 passed
  • npm audit --omit=dev --audit-level=high — green

Contract impact

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

Closes #117

oto-macenauer-absa and others added 6 commits October 4, 2026 21:47
- http: log only a validated JSON-RPC method and never throw from the
  access log; main.js catches handler rejections so one request cannot
  exit Node (and with it the container)
- http: rate-limit per client (X-Forwarded-For, KB_MCP_TRUSTED_PROXIES
  hops from the right) with a global backstop, instead of one shared
  bucket any caller could drain
- http/nginx: answer MCP CORS preflight in Node for allowed origins;
  nginx's static OPTIONS shortcut now skips /knowledge-base/mcp
- build: write dist/_error/not-found.html, which nginx's error_page
  serves, and guard it in the Dockerfile; every 404 was a 500
- corpus: fall back to slug/empty description for iframe entries
  without name or description, as the rest of the build does
- extract: recurse into div/section/figure/blockquote, join inline runs
  before trimming, and keep code blocks' whitespace verbatim
- search: bound fuzzy matching by term length with early exit, and skip
  it for the compact whole-query token
- server: compute the resources/read continuation offset from the real
  header length

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