Skip to content

feat: replace foundry-mcp/tavily with user-configurable skills system#20

Open
tylerburleigh wants to merge 1 commit into
mainfrom
skills-system
Open

feat: replace foundry-mcp/tavily with user-configurable skills system#20
tylerburleigh wants to merge 1 commit into
mainfrom
skills-system

Conversation

@tylerburleigh
Copy link
Copy Markdown
Contributor

Summary

  • Remove hardcoded foundry-mcp and tavily-mcp from the sandbox Docker image and compose files, making sandboxes "empty" by default
  • Add a user-configurable skills system (~/.sandboxes/skills.toml) that lets users define what tools, MCP servers, permissions, environment variables, and stubs to install into sandboxes
  • Add CLI commands (cast skills list|show|init) for managing skill configurations

Details

Removed

  • pip install foundry-mcp and npm install tavily-mcp from Dockerfile
  • TAVILY_API_KEY, PERPLEXITY_API_KEY, SEMANTIC_SCHOLAR_API_KEY env vars from compose files
  • prepopulate_foundry_global(), research provider config, and default hooks from foundry_plugin.py
  • foundry_upgrade.py internals (stubbed to no-op)
  • ensure_opencode_tavily_mcp() from tool_configs.py
  • .foundry-mcp.toml and lib/python/ensure_opencode_tavily.py
  • Hardcoded content from stubs/CLAUDE.md and stubs/AGENTS.md (now skill-controlled)

Added

  • foundry_sandbox/skills.py — loads TOML config, resolves env vars, generates Docker mounts/env/permissions, installs MCP servers + stubs into containers
  • foundry_sandbox/commands/skills_cmd.pycast skills list|show|init
  • --skill flag on cast new (replaces --pre-foundry), multi-select in wizard
  • Per-skill permission merging in permissions.py
  • HTML comment markers for idempotent stub installation
  • Skills documentation in docs/configuration.md
  • ~700 lines of new tests + all existing tests updated

Example skills.toml

[skills.my-research-tool]
mount = "~/GitHub/my-research-tool"
stub = "~/GitHub/my-research-tool/SANDBOX_STUB.md"

[skills.my-research-tool.mcp.my-server]
command = "python"
args = ["-m", "my_server"]

[skills.my-research-tool.permissions]
allow = ["Bash(python -m my_tool:*)"]

Test plan

  • Run ./scripts/ci-local.sh to verify all unit tests pass
  • Create a sandbox with cast new --skill <name> and verify skill installation
  • Verify cast skills init creates a valid example config
  • Verify old sandboxes (pre-skills) still start without errors

🤖 Generated with Claude Code

Remove hardcoded foundry-mcp and tavily-mcp from the sandbox image and
replace them with a generic skills system that lets users define what
tools, MCP servers, permissions, and stubs to install.

Skills are configured in ~/.sandboxes/skills.toml and selected at
sandbox creation time via `cast new --skill <name>` or the setup wizard.

What changed:
- Remove foundry-mcp pip install and tavily-mcp npm install from Dockerfile
- Remove TAVILY/PERPLEXITY/SEMANTIC_SCHOLAR env vars from compose files
- Gut foundry_plugin.py (remove prepopulate, research providers, hooks)
- Stub out foundry_upgrade.py (no longer needed)
- Add skills.py: load TOML config, resolve env vars, generate mounts/env/
  permissions, install MCP servers + stubs into containers
- Add skills_cmd.py: `cast skills list|show|init` CLI commands
- Update new/start/wizard commands to use --skill instead of --pre-foundry
- Update state persistence (metadata.skills replaces pre_foundry)
- Update permissions.py to accept per-skill allow/deny lists
- Update stub_manager.py to use HTML comment markers for idempotency
- Empty stubs/CLAUDE.md and stubs/AGENTS.md (now skill-controlled)
- Update docs/configuration.md with skills documentation
- Update all tests (~700 lines new, all existing tests updated)

Co-Authored-By: Claude Opus 4.6 <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