go-mcp-server-generator

Generate a complete Go MCP server project with typed tools, configuration, and tests.

Updated Aug 28, 2026
One-click install
npx skills add https://github.com/miyake-san/sogo-agent-platform --skill go-mcp-server-generator-miyake-san
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-mcp-server-generator
Source: https://github.com/miyake-san/sogo-agent-platform/tree/main/skills/core/go-mcp-server-generator
Command: npx skills add https://github.com/miyake-san/sogo-agent-platform --skill go-mcp-server-generator-miyake-san

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Scaffolding a Model Context Protocol server in Go from scratch requires wiring up the official SDK, transports, typed tool handlers, configuration, and tests, which is repetitive and error-prone when done manually. ## Core Features & Use Cases - Full Project Scaffolding: Generates go.mod, main.go, tools, config, README, and test files following a standard Go module layout. - Typed Tool Handlers: Creates tools with struct-based inputs and outputs using JSON schema tags, input validation, and context cancellation checks. - Production Conventions: Includes graceful shutdown via signal handling, environment-based configuration, and stdio transport setup using github.com/modelcontextprotocol/go-sdk. - Use Case: Ask the agent to generate an MCP server exposing two custom tools, then build and run it locally over stdio to connect it to an MCP-compatible client. ## Quick Start Generate a Go MCP server project named weather-tools with two typed tools, configuration via environment variables, and a basic test suite.

Frequently Asked Questions about go-mcp-server-generator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an MCP server in Go?

Use the official github.com/modelcontextprotocol/go-sdk to create a server with mcp.NewServer, register tools via mcp.AddTool with typed input and output structs, and run it over a stdio transport. The generated project includes main.go, a tools package, and configuration scaffolding.

How do I define typed tool inputs and outputs for a Go MCP server?

Define Go structs with json and jsonschema struct tags marking required fields and descriptions. The SDK uses these tags to expose schemas to MCP clients, and handlers receive the decoded struct directly.

What Go version is required for the MCP Go SDK?

The generated go.mod targets Go 1.23 with the github.com/modelcontextprotocol/go-sdk dependency. You need a working Go toolchain installed to build and run the generated server.

Does the Go MCP server support transports other than stdio?

The generated template defaults to mcp.StdioTransport, which is the standard for local MCP clients. The instructions note that alternative transports can be documented, but stdio is the configured default.

How do I test MCP tool handlers in Go?

Call the tool handler function directly with a context and a typed input struct, then assert on the returned output struct and error. The generated main_test.go shows a table-style test for a sample tool handler.