
go-mcp-server-generator
✓ Official★ 36,200by github · part of github/awesome-copilot
Generate production-ready Go MCP server projects with proper structure, dependencies, and typed tool implementations. Scaffolds complete Go module layout with official MCP SDK integration, including main server setup, tool registration, and graceful shutdown handling Provides typed tool handlers with JSON schema validation, structured inputs/outputs, and context-aware error handling Includes configuration management via environment variables, basic test structure, and README documentation...
Generate production-ready Go MCP server projects with proper structure, dependencies, and typed tool implementations. Scaffolds complete Go module layout with official MCP SDK integration, including main server setup, tool registration, and graceful shutdown handling Provides typed tool handlers with JSON schema validation, structured inputs/outputs, and context-aware error handling Includes configuration management via environment variables, basic test structure, and README documentation...
Inspect the full instructions your agent will receiveExpandCollapse
This is the exact playbook injected into your agent when the skill activates — shown here so you can audit it before installing. You don't need to read it to use the skill.
by github
Generate production-ready Go MCP server projects with proper structure, dependencies, and typed tool implementations. Scaffolds complete Go module layout with official MCP SDK integration, including main server setup, tool registration, and graceful shutdown handling Provides typed tool handlers with JSON schema validation, structured inputs/outputs, and context-aware error handling Includes configuration management via environment variables, basic test structure, and README documentation...
npx skills add https://github.com/github/awesome-copilot --skill go-mcp-server-generator
Download ZIPGitHub36.2k
Go MCP Server Project Generator
Generate a complete, production-ready Model Context Protocol (MCP) server project in Go.
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
module github.com/yourusername/{{PROJECT_NAME}}
go 1.23
require (
github.com/modelcontextprotocol/go-sdk v1.0.0
)
main.go Template
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() {
When generating a Go MCP server:
- **Initialize Module**: Create `go.mod` with proper module path
- **Structure**: Follow the template directory structure
- **Type Safety**: Use structs with JSON schema tags for all inputs/outputs
- **Error Handling**: Validate inputs, check context, wrap errors
- **Documentation**: Add clear descriptions and examples
- **Testing**: Include at least one test per tool
- **Configuration**: Use environment variables for config
- **Logging**: Use structured logging (log/slog)
- **Graceful Shutdown**: Handle signals properly
- **Transport**: Default to stdio, document alternatives
## Best Practices
- Keep tools focused and single-purpose
- Use descriptive names for types and functions
- Include JSON schema documentation in struct tags
- Always respect context cancellation
- Return descriptive errors
- Keep main.go minimal, logic in packages
- Write tests for tool handlers
- Document all exported functionsnpx skills add https://github.com/github/awesome-copilot --skill go-mcp-server-generatorRun this in your project — your agent picks the skill up automatically.
Project Requirements
You will create a Go MCP server with:
-
Project Structure: Proper Go module layout
-
Dependencies: Official MCP SDK and necessary packages
-
Server Setup: Configured MCP server with transports
-
Tools: At least 2-3 useful tools with typed inputs/outputs
-
Error Handling: Proper error handling and context usage
-
Documentation: README with setup and usage instructions
-
Testing: Basic test structure
No common issues documented yet. If you hit a problem, the repository's GitHub Issues page is the best place to look.