I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

mcp-go
Construir servidores del protocolo del contexto del modelo (MCP) en GO
1
Github Watches
3
Github Forks
29
Github Stars
MCP Go SDK
A Go implementation of the Model Context Protocol (MCP), providing both client and server capabilities for integrating with LLM surfaces.
Overview
The Model Context Protocol allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction. This Go SDK implements the full MCP specification, making it easy to:
- Build MCP clients that can connect to any MCP server
- Create MCP servers that expose resources, prompts and tools
- Use standard transports like stdio and SSE (coming soon)
- Handle all MCP protocol messages and lifecycle events
A small example
Curious what all this looks like in practice? Here's an example server that
exposes the contents of an io.FS
as resources.
package main
import (
"context"
"flag"
"io/fs"
"log"
"mime"
"os"
"path/filepath"
"strings"
"github.com/riza-io/mcp-go"
)
type FSServer struct {
fs fs.FS
mcp.UnimplementedServer
}
func (s *FSServer) Initialize(ctx context.Context, req *mcp.Request[mcp.InitializeRequest]) (*mcp.Response[mcp.InitializeResponse], error) {
return mcp.NewResponse(&mcp.InitializeResponse{
ProtocolVersion: req.Params.ProtocolVersion,
Capabilities: mcp.ServerCapabilities{
Resources: &mcp.Resources{},
},
}), nil
}
func (s *FSServer) ListResources(ctx context.Context, req *mcp.Request[mcp.ListResourcesRequest]) (*mcp.Response[mcp.ListResourcesResponse], error) {
var resources []mcp.Resource
fs.WalkDir(s.fs, ".", func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
if d.IsDir() {
return nil
}
resources = append(resources, mcp.Resource{
URI: "file://" + path,
Name: path,
MimeType: mime.TypeByExtension(filepath.Ext(path)),
})
return nil
})
return mcp.NewResponse(&mcp.ListResourcesResponse{
Resources: resources,
}), nil
}
func (s *FSServer) ReadResource(ctx context.Context, req *mcp.Request[mcp.ReadResourceRequest]) (*mcp.Response[mcp.ReadResourceResponse], error) {
contents, err := fs.ReadFile(s.fs, strings.TrimPrefix(req.Params.URI, "file://"))
if err != nil {
return nil, err
}
return mcp.NewResponse(&mcp.ReadResourceResponse{
Contents: []mcp.ResourceContent{
{
URI: req.Params.URI,
MimeType: mime.TypeByExtension(filepath.Ext(req.Params.URI)),
Text: string(contents), // TODO: base64 encode
},
},
}), nil
}
func main() {
flag.Parse()
root := flag.Arg(0)
if root == "" {
root = "/"
}
server := mcp.NewStdioServer(&FSServer{
fs: os.DirFS(root),
})
if err := server.Listen(context.Background(), os.Stdin, os.Stdout); err != nil {
log.Fatal(err)
}
}
You can compile this example and wire it up to Claude Desktop (or any other MCP client).
{
"mcpServers": {
"fs": {
"command": "/path/to/mcp-go-fs",
"args": [
"/path/to/root/directory"
]
}
}
}
Documentation
Roadmap
The majority of the base protocol is implemented. The following features are on our roadmap:
- Notifications
- Sampling
- Roots
Legal
Offered under the MIT license.
相关推荐
I find academic articles and books for research and literature reviews.
Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.
Confidential guide on numerology and astrology, based of GG33 Public information
Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.
Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.
Advanced software engineer GPT that excels through nailing the basics.
Converts Figma frames into front-end code for various mobile frameworks.
Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.
La aplicación AI de escritorio todo en uno y Docker con trapo incorporado, agentes de IA, creador de agentes sin código, compatibilidad de MCP y más.
Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx
Plataforma de automatización de flujo de trabajo de código justo con capacidades de IA nativas. Combine el edificio visual con código personalizado, auto-anfitrión o nube, más de 400 integraciones.
Espejo dehttps: //github.com/agentience/practices_mcp_server
🧑🚀 全世界最好的 llM 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Resumen de los mejores recursos del mundo.
Reviews

user_88Fpgix4
As a dedicated mcp application user, I highly recommend mcp-go by riza-io. This tool is impressively efficient and user-friendly, making any project seamless from start to finish. Its robust features and reliable performance have significantly streamlined my workflow. For those looking for a top-notch solution, mcp-go is definitely worth checking out! Find more information at https://github.com/riza-io/mcp-go.