Add MCP skill discovery and on-demand loading#6
Merged
RaghavSood merged 2 commits intofeature/find-token-supportfrom Feb 24, 2026
Merged
Add MCP skill discovery and on-demand loading#6RaghavSood merged 2 commits intofeature/find-token-supportfrom
RaghavSood merged 2 commits intofeature/find-token-supportfrom
Conversation
92ab17d to
74a3f3b
Compare
3de125d to
5078c33
Compare
Integrate MCP resources protocol (resources/list, resources/read) to
discover and load skill guides from the MCP server. Skills are markdown
documents at skills/{slug}.md that provide detailed workflow instructions.
The skill list is injected into the system prompt so the LLM knows what's
available, but skill content is only loaded on-demand via the new get_skill
tool when relevant to the user's request. This keeps the context window
lean as the skill library grows.
- MCP client: add ListSkills, ReadSkill, SkillSummary with TTL caching
- Agent: extend MCPToolProvider interface with skill methods
- Agent: inject skill summary into system prompt after tool descriptions
- Tools: add get_skill native tool (only registered when skills exist)
- Executor: add get_skill handler delegating to MCP ReadSkill
- Main: pre-warm skill cache at startup alongside tools
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The MCP server returns skill resources with URIs like "skill://vultisig/evm-contract-call.md" but extractSkillSlug was filtering for the "skills/" prefix, discarding all entries. - extractSkillSlug now extracts the last path segment before .md, handling any URI scheme (skill://, skills/, etc.) - ReadSkill now looks up the full URI from the skill cache instead of constructing it, so it works with any URI format Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
74a3f3b to
27c50d0
Compare
enriquesouza
pushed a commit
that referenced
this pull request
Feb 27, 2026
Add MCP skill discovery and on-demand loading
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
resources/list,resources/read) to discover skill guides from the MCP serverget_skilltoolStacked on #3 → #2.
Architecture
Key design decision: The skill list (names + descriptions) is always in the system prompt so the LLM can decide relevance. The skill content (full markdown) is only loaded when the LLM calls
get_skill. This keeps the context window lean as the skill library grows.Changes
internal/mcp/client.goskillCache,ListSkills,ReadSkill,SkillSummaryinternal/service/agent/agent.goMCPToolProviderinterface, inject skill summary into prompt, registerGetSkillToolinternal/service/agent/tools.goGetSkillTooldefinitioninternal/service/agent/executor.goget_skilldispatch +execGetSkillhandlercmd/server/main.goMCP Protocol Details
Skill discovery uses standard MCP resources protocol:
resources/list→ filter for URIs matchingskills/*.mdresources/readwith URIskills/{slug}.md→ skill markdown contentCaching:
sync.Mapfor process lifetime (docs change with deployments)Test plan
go build ./...mcp skills loadedlogget_skilland uses the contentget_skillresources/readcall)🤖 Generated with Claude Code