Get the FREE Ultimate OpenClaw Setup Guide →

go

A Model Context Protocol (MCP) server implementation from scratch in Go. Made for learning purposes only

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio cbrgm-go-mcp-server go run ./cmd/go-mcp-server

How to use

This MCP server is a Go implementation that exposes a tea-themed Model Context Protocol (MCP) server. It provides Tools to query and manage a tea collection, Resources to read data like a tea menu, and Prompts to generate brewing guides or recommendations. The server supports multiple transports, including the default stdio channel and an HTTP transport with Server-Sent Events for streaming responses. You can interact with it using MCP Inspector or your preferred MCP client by sending MCP-compatible JSON-RPC messages to initialize, request tools, reads, or prompts.

Key capabilities include: listing available teas with getTeaNames, retrieving detailed tea information via getTeaInfo, filtering teas by type with getTeasByType, reading the tea menu from the tea resource, and requesting brewing guides, tea recommendations, or pairing suggestions through prompts. The example commands in the README show how to invoke these capabilities by sending JSON-RPC payloads to the server over stdio or HTTP, enabling you to compose rich, contextual tea interactions within your workflow.

How to install

Prerequisites:

  • Go (Golang) toolchain installed (1.18+ recommended)
  • Basic familiarity with building Go projects

Installation steps:

  1. Clone the repository: git clone https://github.com/your-org/go-mcp-server.git cd go-mcp-server

  2. Build the binary: go build ./cmd/go-mcp-server

    or to run directly without building a binary

    go run ./cmd/go-mcp-server

  3. Run the server (stdio transport by default): ./go-mcp-server

  4. (Optional) Run HTTP transport on a port: ./go-mcp-server -transport http -port 8080

  5. Verify with MCP Inspector or a client by sending an initialize request, for example: echo '{"jsonrpc":"2.0","method":"initialize","id":1}' | ./go-mcp-server

Notes:

  • The server defaults to stdio transport; use -transport http to enable HTTP with SSE streaming.
  • You can customize server-name and server-version via command line flags as shown in the README.
  • Adjust timeouts and logging with the provided flags for production use.

Additional notes

Tips and common scenarios:

  • If you enable the HTTP transport, a web status page is available at the server root (/) showing status, sessions, and endpoints.
  • The Tea collection exposes tools like getTeaNames, getTeaInfo, and getTeasByType. Use JSON-RPC payloads with method names under the tools namespace (e.g., tools/call).
  • Resources are available with read endpoints such as resources/read and can return details like a menu of teas from menu://tea.
  • Prompts include brewing_guide, tea_recommendation, and tea_pairing to generate contextual content based on inputs like tea_name or mood.
  • When testing locally, you can use the example payloads from the README to verify behavior (tools and prompts) via stdio or HTTP transport.
  • If you switch to HTTP, ensure the port you choose is open and not blocked by a firewall, and consider enabling -log-json for structured logs in production.

Related MCP Servers

Sponsor this space

Reach thousands of developers