-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Agent 集成增强 - Session-First 架构、MCP Server 和技能库支持 #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Refactor the MCP server to use the official FastMCP SDK, providing a robust integration with comprehensive tools for sandbox interaction. Key changes: - Replace custom adapter with FastMCP implementation - Implement tools for Python/Shell execution and filesystem operations - Add `sandbox://info` resource - Support both stdio and HTTP transports via CLI arguments - Add `shipyard-mcp` CLI entry point - Add detailed MCP documentation and session-first architecture doc
Introduces a new package `@anthropic/shipyard-mcp` containing a Python-based Model Context Protocol (MCP) server that acts as a bridge to the Shipyard Bay API. - Implement core server logic in Python with tools for code execution and file operations - Create Node.js CLI wrapper (`shipyard-mcp`) for seamless distribution and launching - Support stdio transport protocol for integration with AI clients - Add comprehensive documentation including configuration guides for Claude Desktop, Cursor, and VS Code
Introduces the `Sandbox` class in the Python SDK for simplified container management and code execution. Refactors both the internal Bay MCP server and the standalone Python MCP server to use this new interface. Changes include: - Added `shipyard.Sandbox` with Python, Shell, and Filesystem components - Updated MCP servers to delegate operations to the SDK - Added `get_execution_history` tool for retrieving session history - Included fallback SDK implementation for standalone MCP server
Update session changelog to document recent architectural changes: - Detail the new `Sandbox` class as the primary SDK entry point. - Update MCP server architecture, component responsibilities, and tool definitions. - Correct the npm package name to `shipyard-mcp`. - Add usage examples for the simplified SDK interface.
Enable multi-client support by creating isolated Sandbox instances for each MCP session when running in HTTP transport mode. Previously, all clients shared a single Sandbox instance, leading to potential state pollution. Key changes: - Implement `get_or_create_sandbox` with session-based locking - Store Sandbox instances in FastMCP session state - Add automatic TTL renewal on tool activity and re-creation on expiry - Add `SHIPYARD_SANDBOX_TTL` environment variable (default: 30m) - Update standalone server to prefer FastMCP implementation when available - Document isolation architecture in changelog
- Add comprehensive test suite to verify session isolation, shared state within sessions, and variable isolation between clients in HTTP mode - Update pyproject.toml to correctly structure mcp optional dependencies and refresh uv.lock - Update README with detailed documentation on transport modes (stdio vs http), session isolation architecture, and CLI options
Add SHIPYARD_SANDBOX_TTL env var, document stdio vs HTTP behavior with per-session sandbox isolation, and include sandbox expiry troubleshooting. Update tool list with get_execution_history and adjust test command to use uv run pytest.
Add description/tags/notes to execution history (with Alembic migration) and propagate metadata through python/shell execution calls. Expose execution_id in exec responses, add get_execution/get_last_execution and annotate_execution via HTTP routes and MCP tools, and extend the SDK to support retrieval and annotation of execution records.
Extend execution history APIs and MCP tools to support filtering by comma-separated tags and by presence of notes/description, and include basic metadata in formatted history output.
Update MCP docs and session-first changelog with skill library support, including new execution lookup/annotation tools, execute_* metadata parameters, and enhanced history filtering options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @w31r4, your pull request is larger than the review limit of 150000 diff characters
Code reviewFound 1 issue:
shipyard/pkgs/bay/app/routes/sessions.py Lines 269 to 296 in 165aa77
Fix: Move the 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Move the /history/last route definition before /history/{execution_id}
to ensure literal paths are matched before parameterized ones.
Previously, requests to /history/last were incorrectly matched by
the parameterized route, treating "last" as an execution_id.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
概述
本次重构实现了三大核心功能,为 AI Agent 提供完整的沙箱执行环境:
1. Session-First 架构重构
2. MCP Server 集成
shipyard-mcp支持快速安装3. SDK 架构优化
4. 技能库增强(Skill Library)
基于 VOYAGER、Reflexion、LearnAct 论文需求,新增执行记录管理功能:
新增 MCP 工具:
get_execution(execution_id)- 按 ID 查询执行记录get_last_execution(exec_type)- 获取最近执行annotate_execution(execution_id, description, tags, notes)- 标注执行记录增强的工具参数:
execute_python/execute_shell: 新增include_code,description,tagsget_execution_history: 新增tags,has_notes,has_description过滤数据模型扩展:
description,tags,notes字段execution_id字段文件变更
pkgs/bay/pkgs/mcp-server/pkgs/ship/shipyard_python_sdk/docs/测试
参考文献
🤖 Generated with Claude Code