Get the FREE Ultimate OpenClaw Setup Guide →

trpc -go

Go implementation of the Model Context Protocol (MCP) with comprehensive Streamable HTTP, STDIO, and SSE support.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio trpc-group-trpc-mcp-go docker run -i trpc-group/trpc-mcp-go:latest \
  --env MCP_PORT="Default port inside container (adjust if needed)" \
  --env MCP_LOG_LEVEL="info"

How to use

This MCP server provides a Go implementation of the Model Context Protocol (MCP) with streaming HTTP support. It exposes a Streamable HTTP transport (recommended) that allows clients to send JSON-RPC requests over HTTP with optional Server-Sent Events (SSE) for real-time updates, as well as a legacy SSE transport for older MCP clients. Tools can be registered and invoked with structured parameters, and responses can come as JSON or streamed content depending on the request. The server supports session management, progress notifications, and resource handling (text and binary) via RESTful interfaces, making it suitable for web services, multi-client deployments, and integration with web frontends or other services.

To use, run the MCP server and connect a client (Go, TS, Python, etc.) using the Streamable HTTP transport. You can initialize the session, list available tools, and call a tool with the appropriate parameters. If you need long-running operations or real-time feedback, enable SSE streaming to receive progress updates and results as events rather than waiting for a single JSON payload.

How to install

Prerequisites:

  • Docker or native Go tooling available on your system
  • If using Docker, Docker daemon must be running
  • Optional: Go installed if you plan to build from source instead of using a container

Installation steps (Docker-based):

  1. Pull and run the MCP server container (example): docker run -i trpc-group/trpc-mcp-go:latest

  2. If you prefer to build from source (Go):

    • Ensure Go is installed (https://golang.org/dl/)
    • Clone the repository or set up the module path
    • Navigate to the repository root and install dependencies
    • Build the server (example): go build ./...
    • Run the server (example, adjust as needed for your module layout): go run ./...
  3. Verify the server is listening on the expected port (default or configured via env).

Additional notes

Tips and common considerations:

  • Streamable HTTP is the recommended transport for production; it supports JSON-RPC and optional SSE streaming for real-time updates.
  • If you need backward compatibility with older MCP clients, you can rely on the SSE Transport (Legacy), though it is deprecated in favor of Streamable HTTP.
  • Use environment variables to tune server behavior, such as port, log level, and session management options.
  • When registering tools, provide clear descriptions and typed parameters to improve client experience and validation.
  • Ensure proper error handling in clients to deal with streaming responses and potential network interruptions.
  • For resource endpoints, confirm CORS settings if your clients are web-based.
  • In container deployments, consider exposing the proper ports and securing endpoints when integrating with external networks.

Related MCP Servers

Sponsor this space

Reach thousands of developers