github cexll/agentsdk-go 0.2

latest releases: v0.6.4, v0.6.3, v0.6.2...
one month ago

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.json for MCP servers
  • Kept zero-dependency core design

Breaking Changes ⚠️

  • RegisterMCPServer(ctx, serverPath) now requires context.Context
  • pkg/mcp/adapter removed - use official SDK or mcp.NewSpecClient (deprecated)
  • Response.ProjectConfig deprecated - use Response.Settings (removed in v0.3.0)

Quick Migration 🔧

# Update dependency
go get github.com/cexll/agentsdk-go@v0.2.0
go mod tidy

Update 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.1.0...v0.2.0


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.Context
  • pkg/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 包全部通过

完整变更日志

v0.1.0...v0.2.0


Don't miss a new agentsdk-go release

NewReleases is sending notifications on new releases.