anomalyco / anomalyco/opencode
Skills silently dropped from available_skills when MCP server is configured
@neriousy is already working on this.
Since Sep 2, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- Avg merge
- 7h 2m
- Merged PRs (30d)
- 384
Description
Description
[open code self debug results]
Summary
When an MCP server is configured in opencode.json, some skills silently disappear from available_skills in the system prompt. No errors are logged — the skills are simply not discovered. Removing the MCP block restores all skills.
Environment
- opencode v1.18.25, linux (Bun binary)
Reproduction
- Place several skills in .opencode/skills/ (e.g. 7+ skills).
- Optionally place duplicate-name skills in ~/.agents/skills/.
- Start opencode without mcp config → all skills appear in available_skills.
- Add an mcp block with a local server (e.g. uvx mcp-atlassian), restart → 2 skills are missing from available_skills.
- Remove the mcp block, restart → all skills return.
The same skills are always dropped — it's not random. Removing other skills from disk doesn't help; the same ones still disappear.
Evidence from logs
Session MCP init count Missing
A no 10 none
B yes 8 2 skills
C yes (fewer on disk) 6 same 2 skills
level=INFO message=init
level=WARN message="duplicate skill name" name=X ... (only for duplicates)
level=INFO message=init count=6
Key observations:
- Missing skills are never mentioned in the log — no failed to load skill, no SkillInvalidError, no FrontmatterError.
- Missing skills have valid frontmatter, no BOM, no encoding issues.
- MCP server startup takes ~5s, delaying skill discovery from 1.5s to 5-7s.
Hypothesis
MCP server spawn competes for I/O during initialization. Glob.scan in discoverSkills returns incomplete results — some SKILL.md files are not found. Since they're never added to the state.skills map, they're silently absent from available_skills.
The fact that the same skills are always missing (not random) suggests the glob scan truncates or times out partway through the directory listing.
Expected behavior
All skills on disk should be discovered regardless of whether MCP servers are configured. MCP server initialization should not affect skill discovery.
Plugins
No response
OpenCode version
v1.18.25
Steps to reproduce
- Place several skills in .opencode/skills/ (e.g. 7+ skills).
- Optionally place duplicate-name skills in ~/.agents/skills/.
- Start opencode without mcp config → all skills appear in available_skills.
- Add an mcp block with a local server (e.g. uvx mcp-atlassian), restart → 2 skills are missing from available_skills.
- Remove the mcp block, restart → all skills return.
The same skills are always dropped — it's not random. Removing other skills from disk doesn't help; the same ones still disappear.
Screenshot and/or share link
No response
Operating System
Ubuntu 22.04
Terminal
tmux, vscode remote console (the problem shows up in both)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.