MCP Go —— MCP 的 Go 实现
Model Context Protocol (MCP)的 Go 实现,实现 LLM 应用程序与外部数据源和工具之间的无缝集成。 package main import ( "context" "errors" "fmt" "github.com/mark3labs/mcp-go/mcp" "github.com/mark3labs/mcp-go/server" ) func main() { // Create MCP server s := server.NewMCPServer( "Demo 🚀", "1.0.0", ) // Add tool tool := mcp.NewTool("hello_world", mcp.WithDescription("Say hello to someone"), mcp.WithString("name", mcp.Required(), mcp.Description("Name of the person to greet"), ), ) // Add tool handler s.AddTool(tool, helloHandler...