MCP Server Example (MCP Coffee Shop)
@BearHuddleston
MCP Server Example (MCP Coffee Shop) について
Example how to make a DIY MCP server in Go
基本情報
設定
以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。
{
"mcpServers": {
"go-mcp-server-example": {
"command": "docker",
"args": [
"build",
"-t",
"mcp-server",
"."
]
}
}
}ツール
2Get list of available drinks
Get detailed drink information
概要
What is MCP Server Example (MCP Coffee Shop)?
An MCP server implementation in Go that provides coffee shop information through tools, resources, and prompts. It supports stdio and HTTP with Server-Sent Events transports, follows Go project layout best practices, and is compliant with the MCP 2025-03-26 specification. Designed for developers building LLM-integrated coffee shop applications.
How to use MCP Server Example (MCP Coffee Shop)?
Build and run from source with Go 1.24+ (go build -o mcpserver ./cmd/mcpserver), or use Docker. Start with ./mcpserver for stdio transport (default), or ./mcpserver -transport http -port 8080 for HTTP. Customize via flags --transport, --port, and --request-timeout. Connect using the MCP Inspector for testing.
Key features of MCP Server Example (MCP Coffee Shop)
- MCP 2025-03-26 specification compliant
- Supports stdio and HTTP (SSE) transports
- Coffee shop domain: tools, resources, prompts
- Graceful shutdown and configurable timeouts
- Production ready: structured logging, error handling
Use cases of MCP Server Example (MCP Coffee Shop)
- List available drinks via the
getDrinkNamestool - Get detailed drink information with
getDrinkInfo - Retrieve the full coffee shop menu resource (
menu://app) - Get personalized drink recommendations through prompts
- Debug and test MCP integrations with MCP Inspector
FAQ from MCP Server Example (MCP Coffee Shop)
What transports does MCP Server Example (MCP Coffee Shop) support?
It supports stdio (default, compatible with MCP Inspector) and http with Server-Sent Events (SSE).
How can I run it with Docker?
Build the Docker image (docker build -t mcp-server .) and run with --transport http --port 8080 for HTTP or --transport stdio for stdio. Environment variables TRANSPORT and PORT are also supported.
What command‑line flags are available?
--transport (stdio/http, default stdio), --port (HTTP port, default 8080), and --request-timeout (duration, default 30s).
Does the server expose a health check endpoint?
Yes, when using HTTP transport, a GET /health endpoint is available.
What JSON‑RPC methods does the server implement?
It implements initialize, tools/list, tools/call, resources/list, resources/read, prompts/list, prompts/get, and ping.
「その他」の他のコンテンツ
MCP Registry
modelcontextprotocolA community driven registry service for Model Context Protocol (MCP) servers.
Nginx UI
0xJackyYet another WebUI for Nginx
🚀 Model Context Protocol (MCP) Curriculum for Beginners
microsoftThis open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable,
MCP Toolbox for Databases
googleapisMCP Toolbox for Databases is an open source MCP server for databases.
Awesome-MCP-ZH
yzflyMCP 资源精选, MCP指南,Claude MCP,MCP Servers, MCP Clients
コメント