![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
github.com/MeGaGrindStone/go-mcp
A Go implementation of the Model Context Protocol (MCP) - an open protocol that enables seamless integration between LLM applications and external data sources and tools.
⚠️ Warning: The main branch contains unreleased changes and may be unstable. We recommend using the latest tagged release for stability. This library follows semantic versioning - breaking changes may be introduced with minor version bumps (0.x.0) until v1.0.0 is released. After v1.0.0, the API will be stable and breaking changes will only occur in major version updates. We recommend pinning your dependency to a specific version and reviewing the changelog before upgrading.
This repository provides a Go library implementing the Model Context Protocol (MCP) following the official specification.
go get github.com/MegaGrindStone/go-mcp
There are two main approaches to implementing an go-mcp
server:
type MyMCPServer struct{}
func (MyMCPServer) Info() mcp.Info {
return mcp.Info{
Name: "my-mcp-server",
Version: "1.0",
}
}
func (MyMCPServer) RequireRootsListClient() bool {
return false
}
func (MyMCPServer) RequireSamplingClient() bool {
return false
}
go-mcp
supports two transport options:
sseSrv := mcp.NewSSEServer()
go mcp.Serve(ctx, MyMCPServer{}, sseSrv)
// Set up HTTP handlers
http.HandleFunc("/sse", sseSrv.HandleSSE())
http.HandleFunc("/message", sseSrv.HandleMessage())
http.ListenAndServe(":8080", nil)
stdIOSrv := mcp.NewStdIO(os.Stdin, os.Stdout)
go mcp.Serve(ctx, MyMCPServer{}, stdIOSrv)
// Create client info
info := mcp.Info{
Name: "my-mcp-client",
Version: "1.0",
}
// Choose transport layer - SSE or Standard IO
// Option 1: Server-Sent Events (SSE)
sseClient := mcp.NewSSEClient("http://localhost:8080/sse", http.DefaultClient)
cli := mcp.NewClient(info, sseClient)
// Option 2: Standard IO
srvReader, srvWriter := io.Pipe()
cliReader, cliWriter := io.Pipe()
cliIO := mcp.NewStdIO(cliReader, srvWriter)
srvIO := mcp.NewStdIO(srvReader, cliWriter)
cli := mcp.NewClient(info, cliIO)
// Connect client
if err := cli.Connect(); err != nil {
log.Fatal(err)
}
defer cli.Close()
// List available tools
tools, err := cli.ListTools(ctx, mcp.ListToolsParams{})
if err != nil {
log.Fatal(err)
}
// Call a tool
result, err := cli.CallTool(ctx, mcp.CallToolParams{
Name: "echo",
Arguments: map[string]any{
"message": "Hello MCP!",
},
})
if err != nil {
log.Fatal(err)
}
For complete working examples:
example/everything/
for a comprehensive server and client implementation with all featuresexample/filesystem/
for a focused example of file operations using Standard IO transportThese examples demonstrate:
For more details, check the example directory in the repository.
The servers
directory contains reference server implementations that mirror those found in the official modelcontextprotocol/servers repository.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.