[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-73225":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":16,"starSnapshotCount":16,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},73225,"go-sdk","modelcontextprotocol\u002Fgo-sdk","modelcontextprotocol","The official Go SDK for Model Context Protocol servers and clients. Maintained in collaboration with Google.","https:\u002F\u002Fmodelcontextprotocol.io",null,"Go",4672,446,57,36,0,15,48,159,45,109.95,"Other",false,"main",true,[27,28],"go","mcp","2026-06-12 04:01:08","\u003C!-- Autogenerated by weave; DO NOT EDIT -->\n# MCP Go SDK\n\n[![Open in GitHub Codespaces](https:\u002F\u002Fgithub.com\u002Fcodespaces\u002Fbadge.svg)](https:\u002F\u002Fcodespaces.new\u002Fmodelcontextprotocol\u002Fgo-sdk)\n\n[![PkgGoDev](https:\u002F\u002Fpkg.go.dev\u002Fbadge\u002Fgithub.com\u002Fmodelcontextprotocol\u002Fgo-sdk)](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fmodelcontextprotocol\u002Fgo-sdk)\n[![OpenSSF Scorecard](https:\u002F\u002Fapi.scorecard.dev\u002Fprojects\u002Fgithub.com\u002Fmodelcontextprotocol\u002Fgo-sdk\u002Fbadge)](https:\u002F\u002Fscorecard.dev\u002Fviewer\u002F?uri=github.com\u002Fmodelcontextprotocol\u002Fgo-sdk)\n\nThis repository contains an implementation of the official Go software\ndevelopment kit (SDK) for the Model Context Protocol (MCP).\n\n## Package \u002F Feature documentation\n\nThe SDK consists of several importable packages:\n\n- The\n  [`github.com\u002Fmodelcontextprotocol\u002Fgo-sdk\u002Fmcp`](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fmodelcontextprotocol\u002Fgo-sdk\u002Fmcp)\n  package defines the primary APIs for constructing and using MCP clients and\n  servers.\n- The\n  [`github.com\u002Fmodelcontextprotocol\u002Fgo-sdk\u002Fjsonrpc`](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fmodelcontextprotocol\u002Fgo-sdk\u002Fjsonrpc) package is for users implementing\n  their own transports.\n- The\n  [`github.com\u002Fmodelcontextprotocol\u002Fgo-sdk\u002Fauth`](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fmodelcontextprotocol\u002Fgo-sdk\u002Fauth)\n  package provides some primitives for supporting OAuth.\n- The\n  [`github.com\u002Fmodelcontextprotocol\u002Fgo-sdk\u002Foauthex`](https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fmodelcontextprotocol\u002Fgo-sdk\u002Foauthex)\n  package provides extensions to the OAuth protocol, such as ProtectedResourceMetadata.\n\nThe SDK endeavors to implement the full MCP spec. The [`docs\u002F`](\u002Fdocs\u002F) directory\ncontains feature documentation, mapping the MCP spec to the packages above.\n\n## Version Compatibility\n\nThe following table shows which versions of the Go SDK support which versions of the MCP specification:\n\n| SDK Version     | Latest MCP Spec   | All Supported MCP Specs                            |\n|-----------------|-------------------|----------------------------------------------------|\n| v1.4.0+         | 2025-11-25\\*      | 2025-11-25\\*, 2025-06-18, 2025-03-26, 2024-11-05   |\n| v1.2.0 - v1.3.1 | 2025-11-25\\*\\*    | 2025-11-25\\*\\*, 2025-06-18, 2025-03-26, 2024-11-05 |\n| v1.0.0 - v1.1.0 | 2025-06-18        | 2025-06-18, 2025-03-26, 2024-11-05                 |\n\n\\* Client side OAuth has experimental support.\n\n\\*\\* Partial support for 2025-11-25 (client side OAuth and Sampling with tools not available).\n\nNew releases of the SDK target only supported versions of Go. See\nhttps:\u002F\u002Fgo.dev\u002Fdoc\u002Fdevel\u002Frelease#policy for more information.\n\n## Getting started\n\nTo get started creating an MCP server, create an `mcp.Server` instance, add\nfeatures to it, and then run it over an `mcp.Transport`. For example, this\nserver adds a single simple tool, and then connects it to clients over\nstdin\u002Fstdout:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com\u002Fmodelcontextprotocol\u002Fgo-sdk\u002Fmcp\"\n)\n\ntype Input struct {\n\tName string `json:\"name\" jsonschema:\"the name of the person to greet\"`\n}\n\ntype Output struct {\n\tGreeting string `json:\"greeting\" jsonschema:\"the greeting to tell to the user\"`\n}\n\nfunc SayHi(ctx context.Context, req *mcp.CallToolRequest, input Input) (\n\t*mcp.CallToolResult,\n\tOutput,\n\terror,\n) {\n\treturn nil, Output{Greeting: \"Hi \" + input.Name}, nil\n}\n\nfunc main() {\n\t\u002F\u002F Create a server with a single tool.\n\tserver := mcp.NewServer(&mcp.Implementation{Name: \"greeter\", Version: \"v1.0.0\"}, nil)\n\tmcp.AddTool(server, &mcp.Tool{Name: \"greet\", Description: \"say hi\"}, SayHi)\n\t\u002F\u002F Run the server over stdin\u002Fstdout, until the client disconnects.\n\tif err := server.Run(context.Background(), &mcp.StdioTransport{}); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\nTo communicate with that server, create an `mcp.Client` and connect it to the\ncorresponding server, by running the server command and communicating over its\nstdin\u002Fstdout:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\u002Fexec\"\n\n\t\"github.com\u002Fmodelcontextprotocol\u002Fgo-sdk\u002Fmcp\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\t\u002F\u002F Create a new client, with no features.\n\tclient := mcp.NewClient(&mcp.Implementation{Name: \"mcp-client\", Version: \"v1.0.0\"}, nil)\n\n\t\u002F\u002F Connect to a server over stdin\u002Fstdout.\n\ttransport := &mcp.CommandTransport{Command: exec.Command(\"myserver\")}\n\tsession, err := client.Connect(ctx, transport, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer session.Close()\n\n\t\u002F\u002F Call a tool on the server.\n\tparams := &mcp.CallToolParams{\n\t\tName:      \"greet\",\n\t\tArguments: map[string]any{\"name\": \"you\"},\n\t}\n\tres, err := session.CallTool(ctx, params)\n\tif err != nil {\n\t\tlog.Fatalf(\"CallTool failed: %v\", err)\n\t}\n\tif res.IsError {\n\t\tlog.Fatal(\"tool failed\")\n\t}\n\tfor _, c := range res.Content {\n\t\tlog.Print(c.(*mcp.TextContent).Text)\n\t}\n}\n```\n\nThe [`examples\u002F`](\u002Fexamples\u002F) directory contains more example clients and\nservers.\n\n## Contributing\n\nWe welcome contributions to the SDK! Please see\n[CONTRIBUTING.md](\u002FCONTRIBUTING.md) for details of how to contribute.\n\n## Acknowledgements \u002F Alternatives\n\nSeveral third party Go MCP SDKs inspired the development and design of this\nofficial SDK, and continue to be viable alternatives, notably\n[mcp-go](https:\u002F\u002Fgithub.com\u002Fmark3labs\u002Fmcp-go), originally authored by Ed Zynda.\nWe are grateful to Ed as well as the other contributors to mcp-go, and to\nauthors and contributors of other SDKs such as\n[mcp-golang](https:\u002F\u002Fgithub.com\u002Fmetoro-io\u002Fmcp-golang) and\n[go-mcp](https:\u002F\u002Fgithub.com\u002FThinkInAIXYZ\u002Fgo-mcp). Thanks to their work, there\nis a thriving ecosystem of Go MCP clients and servers.\n\n## License\n\nThis project is licensed under Apache 2.0 for new contributions, with existing\ncode under MIT - see the [LICENSE](.\u002FLICENSE) file for details.\n","modelcontextprotocol\u002Fgo-sdk 是Model Context Protocol (MCP) 的官方Go语言软件开发工具包，支持服务器和客户端的构建。该项目由Google合作维护，提供了一系列可导入的包，包括核心API、JSON-RPC传输实现、OAuth认证支持及OAuth扩展等，以帮助开发者全面实现MCP规范中的功能。该SDK特别适用于需要通过Go语言开发或集成MCP协议的应用场景，如构建复杂的微服务架构或增强现有应用的安全性和互操作性。此外，它还提供了版本兼容性指南，确保与不同版本的MCP规格保持一致。",2,"2026-06-11 03:44:36","high_star"]