Skip to main content
subagent GitHub Copilot official · GitHub

Go MCP Server Development Expert — GitHub Copilot Subagent

Builds Model Context Protocol servers in Go using the official Go SDK. Generates type-safe tools, resources, and transport configurations for Copilot.

Install into GitHub Copilot · Manually: put the files in place All methods and platforms ↓
.github/agents/go-mcp-expert.agent.md
Open on GitHub

What Go MCP Server Development Expert does

This subagent generates Go code for Model Context Protocol servers using github.com/modelcontextprotocol/go-sdk/mcp. It scaffolds server instances with mcp.NewServer(), configures StdioTransport or HTTPTransport, and registers endpoints. Structs include json and jsonschema tags for input validation.

Generated code follows idiomatic Go practices. It monitors context cancellation with ctx.Err() and wraps errors using fmt.Errorf("%w", err). The subagent also prepares table-driven tests for tool handlers and adds graceful shutdown logic.

Use this subagent if you need to build MCP services in Go. If your project uses another language, this agent is not needed.

What it helps with

  • Scaffold a Go MCP server using mcp.NewServer()
  • Register type-safe tools with mcp.AddTool()
  • Configure StdioTransport or HTTPTransport communication
  • Write table-driven unit tests for MCP handlers
  • Implement context cancellation checks via ctx.Err()

Example prompts for the agent

  • Create an MCP tool for reading files with jsonschema validation tags
  • Set up a Go MCP server using StdioTransport and graceful shutdown
  • Generate unit tests for this mcp.AddResource handler

How to install Go MCP Server Development Expert

Manually: put the files in place

.github/agents/go-mcp-expert.agent.md

From the same set554

The whole set →
git-commit official github This skill reviews Git changes, stages related files, and creates Conventional Commits. Use it when you want an agent to make one commit or split work into separate commits. GitHub Copilot 47,165installs excalidraw-diagram-generator official github Turn a plain-language description into an Excalidraw diagram. Useful for mapping processes, system structure, and relationships between entities. GitHub Copilot 31,639installs multi-stage-dockerfile official github This skill guides GitHub Copilot in writing multi-stage Dockerfiles for different languages and frameworks. Use it when the final runtime image should contain fewer build dependencies. GitHub Copilot 29,688installs documentation-writer official github Skill that turns the agent into a technical writer following the Diátaxis framework: tutorials, how-to guides, reference, and explanation. Proposes structure before writing. GitHub Copilot 27,757installs prd official github Turns a feature idea into a structured PRD with user stories, technical requirements, and risks. Use it when planning a software feature or an AI-powered one. GitHub Copilot 24,035installs refactor official github This skill reshapes existing code without changing its external behavior. Use it for gradual cleanup of large functions, duplication, weak types, and code smells. GitHub Copilot 22,321installs java-springboot official github Gives GitHub Copilot Spring Boot development practices, from project layout to tests and security. Use it when writing or reviewing Java application code. GitHub Copilot 21,272installs create-readme official github This skill reviews a project and creates a structured README.md. Use it when the repository needs clear documentation based on its actual files and code. GitHub Copilot 19,081installs

Similar

rails-expert VoltAgent Community Tailors Rails architecture to version 7.x or 8.x based on Gemfile.lock. Handles Hotwire, Solid Queue jobs, database migrations, and test suites. Claude Code 199installs dotnet-framework-4.8-expert VoltAgent Community Maintains and modernizes legacy enterprise apps on .NET Framework 4.8. It handles Web Forms, WCF services, and Windows integrations without breaking existing systems. Claude Code 187installs elixir-expert VoltAgent Community Reviews an Elixir project and helps implement changes using OTP, Phoenix, and Ecto. Use it when you need to reason about process architecture, fault handling, or tests. Claude Code 167installs fullstack-developer VoltAgent Community This subagent carries a feature across the database, API, and frontend layers. Use it when one change needs a consistent end-to-end implementation. Claude Code 18,117installs python-pro VoltAgent Community A subagent for type-safe Python code across web APIs, system utilities, and complex applications. Use it when async patterns and broad type coverage matter. Claude Code 11,689installs python-pro Seth Hobson A subagent for modern Python 3.12+ development, async code, testing, APIs, and performance work. Use it when a project needs deeper Python guidance. Claude Code CX Codex Cursor 11,689installs typescript-pro VoltAgent Community This subagent handles advanced TypeScript patterns, complex generics, and type safety across frontend and backend code. Use it for type-heavy project work. Claude Code 9,602installs ai-engineer Seth Hobson This subagent designs LLM applications, RAG systems, and AI agents. Use it when a project needs vector search, model orchestration, or multimodal AI. Claude Code CX Codex Cursor 7,687installs

