Skip to content

changes to support self hosted MCP server next to self-hosted 5etools - #16

Open
tz8 wants to merge 6 commits into
jazzsequence:mainfrom
tz8:main
Open

changes to support self hosted MCP server next to self-hosted 5etools#16
tz8 wants to merge 6 commits into
jazzsequence:mainfrom
tz8:main

Conversation

@tz8

@tz8 tz8 commented Jul 31, 2026

Copy link
Copy Markdown

both possible: working directly from the 5etools data directory or via http/https. Full disclosure: i am a long term programmer (40+ years), but i'm lazy so this code was created with support from Claude Code

Claude (Cowork) and others added 6 commits July 10, 2026 19:27
- rawUrl() now redirects content fetches for the 2024/2014 ruleset
  repos to LOCAL_BASE_URL when set, e.g. a self-hosted 5etools
  static mirror. Manifest indexing still uses the GitHub Contents
  API (no static-mirror equivalent for directory listing).
  Homebrew content is never redirected.
- New HTTP transport (src/http.ts) using the MCP SDK's stateless
  StreamableHTTPServerTransport, replacing the placeholder page.
  Exposes POST /mcp and GET /health. Optional MCP_HTTP_TOKEN
  bearer-auth guard on /mcp (open if unset).
- Unit tests for both (tests/github.test.ts, tests/http.test.ts),
  all passing alongside the existing suite (433 tests total).
- README: document LOCAL_BASE_URL, PORT, MCP_HTTP_TOKEN, and the
  new HTTP transport usage.
Add local mirror support and Streamable HTTP transport
- New src/manifest/local-builder.ts: scans a local 5etools data/
  directory directly via fs.readdir instead of the GitHub Contents
  API. Uses file mtime+size as a cache-invalidation key in place of
  a GitHub blob SHA.
- github.ts fetchRaw() now handles file:// URLs by reading straight
  from disk, so content fetching is fully network-free too when
  LOCAL_DATA_DIR is set (LOCAL_BASE_URL is then ignored).
- builder.ts: buildManifest() branches on LOCAL_DATA_DIR; falls back
  to the existing GitHub-based path when unset, so stdio/Claude
  Desktop users are unaffected.
- Homebrew indexing is unchanged (still GitHub-only, already
  non-fatal on rate-limit errors) — self-hosted mirrors don't bundle
  third-party homebrew content.
- Tests: tests/manifest/local-builder.test.ts (5 tests) and file://
  coverage added to tests/github.test.ts (2 tests). Full suite: 440
  tests, lint/typecheck/build all clean.
- Verified end-to-end against a real fixture data/ directory: served
  correct, fixture-only content with zero GitHub calls.
Add LOCAL_DATA_DIR: filesystem-based manifest indexing
@pantheon-site-integration

Copy link
Copy Markdown

Successfully created multidev environment: pr-16

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.

1 participant