Skip to content

feat(skills): serve cloudflare/skills through the MCP Skills extension, synced every six hours - #272

Merged
mattzcarey merged 2 commits into
mainfrom
feat/skills-extension
Oct 9, 2026
Merged

mattzcarey merged 2 commits into
mainfrom
feat/skills-extension

Conversation

@mattzcarey

@mattzcarey mattzcarey commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

The server now serves cloudflare/skills through the MCP Skills extension (io.modelcontextprotocol/skills, SEP-2640), in Code Mode and with ?codemode=false. Clients that support the extension discover skills with skills/list and read each file at skill://<name>/<path>. The scheduled sync now runs every six hours instead of daily: it picks up skill changes and writes only the files that changed, and the OpenAPI spec sync runs on the same cron.

Skills are where Cloudflare keeps its long-form guidance for agents, and they change often. Most of it is far too long for server instructions, and right now agents have to install it separately from this server. SEP-2640 is final, written against 2026-07-28 (which we already serve), and SDK 2.3.1 supports custom methods and capabilities.extensions, so it needs no SDK change.

flowchart LR
  cron["cron 0 */6 * * *"] --> spec[syncSpec]
  cron -->|tar.gz from codeload| sync[syncSkills]
  sync -->|new bytes only| files[(R2 skills/files/sha256)]
  sync -->|only if a skill changed| manifest[(R2 skills/manifest.json)]
  manifest -->|1h isolate cache| h[skills handlers]
  files --> h
Loading
  • Sync (src/skills/sync.ts, tar.ts, bundle.ts): one tarball request, read by a small tar parser that keeps only regular files (no symlinks, no .. paths). Each skills/<name>/ becomes one skill. A skill is skipped, with the reason logged, if its name is invalid or doesn't match its directory, it lacks name/description frontmatter, or it's over 512 files / 16 MiB. Frontmatter is parsed with yaml (new dependency, no transitive deps) and passed through verbatim.
  • Incremental storage:
    • files are stored by content hash at skills/files/<sha256>, so a sync uploads only bytes R2 doesn't already hold
    • skills/manifest.json is written after those files, and only when a skill entry changed, so a commit outside skills/ writes nothing
    • files that neither the new nor the previous manifest names are then deleted; keeping the previous manifest's files covers isolates that still cache it for up to an hour
    • a failed sync, or one with no valid skills, changes nothing
  • Serving (src/skills/handlers.ts): every entry carries a sha256 digest and size for each of its files, and resources/read reads each file by its digest, so the served bytes always match. Results are identical for every user, so they're cached public for one hour. resources/list lists only the SKILL.md files. directoryRead isn't declared because every manifest is already complete.
  • Scheduling: one 0 */6 * * * cron (was 0 0 * * *) runs the spec and skills syncs under Promise.allSettled, so one failing doesn't hold back the other.
// skills/list → result
{ "resultType": "complete", "ttlMs": 3600000, "cacheScope": "public",
  "skills": [{ "uri": "skill://wrangler/SKILL.md",
    "frontmatter": { "name": "wrangler", "description": "…" },
    "resources": [{ "uri": "skill://wrangler/SKILL.md", "digest": "sha256:…", "size": 11176 }] }] }

Tests ran, including incremental-sync tests against real R2. On a throwaway Worker, I ran the scheduled handler on Cloudflare with wrangler dev --remote --test-scheduled:

  • the first run synced the spec and 16 skills / 298 files
  • the second run logged Skills unchanged
  • mcp-inspector --cli <url> --method skills/list --verify (Inspector 2.10.1) against the deployed Worker reported "Verified 16 skills and 298 files: no conformance errors"

After deploy, npm run seed:staging uploads the skill files (with wrangler r2 bulk put) and the manifest, so skills are live before the first cron run.

Sync cloudflare/skills to R2 daily and serve it with skills/list,
skills/get and resources/read (io.modelcontextprotocol/skills, SEP-2640)
in both tool modes.
@mattzcarey
mattzcarey force-pushed the feat/skills-extension branch from e706ac4 to 51d02a8 Compare October 9, 2026 00:43
Run the spec and skills syncs together on one 0 */6 * * * cron. Store
skill files content-addressed under skills/files/<sha256> with a
manifest at skills/manifest.json. A sync writes only new bytes, skips
the manifest when no skill changed, and deletes files neither the new
nor previous manifest names.
@mattzcarey mattzcarey changed the title feat(skills): serve cloudflare/skills through the MCP Skills extension feat(skills): serve cloudflare/skills through the MCP Skills extension, synced every six hours Oct 9, 2026
@mattzcarey
mattzcarey merged commit d5d326e into main Oct 9, 2026
5 checks passed
@mattzcarey
mattzcarey deleted the feat/skills-extension branch October 9, 2026 01:45
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