MCP.so
登录

MCP Go SDK

@SetiabudiResearch

基本信息

分类

开发工具

传输方式

stdio

作者

SetiabudiResearch

关于 MCP Go SDK

This SDK provides a Go implementation of the Machine Control Protocol (MCP), enabling bidirectional communication between clients and servers for tool execution, resource access, and prompt handling. Based on

#mcp#go-sdk#machine-control-protocol

MCP Go SDK 配置

暂无标准配置

该服务器的 README 中没有可解析的 MCP 配置块,请前往代码仓库查看安装说明。

代码仓库

MCP Go SDK 工具

工具列表暂未提供

当前收录暂时没有可展示的工具列表,不代表服务没有工具。请查阅项目文档了解支持的能力。

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is MCP Go SDK?

The MCP Go SDK provides a Go implementation of the Model Context Protocol (MCP), enabling bidirectional communication between clients and servers for tool execution, resource access, and prompt handling. It is designed for Go developers building MCP-compatible applications.

How to use MCP Go SDK?

Install the SDK with go get github.com/SetiabudiResearch/mcp-go-sdk. Then create a server instance using server.NewServer(), add tools, resources, or prompts using the provided methods, and start a transport (stdio, WebSocket, or SSE). See the Quick Start section for a minimal example.

Key features of MCP Go SDK

  • Multiple transport options: stdio, SSE, WebSocket
  • Tool registration with both sync and async execution
  • Resource pattern matching (e.g., files/{path})
  • Prompt template rendering and multi-message prompts
  • JSON-RPC message handling with core MCP types
  • Reflection-based handler invocation

Use cases of MCP Go SDK

  • Build custom MCP servers exposing tools and resources
  • Create a file server that serves files via MCP (see examples/fileserver)
  • Implement a calculator service as an MCP tool (see examples/calculator)
  • Develop an interactive chatbot using MCP prompts (see examples/chatbot)

常见问题

1

What transports does the MCP Go SDK support?

It supports stdio, WebSocket, and Server-Sent Events (SSE) transports, each configurable with endpoints and settings.

2

How do I add a tool to the server?

Use `srv.AddTool()` for synchronous tools or `srv.AddAsyncTool()` for long-running operations, providing a name, handler function, and description.

3

What are the runtime dependencies?

The SDK depends only on the Go standard library and the module itself; it is a pure Go implementation.

4

Can I access resources with dynamic paths?

Yes, resources support pattern matching like `files/{path}` or `api/{version}/{endpoint}` with multiple parameters.

5

Are there complete example applications?

Yes, the repository contains an `examples` directory with a file server, calculator, and chatbot examples.

评论

开发工具 分类下的更多 MCP 服务器