Skip to content

feat: serve /.well-known/webmcp.json — WebMCP manifest endpoint#149

Open
dfinityianblenke wants to merge 1 commit intomainfrom
ianblenke/webmcp-manifest
Open

feat: serve /.well-known/webmcp.json — WebMCP manifest endpoint#149
dfinityianblenke wants to merge 1 commit intomainfrom
ianblenke/webmcp-manifest

Conversation

@dfinityianblenke
Copy link
Copy Markdown

@dfinityianblenke dfinityianblenke commented Apr 2, 2026

Summary

Adds a statically-generated /.well-known/webmcp.json endpoint that exposes the three skills canister query methods as callable AI agent tools.

Manifest exposes three tools (WebMCP 1.0 schema):

  • list_skillslist_skills() — All skill topics with metadata
  • get_skillget_skill(name) — Full SKILL.md + frontmatter for one skill
  • search_skillssearch_skills(query) — Keyword search across all skills

All three are query methods with "certified": true.

Canister ID injection — set SKILLS_CANISTER_ID at build time:

SKILLS_CANISTER_ID=abcde-efghi-... npm run build

When unset the manifest omits canister.id. This is intentional: PR #148 (skills canister) must be deployed first to obtain the real principal, then the site is rebuilt with it set.

CORS headers are already handled by the existing .ic-assets.json5 rule for .well-known/**/*.json (Access-Control-Allow-Origin: *, max-age=300).

Consumers of this manifest:

Test plan

  • npm run build succeeds (verified locally)
  • dist/.well-known/webmcp.json exists and contains all three tools
  • SKILLS_CANISTER_ID=ryjl3-tyaaa-aaaaa-aaaba-cai npm run buildcanister.id appears in manifest
  • Without env var — canister.id is omitted (not null, not ""), no build error

This extends PR 148, and that should be merged first.
This optionally can (and probably should) be followed by PR 150 as well.

Adds a statically-generated WebMCP manifest at /.well-known/webmcp.json
that exposes the three skills canister query methods as AI agent tools.

The manifest follows the WebMCP 1.0 schema and is consumed by:
- Chrome 146+ navigator.modelContext (native WebMCP support)
- @dfinity/webmcp polyfill (for all other browsers, Claude Code, Cursor, etc.)
- ic-webmcp-codegen for generating client registration scripts

Set SKILLS_CANISTER_ID at build time to embed the deployed canister principal:
  SKILLS_CANISTER_ID=<principal> npm run build

When unset the manifest omits canister.id; ICWebMCP will error until the
canister is deployed and the site is rebuilt with the real principal.

The /.well-known/**/*.json CORS rule in .ic-assets.json5 already covers
this file (public, max-age=300, Access-Control-Allow-Origin: *).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dfinityianblenke dfinityianblenke requested review from a team and JoshDFN as code owners April 2, 2026 14:40
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Skill Validation Report

No skill files were changed in this PR — validation skipped.

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