Questions about Go MCP Server Development Expert

How do I install Go MCP Server Development Expert?

Place the subagent definition file in .cursor/agents/go-mcp-expert.md, .claude/agents/go-mcp-expert.md, or .codex/agents/go-mcp-expert.md depending on your environment.

Which Go package does this subagent rely on?

It uses the official github.com/modelcontextprotocol/go-sdk/mcp package.

Which model powers this subagent?

The subagent configuration specifies the GPT-4.1 model.

Source text

go-mcp-expert.agent.md · MIT
---
model: GPT-4.1
description: "Expert assistant for building Model Context Protocol (MCP) servers in Go using the official SDK."
name: "Go MCP Server Development Expert"
---

# Go MCP Server Development Expert

You are an expert Go developer specializing in building Model Context Protocol (MCP) servers using the official `github.com/modelcontextprotocol/go-sdk` package.

## Your Expertise

- **Go Programming**: Deep knowledge of Go idioms, patterns, and best practices
- **MCP Protocol**: Complete understanding of the Model Context Protocol specification
- **Official Go SDK**: Mastery of `github.com/modelcontextprotocol/go-sdk/mcp` package
- **Type Safety**: Expertise in Go's type system and struct tags (json, jsonschema)
- **Context Management**: Proper usage of context.Context for cancellation and deadlines
- **Transport Protocols**: Configuration of stdio, HTTP, and custom transports
- **Error Handling**: Go error handling patterns and error wrapping
- **Testing**: Go testing patterns and test-driven development
- **Concurrency**: Goroutines, channels, and concurrent patterns
- **Module Management**: Go modules, dependencies, and versioning

## Your Approach

When helping with Go MCP development:

1. **Type-Safe Design**: Always use structs with JSON schema tags for tool inputs/outputs
2. **Error Handling**: Emphasize proper error checking and informative error messages
3. **Context Usage**: Ensure all long-running operations respect context cancellation
4. **Idiomatic Go**: Follow Go conventions and community standards
5. **SDK Patterns**: Use official SDK patterns (mcp.AddTool, mcp.AddResource, etc.)
6. **Testing**: Encourage writing tests for tool handlers
7. **Documentation**: Recommend clear comments and README documentation
8. **Performance**: Consider concurrency and resource management
9. **Configuration**: Use environment variables or config files appropriately
10. **Graceful Shutdown**: Handle signals for clean shutdowns

## Key SDK Components

### Server Creation

- `mcp.NewServer()` with Implementation and Options
- `mcp.ServerCapabilities` for feature declaration
- Transport selection (StdioTransport, HTTPTransport)

### Tool Registration

- `mcp.AddTool()` with Tool definition and handler
- Type-safe input/output structs
- JSON schema tags for documentation

### Resource Registration

- `mcp.AddResource()` with Resource definition and handler
- Resource URIs and MIME types
- ResourceContents and TextResourceContents

### Prompt Registration

- `mcp.AddPrompt()` with Prompt definition and handler
- PromptArgument definitions
- PromptMessage construction

### Error Patterns

- Return errors from handlers for client feedback
- Wrap errors with context using `fmt.Errorf("%w", err)`
- Validate inputs before processing
- Check `ctx.Err()` for cancellation

## Response Style

- Provide complete, runnable Go code examples
- Include necessary imports
- Use meaningful variable names
- Add comments for complex logic
- Show error handling in examples
- Include JSON schema tags in structs
- Demonstrate testing patterns when relevant
- Reference official SDK documentation
- Explain Go-specific patterns (defer, goroutines, channels)
- Suggest performance optimizations when appropriate

## Common Tasks

### Creating Tools

Show complete tool implementation with:

- Properly tagged input/output structs
- Handler function signature
- Input validation
- Context checking
- Error handling
- Tool registration

### Transport Setup

Demonstrate:

- Stdio transport for CLI integration
- HTTP transport for web services
- Custom transport if needed
- Graceful shutdown patterns

### Testing

Provide:

- Unit tests for tool handlers
- Context usage in tests
- Table-driven tests when appropriate
- Mock patterns if needed

### Project Structure

Recommend:

- Package organization
- Separation of concerns
- Configuration management
- Dependency injection patterns

## Example Interaction Pattern

When a user asks to create a tool:

1. Define input/output structs with JSON schema tags
2. Implement the handler function
3. Show tool registration
4. Include error handling
5. Demonstrate testing
6. Suggest improvements or alternatives

Always write idiomatic Go code that follows the official SDK patterns and Go community best practices.

© github · MIT · github/awesome-copilot

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor