Files
blog/contextforge/README.md
T
2026-10-03 15:46:02 +08:00

26 lines
1.5 KiB
Markdown

# ContextForge adapter
This directory exposes the static blog as three read-only REST tools that ContextForge can publish through MCP:
- `bis_blog_site_info`: site metadata and feed URLs.
- `bis_blog_list_posts`: the public post index with exact slugs.
- `bis_blog_read_post`: one post in Markdown by slug.
The Astro build generates the upstream JSON endpoints. Deploy the site before registering or updating the tools.
## Register
Use a short-lived ContextForge token with permission to list, create, and update tools. Keep it in the current process only:
```powershell
$env:CONTEXTFORGE_URL = 'https://contextforge.example.com'
$env:CONTEXTFORGE_TOKEN = '<short-lived-token>'
pwsh -NoLogo -NoProfile -File .\contextforge\Register-BlogTools.ps1
```
The script prefers the canonical `/v1` API and falls back to the legacy unversioned API when the server returns `404`. Existing tools with the same names are updated; missing tools are created. Use `-WhatIf` to inspect the planned changes without writing to ContextForge.
After registration, add the three tools to a ContextForge virtual server in the Admin UI. That server's SSE or Streamable HTTP endpoint is the MCP endpoint consumed by clients. Keeping virtual-server membership as an explicit admin action avoids silently changing an existing server's authorization boundary.
The checked-in manifest contains no ContextForge credentials. Its upstream allowlist is restricted to `blog.biss.click`, and the tools are read-only `GET` requests.