Skip to content

feat: add WebMCP skill — AI agent tool protocol for IC canisters#147

Draft
dfinityianblenke wants to merge 2 commits intomainfrom
ianblenke/webmcp-skill
Draft

feat: add WebMCP skill — AI agent tool protocol for IC canisters#147
dfinityianblenke wants to merge 2 commits intomainfrom
ianblenke/webmcp-skill

Conversation

@dfinityianblenke
Copy link
Copy Markdown

@dfinityianblenke dfinityianblenke commented Apr 2, 2026

Summary

Adds a new WebMCP skill that teaches AI agents how to expose IC canister methods as callable tools via the Web Model Context Protocol (W3C, Chrome 146+).

This complements dfinity/ic#9708 which implements the WebMCP stack in the IC repo.

Skill covers:

  • dfx.json webmcp config section (all fields documented)
  • ic-webmcp-codegen CLI (both did and dfx subcommands)
  • CORS headers via .ic-assets.json5
  • Browser integration (navigator.modelContext + @dfinity/webmcp)
  • Non-Chrome polyfill with OpenAI/Anthropic/LangChain adapters
  • Internet Identity scoped delegation for agent auth
  • Candid → JSON Schema type mapping table
  • 10 common pitfalls (e.g., empty delegation targets, CDN supply chain, recursive types)

Evaluation:

  • 4 output evals: add WebMCP to canister, auth tools, polyfill usage, manifest generation
  • 8 should-trigger / 6 should-not-trigger queries

Files:

  • skills/webmcp/SKILL.md (291 lines, under 500 limit)
  • evaluations/webmcp.json

This is related to the ic repo PR !9708: dfinity/ic#9708

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Skill Validation Report

Validating skill: /home/runner/work/icskills/icskills/skills/webmcp

Structure

  • Pass: SKILL.md found

Frontmatter

  • Pass: name: "webmcp" (valid)
  • Pass: description: (402 chars)
  • Pass: license: "Apache-2.0"
  • Pass: compatibility: (16 chars)
  • Pass: metadata: (2 entries)

Markdown

  • Pass: no unclosed code fences found

Tokens

File Tokens
SKILL.md body 3,118
Total 3,118

Content Analysis

Metric Value
Word count 1,520
Code block ratio 0.33
Imperative ratio 0.12
Information density 0.23
Instruction specificity 1.00
Sections 13
List items 25
Code blocks 10

Contamination Analysis

Metric Value
Contamination level medium
Contamination score 0.46
Primary language category javascript
Scope breadth 5
  • Warning: Language mismatch: config, markup, shell, systems (4 categories differ from primary)

Result: passed

Project Checks


✓ Project checks passed for 1 skills (0 warnings)

Adds a new skill covering the full WebMCP stack:
- Candid-to-JSON-Schema codegen via ic-webmcp-codegen
- Browser tool registration via navigator.modelContext
- dfx.json webmcp config section
- CORS headers via .ic-assets.json5
- Internet Identity scoped delegation for agents
- Polyfill with OpenAI/Anthropic/LangChain adapters
- 10 common pitfalls

Evaluation: 4 output evals (add to canister, auth tools, polyfill, manifest gen) + 8 should-trigger / 6 should-not-trigger queries.

This is related to the ic repo PR dfinity/ic#9708
@dfinityianblenke dfinityianblenke force-pushed the ianblenke/webmcp-skill branch from fe8519a to 7154e1f Compare April 2, 2026 14:27
Address team feedback (Marco Walz):
- Prerequisites: @icp-sdk/core >= 5.0.0 instead of @dfinity/agent/candid/principal
- Auth: @icp-sdk/auth instead of @dfinity/auth-client
- Added pitfall #11: using deprecated @dfinity/* packages
- Step 1: notes icp.yaml compatibility is planned, dfx.json used for now
- Step 4: AuthClient import from @icp-sdk/auth
- Pipeline diagram: references icp.yaml alongside dfx.json
- Verification: uses icp deploy
- Evaluation: added expected behavior for @icp-sdk/auth

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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