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 生效
agent-sdk-go is a Go SDK for production AI agents — tools, MCP, A2A, human-in-the-loop approvals, and multi-agent delegation.
Every agent run on the Temporal runtime is a durable workflow: it survives process crashes and deploys, supports horizontal scaling, and is observable as a real service operation. This is the recommended runtime for production workloads where run durability matters. A running Temporal server is required.
The in-process runtime runs the agent loop directly in your process with no external dependencies — ideal for development, testing, and deployments where Temporal is not available. It has full feature parity: tools, MCP, A2A, sub-agents, streaming, AG-UI, approvals, conversation, and observability.
pkg/agent exposes three entry points — Run, Stream, and RunAsync. Add WithTemporalConfig or WithTemporalClient for the Temporal runtime; omit it for in-process. See Getting Started or Runtimes.
interfaces.LLMClient.interfaces.Tool; optional parallel vs sequential execution for multiple tool calls in one LLM round (WithAgentToolExecutionMode).Run, RunAsync, and Stream.WithConversation; in-memory store for in-process; in-memory and Redis for Temporal. Bring your own via interfaces.Conversation.WithSubAgents; recursive delegation with depth limiting; all sub-agent events fan in to the parent stream on both runtimes.WithMCPConfig or WithMCPClients.WithA2AConfig or WithA2AClients; or expose the agent itself as an A2A server via WithA2ADefaultServer / WithA2AServer and RunA2A.Retriever interface with built-in Weaviate and pgvector support; extend with your own implementation.Stream and WithStream.★ Temporal runtime only.
Go 1.26+ (see go.mod) and credentials for your LLM provider are always required.
go get and an LLM API key.Module: github.com/agenticenv/agent-sdk-go
go get github.com/agenticenv/agent-sdk-go@latest
Because every agent run is a Temporal workflow, the process can crash and restart without losing a single step — tool calls already made are not replayed, approvals already given are not re-requested, and the agent resumes exactly where it left off. DisableLocalWorker and NewAgentWorker let you split the client and execution across OS processes or machines while the cluster holds all state.
examples/durable_agent walks through this split across two terminals, including crash and retry scenarios. Step-by-step exercises: examples/durable_agent/README.md.
How to use the SDK—agents, LLMs, Temporal connection, examples.
Each LLM completion can report token counts via [interfaces.LLMUsage](pkg/interfaces/llm.go) on [interfaces.LLMResponse.Usage](pkg/interfaces/llm.go). OpenAI, Anthropic, and Gemini clients populate **PromptTokens**, **CompletionTokens**, **TotalTokens**, and optional **CachedPromptTokens** / **ReasoningTokens** when the provider returns them.
**Agent.Run / RunAsync: **Usage on *AgentRunResult is the sum across all LLM calls in that run (including tool rounds). Use it for cost estimates, quotas, and logging.**Stream:** the same aggregate appears as **Usage** on **RUN_FINISHED**: assert **[*AgentRunFinishedEvent](pkg/agent/agent.go)**, then **Result** as **[*AgentRunResult](pkg/agent/agent.go)**. OpenAI streaming **include_usage** surfaces totals there. Helpers: examples/shared/utils.go (UsageFooter, RunResultFromFinishedEvent).Examples: examples/simple_agent (prints usage after Run), examples/agent_with_stream (prints usage on **RUN_FINISHED**).
No WithObservabilityConfig, no WithTracer, no WithMetrics — the agent uses built-in no-op implementations. No extra imports or init code required.
A Temporal connection (WithTemporalConfig or WithTemporalClient) is optional — omit it to use the local runtime (in-process, no Temporal). Set it to use the Temporal runtime (durable execution). All other options work the same on both runtimes.
WithTaskQueue. Agent does not close the client.WithTemporalClient. Ignored when using WithTemporalConfig.&interfaces.ResponseFormat{Type, Name, Schema} for JSON with schema. See Response format.inmem for single process; redis for remote workers. Pass same conversationID to Run and Stream for a session. See Conversation.WithConversation is set.EnableRemoteWorkers() when using DisableLocalWorker with approval or streaming (starts the event worker/workflow path).Stream partial content streaming.**Run**, read **Usage** on **[*AgentRunResult](pkg/agent/agent.go)** when set. On **Stream**, assert **[*AgentRunFinishedEvent](pkg/agent/agent.go)** with **[*AgentRunResult](pkg/agent/agent.go)** in **Result** (aggregate across LLM/tool rounds when the provider reports it). See Token usage.&agent.LLMSampling{...}; nil or zero fields leave that knob to the provider default. Which fields apply where:**Temperature** — OpenAI, Anthropic, Gemini.**MaxTokens** — OpenAI, Anthropic, Gemini (max output / completion tokens).**TopP** — OpenAI, Gemini only (not sent to Anthropic).**TopK** — Anthropic only (not sent to OpenAI or Gemini).**Reasoning** (*interfaces.LLMReasoning) — optional generic controls; each LLM client maps them:**Enabled** — requests reasoning/thinking on providers that support it (see below).**Effort** — "none" … "xhigh"; OpenAI → reasoning_effort when non-empty; Gemini → ThinkingLevel when low / medium / high / minimal; Anthropic ignores (use `**BudBuild production-grade AI agents in Go — backed by Temporal for durable, crash-resilient execution, or run in-process with zero setup. See Capabilities for the full feature set.
Versioning: Semantic versioning; published lines are git tags (e.g. v0.1.2). See the latest release — the README does not pin a patch number so it stays accurate after each tag. Note: Independent community library — not affiliated with Temporal Technologies.
Demo applications that use agent-sdk-go end-to-end:
高质量的Go语言AI代理SDK,提供Temporal支持
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
经综合评估,Go代理SDK 在MCP工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | agent-sdk-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-07 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端