
Go Mcp Server Generator
Scaffold a production-style Go MCP server with github.com/modelcontextprotocol/go-sdk, typed tools, tests, and README from a single generator prompt.
Overview
Go MCP Server Generator is an agent skill for the Build phase that scaffolds a complete Go MCP server using the official modelcontextprotocol go-sdk with tools, tests, and docs.
Install
npx skills add https://github.com/github/awesome-copilot --skill go-mcp-server-generatorWhat is this skill?
- Emits full module layout: go.mod, main.go, tools/, resources/, config/, README.md, and main_test.go
- Requires official github.com/modelcontextprotocol/go-sdk v1.0.0 on Go 1.23 with configured transports
- Includes at least 2–3 useful tools with typed inputs and outputs plus basic test structure
- Covers graceful shutdown, context usage, and README setup instructions for local runs
- Project template includes 7 top-level areas: module, main, tools, resources, config, README, tests
- Requires at least 2–3 MCP tools with typed inputs and outputs
- Pins github.com/modelcontextprotocol/go-sdk v1.0.0 with Go 1.23
Adoption & trust: 8.5k installs on skills.sh; 34.6k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want custom MCP tools in Go but lack a consistent project skeleton, SDK wiring, and typed tool handlers.
Who is it for?
Solo developers standardizing on Go who need an SDK-aligned MCP server starter before adding domain-specific tools.
Skip if: Python or TypeScript MCP stacks, servers without the official go-sdk, or teams that only need a single throwaway script with no tests or module layout.
When should I use this skill?
You need a complete, production-ready Go MCP server project generated with proper structure, go-sdk dependencies, tools, and documentation.
What do I get? / Deliverables
You receive a buildable Go MCP server repo with configured transports, 2–3 starter tools, tests, and a README ready for local iteration and agent registration.
- Complete Go module with main.go and package layout
- 2–3 starter MCP tools plus optional resources package
- README with setup usage and main_test.go skeleton
Recommended Skills
Journey fit
Building MCP servers is core agent-tooling work during the Build phase when you extend Claude Code, Cursor, or Codex with custom capabilities. Agent-tooling is the canonical shelf for skills that emit MCP server projects rather than general backend CRUD features.
How it compares
Skill-packaged project generator for Go MCP—not a hosted MCP marketplace entry and not a generic REST API scaffold.
Common Questions / FAQ
Who is go-mcp-server-generator for?
Indie builders and agent developers who prefer Go and want a repeatable MCP server template with sdk transports, tools, and tests.
When should I use go-mcp-server-generator?
Use it during Build agent-tooling when you are adding a new MCP integration for Claude Code, Cursor, or Codex and need a full module before implementing business logic.
Is go-mcp-server-generator safe to install?
Generated servers may use network and stdio transports; review generated code and the Security Audits panel on this Prism page before running with production credentials.
SKILL.md
READMESKILL.md - Go Mcp Server Generator
# Go MCP Server Project Generator Generate a complete, production-ready Model Context Protocol (MCP) server project in Go. ## Project Requirements You will create a Go MCP server with: 1. **Project Structure**: Proper Go module layout 2. **Dependencies**: Official MCP SDK and necessary packages 3. **Server Setup**: Configured MCP server with transports 4. **Tools**: At least 2-3 useful tools with typed inputs/outputs 5. **Error Handling**: Proper error handling and context usage 6. **Documentation**: README with setup and usage instructions 7. **Testing**: Basic test structure ## Template Structure ``` myserver/ ├── go.mod ├── go.sum ├── main.go ├── tools/ │ ├── tool1.go │ └── tool2.go ├── resources/ │ └── resource1.go ├── config/ │ └── config.go ├── README.md └── main_test.go ``` ## go.mod Template ```go module github.com/yourusername/{{PROJECT_NAME}} go 1.23 require ( github.com/modelcontextprotocol/go-sdk v1.0.0 ) ``` ## main.go Template ```go package main import ( "context" "log" "os" "os/signal" "syscall" "github.com/modelcontextprotocol/go-sdk/mcp" "github.com/yourusername/{{PROJECT_NAME}}/config" "github.com/yourusername/{{PROJECT_NAME}}/tools" ) func main() { cfg := config.Load() ctx, cancel := context.WithCancel(context.Background()) defer cancel() // Handle graceful shutdown sigCh := make(chan os.Signal, 1) signal.Notify(sigCh, os.Interrupt, syscall.SIGTERM) go func() { <-sigCh log.Println("Shutting down...") cancel() }() // Create server server := mcp.NewServer( &mcp.Implementation{ Name: cfg.ServerName, Version: cfg.Version, }, &mcp.Options{ Capabilities: &mcp.ServerCapabilities{ Tools: &mcp.ToolsCapability{}, Resources: &mcp.ResourcesCapability{}, Prompts: &mcp.PromptsCapability{}, }, }, ) // Register tools tools.RegisterTools(server) // Run server transport := &mcp.StdioTransport{} if err := server.Run(ctx, transport); err != nil { log.Fatalf("Server error: %v", err) } } ``` ## tools/tool1.go Template ```go package tools import ( "context" "fmt" "github.com/modelcontextprotocol/go-sdk/mcp" ) type Tool1Input struct { Param1 string `json:"param1" jsonschema:"required,description=First parameter"` Param2 int `json:"param2,omitempty" jsonschema:"description=Optional second parameter"` } type Tool1Output struct { Result string `json:"result" jsonschema:"description=The result of the operation"` Status string `json:"status" jsonschema:"description=Operation status"` } func Tool1Handler(ctx context.Context, req *mcp.CallToolRequest, input Tool1Input) ( *mcp.CallToolResult, Tool1Output, error, ) { // Validate input if input.Param1 == "" { return nil, Tool1Output{}, fmt.Errorf("param1 is required") } // Check context if ctx.Err() != nil { return nil, Tool1Output{}, ctx.Err() } // Perform operation result := fmt.Sprintf("Processed: %s", input.Param1) return nil, Tool1Output{ Result: result, Status: "success", }, nil } func RegisterTool1(server *mcp.Server) { mcp.AddTool(server, &mcp.Tool{ Name: "tool1", Description: "Description of what tool1 does", }, Tool1Handler, ) } ``` ## tools/registry.go Template ```go package tools import "github.com/modelcontextprotocol/go-sdk/mcp" func RegisterTools(server *mcp.Server) { RegisterTool1(server) RegisterTool2(server) // Register additional tools here } ``` ## config/config.g