v0.2.0 - MCP Official SDK Migration
Release Date: 2025-01-31
What's New 🚀
- Migrated to official MCP Go SDK
v1.1.0(-819 LOC custom adapter) - Added
runtime.Close()for proper MCP session cleanup - Auto-load
.claude/settings.jsonfor MCP servers - Kept zero-dependency core design
Breaking Changes ⚠️
RegisterMCPServer(ctx, serverPath)now requirescontext.Contextpkg/mcp/adapterremoved - use official SDK ormcp.NewSpecClient(deprecated)Response.ProjectConfigdeprecated - useResponse.Settings(removed in v0.3.0)
Quick Migration 🔧
# Update dependency
go get github.com/cexll/agentsdk-go@v0.2.0
go mod tidyUpdate code
- registry.RegisterMCPServer("stdio://cmd")
- ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
- defer cancel()
- registry.RegisterMCPServer(ctx, "stdio://cmd")
- response.ProjectConfig
- response.Settings
Add cleanup
- defer runtime.Close()
Stats 📊
- Code: 43 files, +2156 -4077 lines
- Net: -1921 lines (-32%)
- Coverage: 90.3% average
- Tests: ✅ 24/24 packages pass
Full Changelog
v0.2.0 - MCP 官方 SDK 迁移
发布日期: 2025-01-31
新特性 🚀
- 迁移到官方 MCP Go SDK
v1.1.0(删除 819 行自研 adapter) - 新增
runtime.Close()实现 MCP 会话清理 - 自动加载
.claude/settings.json中的 MCP 服务器 - 保持核心零依赖设计
破坏性变更 ⚠️
RegisterMCPServer(ctx, serverPath)现在需要context.Contextpkg/mcp/adapter已移除 - 改用官方 SDK 或mcp.NewSpecClient(已废弃)Response.ProjectConfig已废弃 - 使用Response.Settings(v0.3.0 将移除)
快速迁移 🔧
# 更新依赖
go get github.com/cexll/agentsdk-go@v0.2.0
go mod tidy更新代码
- registry.RegisterMCPServer("stdio://cmd")
- ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
- defer cancel()
- registry.RegisterMCPServer(ctx, "stdio://cmd")
- response.ProjectConfig
- response.Settings
添加清理逻辑
- defer runtime.Close()
统计数据 📊
- 代码变更: 43 个文件,+2156 -4077 行
- 净减少: -1921 行 (-32%)
- 覆盖率: 90.3% 平均
- 测试: ✅ 24/24 包全部通过
完整变更日志