Go代理SDK 是 AI Skill Hub 本期精选MCP工具之一。综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
Go代理SDK 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
Go代理SDK 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/agenticenv/agent-sdk-go
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"go--sdk": {
"command": "npx",
"args": ["-y", "agent-sdk-go"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 Go代理SDK 执行以下任务... Claude: [自动调用 Go代理SDK MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"go__sdk": {
"command": "npx",
"args": ["-y", "agent-sdk-go"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
interfaces.LLMClientWith*ExecutionConfiggo get github.com/agenticenv/agent-sdk-go@latest
Go 1.26+. No infrastructure required for in-process mode. A running Temporal or Restate server is required for durable execution — see temporal-setup.md and restate-setup.md.
In-process (zero setup):
import (
"context"
"fmt"
"time"
"github.com/agenticenv/agent-sdk-go/pkg/agent"
"github.com/agenticenv/agent-sdk-go/pkg/llm"
"github.com/agenticenv/agent-sdk-go/pkg/llm/openai"
)
// errors omitted for brevity
llmClient, _ := openai.NewClient(
llm.WithAPIKey("sk-..."),
llm.WithModel("gpt-4o"),
)
a, _ := agent.NewAgent(
agent.WithSystemPrompt("You are a helpful assistant."),
agent.WithLLMClient(llmClient),
)
defer a.Close()
// --- Run ---
run, _ := a.Run(context.Background(), "Reply with a short greeting.", nil)
result, _ := run.Get(context.Background())
fmt.Println(result.Content)
// --- Non-blocking ---
run, _ = a.Run(context.Background(), "Explain durable agents in two short paragraphs.", nil)
select {
case <-run.Done():
result, _ = run.Get(context.Background())
fmt.Println(result.Content)
case <-time.After(5 * time.Second):
fmt.Println("still running, check back later")
}
// --- Stream (AG-UI events: text deltas, tools, approvals, lifecycle, …) ---
stream, _ := a.Stream(context.Background(), "Write a four-line poem about the ocean.", nil)
events, _ := stream.Events(context.Background())
for event := range events {
switch e := event.(type) {
case *agent.AgentTextMessageContentEvent:
fmt.Print(e.Delta)
case *agent.AgentToolCallStartEvent:
fmt.Println("\n[tool call]", e.ToolCallName)
case *agent.AgentCustomEvent:
// tool / delegation approval (when approval policy requires it)
if e.Name == string(agent.AgentCustomEventNameToolApproval) {
if v, err := agent.ParseCustomEventApproval(e); err == nil {
// replace with real approval logic — this auto-approves for demonstration
_ = stream.Approve(context.Background(), v.ApprovalToken, agent.ApprovalStatusApproved)
}
}
// also RunFinished, ToolCallResult, …
}
}
Temporal (durable execution) — import pkg/agent/runtime/temporal:
import "github.com/agenticenv/agent-sdk-go/pkg/agent/runtime/temporal"
a, _ := agent.NewAgent(
agent.WithSystemPrompt("You are a helpful assistant."),
agent.WithLLMClient(llmClient),
temporal.WithTemporalConfig(&temporal.TemporalConfig{
Host: "localhost",
Port: 7233,
Namespace: "default",
TaskQueue: "agent-task-queue",
}),
)
defer a.Close()
// --- Run ---
run, _ := a.Run(context.Background(), "Reply with a short greeting.", nil)
result, _ := run.Get(context.Background())
fmt.Println(result.Content)
// --- Stream + reconnect ---
stream, _ := a.Stream(context.Background(), "Write a four-line poem about the ocean.", nil)
savedRunID := stream.ID() // persist before consuming events
events, _ := stream.Events(context.Background())
for event := range events {
// persist event.Offset() before handling — needed for WithOffset on reconnect
_ = event
}
savedOffset := int64(0)
s, _ := a.GetAgentStream(context.Background(), savedRunID)
ch, _ := s.Events(context.Background(), agent.WithOffset(savedOffset))
for event := range ch {
_ = event
}
Restate (durable execution) — import pkg/agent/runtime/restate (mutually exclusive with Temporal):
import "github.com/agenticenv/agent-sdk-go/pkg/agent/runtime/restate"
a, _ := agent.NewAgent(
agent.WithSystemPrompt("You are a helpful assistant."),
agent.WithLLMClient(llmClient),
restate.WithRestateConfig(&restate.RestateConfig{
Ingress: restate.IngressConfig{
URL: "http://localhost:8080",
},
Endpoint: restate.EndpointConfig{
ListenAddress: ":9080",
AdminURL: "http://localhost:9070",
},
}),
)
defer a.Close()
// Same Run / Stream / GetAgentStream + WithOffset APIs as Temporal
Crashes and process restarts don't have to mean lost work or missed approvals — see durable_agent/temporal (split worker) and durable_agent/restate (single process). For the stream reconnect protocol (GetAgentStream+WithOffset), see the reconnect example and Durable Execution.
Runnable examples in examples/ — see examples/README.md for setup and run instructions.
AI agents in Go that keep running even when your process doesn't — powered by Temporal or Restate.
Open-source Go SDK for building AI agents — run in-process with zero setup, or switch to Temporal / Restate for crash-resilient, distributed execution that survives restarts and deploys. Every core component is a pluggable interface, so nothing is locked in.
📖 Documentation · Quickstart · Examples
Releases follow Semantic Versioning; see the latest release. Independent community library — not affiliated with Temporal Technologies or Restate.
Download a binary from GitHub Releases, extract it, and put agctl on your PATH.
```bash export AGCTL_LLM_APIKEY=sk-your-key agctl run --model gpt-4o --prompt "hello"

**agent-sdk-go** 是一个用于生产 AI 代理的 Go SDK — 工具、MCP、A2A、人工审批和多代理委托。每个代理在 Temporal 运行时都是一条可持续的工作流:它可以在进程崩溃和部署时生存,支持水平扩展,并且可以作为一个真实的服务操作进行观察。
- **LLM 提供商** — OpenAI、Anthropic 和 Gemini 在箱子中可用;带来您自己的通过 `interfaces.LLMClient`。- **工具** — 注册内置或自定义工具通过 `interfaces.Tool`;可选的 **并行 vs 序列** 执行多个工具调用在一个 LLM 回合 (`WithAgentToolExecutionMode`) 中。- **人工审批** — 工具调用和委托的审批门控在 `Run`、`RunAsync` 和
**Go 1.26+** (参见 `go.mod`) 和您的 LLM 提供商的凭证始终是必需的。- **内存运行时**(默认):无需额外设置 — 只需 `go get` 和 LLM API 密钥即可。- **Temporal 运行时**:需要一个正在运行的 Temporal 服务器。参见 **[T
**安装可持续代理**:在进程崩溃和重启时不丢失任何步骤 — 已完成的工具调用不会重放,已批准的审批不会重新请求,代理会在离开的地方继续执行。`DisableLocalWorker` 和 `NewAgentWorker` 允许您将客户端和执行分离到 OS 进程或机器中,同时集群保留所有状态
**使用 SDK** — 代理、LLMs、Temporal 连接、示例
**配置**:默认值为无操作,零配置。无 `WithObservabilityConfig`、无 `WithTracer`、无 `WithMetrics` — 代理使用内置的无操作实现。无需额外导入或初始化代码
**agent-sdk-go Go API**:在 Go 中构建生产级 AI 代理 — 由 Temporal 支持可持续、崩溃可靠的执行,或者在内存中无需设置即可运行。参见 **[Capabilities](#capabilities)** 中的完整功能集。
高质量的Go语言AI代理SDK,提供Temporal支持
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
经综合评估,Go代理SDK 在MCP工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | agent-sdk-go |
| 原始描述 | 开源MCP工具:AI agents in Go — Temporal for durable, crash-resilient execution or run in-proc。⭐19 · Go |
| Topics | mcpa2aag-uiagent-sdkagent-sdk-goagenticgo |
| GitHub | https://github.com/agenticenv/agent-sdk-go |
| License | Apache-2.0 |
| 语言 | Go |
收录时间:2026-06-07 · 更新时间:2026-06-08 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端