Skip to content

[Server] Register skills from PHP code (dynamic content) - #2

Draft
wachterjohannes wants to merge 1 commit into
feature/skills-extensionfrom
feature/skills-dynamic-registration
Draft

wachterjohannes wants to merge 1 commit into
feature/skills-extensionfrom
feature/skills-dynamic-registration

Conversation

@wachterjohannes

Copy link
Copy Markdown
Owner

Follow-up to modelcontextprotocol#372: a way to register a skill's SKILL.md and supporting files from PHP-generated content (templates, computed text), not only from real files on a directory addSkillsFromDirectory() walks.

SkillProvider::registerSkill() currently computes each resource's digest and size via hash_file()/filesize() and serves content via new \SplFileInfo($absolute), so it assumes real files on disk. This PR needs a parallel path: content supplied as strings or closures per skill, with digest and size computed from the generated bytes, registered as a resource the same way Builder::addResource() already accepts a closure. Mcp\Server\Skill\SkillRegistry::add(Skill $skill) is already public, so a hand-built entry can be registered today without new API; the gap is a convenience layer with ergonomics similar to addSkillsFromDirectory().

No code yet — opened to track scope and target this against feature/skills-extension rather than wait for modelcontextprotocol#372 to merge upstream.

Follow-up to modelcontextprotocol#372. Scope: a Builder/SkillProvider entry point for
registering a skill's frontmatter and files from PHP-generated content
(templates, computed text) rather than only from real files on disk.
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