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

MCP4GO
Un SDK GO integral para el Protocolo de contexto del modelo (MCP), simplificando el desarrollo de aplicaciones de IA abstraiendo las complejidades del protocolo.
1
Github Watches
2
Github Forks
5
Github Stars
MCP4Go
MCP4Go is a Go implementation of the Model Context Protocol (MCP), designed to simplify the development of AI applications by abstracting away protocol complexities.
Features
- Complete MCP protocol implementation in pure Go
- High-level abstractions for common MCP resources
- Pluggable architecture for custom extensions
- Comprehensive documentation and examples
- Production-ready with robust error handling
Installation
MCP4Go requires Go 1.18 or later. Install it using Go modules:
go get github.com/mcp4go/mcp4go
Getting Started
To get started with MCP4Go, import the package in your Go application:
package main
import (
"context"
"fmt"
"log"
"os"
"os/signal"
"syscall"
"time"
"github.com/mcp4go/mcp4go/pkg/logger"
"github.com/mcp4go/mcp4go/protocol"
"github.com/mcp4go/mcp4go/server"
"github.com/mcp4go/mcp4go/server/iface"
"github.com/mcp4go/mcp4go/server/transport"
_ "time/tzdata" // Load all time zones
)
func main() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
_logger := logger.DefaultLog
// Listen for interrupt signals for graceful exit
signalCh := make(chan os.Signal, 1)
signal.Notify(signalCh, os.Interrupt, syscall.SIGTERM)
go func() {
<-signalCh
_logger.Logf(ctx, logger.LevelWarn, "Received shutdown signal")
cancel()
}()
type timeRequest struct {
TimeZone string `json:"time_zone,omitempty" description:"time zone default is Asia/Shanghai"`
}
// Create standard input/output transport layer
stdioTransport := transport.NewStdioTransport()
// Create MCP server and configure options
srv, cleanup, err := server.NewServer(
stdioTransport,
server.WithServerInfo(protocol.Implementation{
Name: "time-mcp",
Version: "0.1.0",
}),
server.WithInstructions("Welcome to Time MCP! This server provides Time tools."),
server.WithToolBuilder(iface.NewFunctionalToolsBuilder(
iface.NewFunctionalToolWrapper(
"time",
"get current time",
func(ctx context.Context, args timeRequest) ([]protocol.Content, error) {
if args.TimeZone == "" {
args.TimeZone = "Asia/Shanghai"
}
getTimezoneTime := func(_ context.Context, timeZone string) time.Time {
if timeZone == "" {
timeZone = "Asia/Shanghai"
}
loc, err := time.LoadLocation(timeZone)
if err != nil {
return time.Now()
}
return time.Now().In(loc)
}
currentTime := getTimezoneTime(ctx, args.TimeZone)
return []protocol.Content{
protocol.NewTextContent(fmt.Sprintf("current time is %s", currentTime), nil),
}, nil
}),
)),
)
if err != nil {
log.Printf("Failed to create server: %v\n", err)
return
}
defer cleanup()
// Start the server
_logger.Logf(ctx, logger.LevelWarn, "Starting Time MCP server")
if err := srv.Run(ctx); err != nil {
_logger.Logf(ctx, logger.LevelError, "Server error: %v", err)
return
}
_logger.Logf(ctx, logger.LevelWarn, "Server shutdown complete")
}
Protocol Implementation
MCP4Go provides a complete implementation of the Model Context Protocol with support for:
- JSON-RPC communication
- Resource lifecycle management
- Prompt engineering
- Tool definitions and invocations
- Sampling parameters
- Logging and diagnostics
License
This project is licensed under the MIT License
Contributing
Contributions are welcome! Please see our Contributing Guide for more information.
相关推荐
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.
Advanced software engineer GPT that excels through nailing the basics.
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.
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.
Una lista curada de servidores de protocolo de contexto del modelo (MCP)
Reviews

user_WlxssEVa
MCP Server Go by DillonEnge is an outstanding server application that has significantly improved my workflow. Its streamlined design and user-friendly interface make it a pleasure to use. The setup was straightforward, and the performance has been rock-solid. Highly recommend checking it out at https://mcp.so/server/mcp-server-go/DillonEnge for anyone looking for a reliable server solution.