aliatx2017/reasonix-hermes/go-mcp-server

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Build Go MCP (Model Context Protocol) servers — stdio/HTTP transport, JSON-RPC 2.0, concurrency, security, graceful shutdown. Covers patterns from Reasonix-Hermes bridge and memory server implementations.

Install

npx vskill@latest install aliatx2017/reasonix-hermes/go-mcp-server

SKILL.md

Go MCP Server Patterns

Patterns for building MCP servers in Go, drawn from Reasonix-Hermes's own cmd/reasonix-mcpbridge/ and cmd/reasonix-memoryserver/.

When to Use

  • Building a new MCP server in Go
  • Adding tools to an existing Go MCP server
  • Debugging MCP transport issues (stdio vs HTTP vs SSE)
  • Designing MCP server architecture for production use

Architecture

Transport Layer

Three transport options, choose based on deployment:

TransportWhenImplementation
stdioLocal subprocess (Claude Code, Reasonix plugin)os.Stdin/os.Stdout JSON-RPC
HTTPRemote server, REST-friendlynet/http handler, Bearer auth
SSEStreaming events from servertext/event-stream, long-lived connection
JSON-RPC 2.0

All transports use the same wire format:

go
// Request
type Request struct {
JSONRPC string `json:"jsonrpc"`
ID json.RawMessage `json:"id"`
Method string `json:"method"`
Params json.RawMessage `json:"params,omitempty"`
}
// Response
type Response struct {
JSONRPC string `json:"jsonrpc"`
ID json.RawMessage `json:"id"`
Result json.RawMessage `json:"result,omitempty"`
Error *Error `json:"error,omitempty"`
}
Tool Registration
go
type Tool struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema Schema `json:"inputSchema"`
}
type Server struct {
tools map[string]ToolHandler
mu sync.RWMutex
}
type ToolHandler func(ctx context.Context, args json.RawMessage) (json.RawMessage, error)

Concurrency

  • stdio: Single reader goroutine + single writer goroutine + mutex. JSON-RPC responses must be ordered.
  • HTTP: Standard net/http concurrency — each request in its own goroutine.
  • Batch safety: If supporting JSON-RPC batches, process sequentially or with result ordering.

Security

  • Bearer auth for HTTP transport (see pkg/httputil/auth.go)
  • Input validation — validate tool arguments against InputSchema before execution
  • Timeout — every tool handler should respect ctx.Done()
  • No secrets in logs — sanitize error messages, never log API keys

Graceful Shutdown

go
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM)
go func() {
<-sigCh
server.Shutdown(context.Background())
}()
server.Serve()

Testing

  • httptest for HTTP transport — mock server, test tool calls end-to-end
  • Table-driven tests for tool handlers — each tool should have success + error cases
  • Race detector — go test -race for concurrency testing

Reference Implementations

ComponentPathNotes
MCP bridge servercmd/reasonix-mcpbridge/6 tools, HTTP transport, Bearer auth
Memory servercmd/reasonix-memoryserver/3 tools, HTTP mode, SQLite backend
Shared authpkg/httputil/auth.goBearer token middleware
Shared MCP typespkg/mcputil/JSON-RPC types and server helpers
MCP clientinternal/plugin/stdio/HTTP/SSE client

Related

  • Project skill: native-mcp — MCP client patterns
  • Tool: install_source — install MCP servers from URL/source
  • docs/SPEC.md — MCP transport spec

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/aliatx2017/reasonix-hermes/go-mcp-server/badge)](https://verified-skill.com/skills/aliatx2017/reasonix-hermes/go-mcp-server)

Something wrong with this skill or its page? Tell us.