К основному содержанию
субагент GitHub Copilot официальный · GitHub

Go MCP Server Development Expert — субагент для GitHub Copilot

Субагент помогает создавать MCP-серверы на Go через пакет github.com/modelcontextprotocol/go-sdk. Пригодится для настройки инструментов, ресурсов и промптов.

Установить в GitHub Copilot · Вручную: положить файлы Все способы и платформы ↓
.github/agents/go-mcp-expert.agent.md
Открыть на GitHub

Что делает Go MCP Server Development Expert

Субагент генерирует код серверов Model Context Protocol на Go с помощью официального пакета github.com/modelcontextprotocol/go-sdk/mcp. Он инициализирует сервер через mcp.NewServer(), подключает StdioTransport или HTTPTransport и регистрирует обработчики. Для входных и выходных данных ассистент использует Go-структуры с тегами json и jsonschema.

В логику сразу закладывается проверка контекста через ctx.Err(). Ошибки оборачиваются конструкцией fmt.Errorf("%w", err). Для завершения работы сервера применяется перехват системных сигналов. Код выдается сразу с импортами и табличными тестами.

Ставить субагент стоит разработчикам, которые пишут серверы MCP на Go. Если проект написан на другом языке, этот помощник будет бесполезен.

Какие задачи решает

  • Создать MCP-сервер на Go через mcp.NewServer()
  • Зарегистрировать типизированный инструмент через mcp.AddTool()
  • Настроить передачу данных через StdioTransport или HTTPTransport
  • Написать табличные тесты для обработчиков MCP
  • Добавить обработку отмены контекста через ctx.Err()

Примеры запросов агенту

  • Создай инструмент MCP для чтения файлов с валидацией через jsonschema
  • Настрой сервер mcp.NewServer с поддержкой StdioTransport и graceful shutdown
  • Напиши юнит-тесты для обработчика mcp.AddResource

Как установить Go MCP Server Development Expert

Вручную: положить файлы

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

Из того же набора554

Весь набор →
git-commit официальный github Скилл разбирает изменения Git, выбирает связанные файлы и создаёт коммит в формате Conventional Commits. Пригодится, когда нужно закоммитить одну или несколько логических частей изменений. GitHub Copilot 47 165установок excalidraw-diagram-generator официальный github Скилл превращает описание на обычном языке в диаграмму Excalidraw. Подойдёт, когда нужно показать процесс, связи между объектами или устройство системы. GitHub Copilot 31 639установок multi-stage-dockerfile официальный github Скилл помогает создавать многоэтапные Dockerfile для разных языков и фреймворков. Пригодится, когда важны размер и состав runtime-образа. GitHub Copilot 29 688установок documentation-writer официальный github Скилл для создания технической документации по фреймворку Diátaxis: туториалы, гайды, справки и объяснения. Предлагает структуру перед написанием. GitHub Copilot 27 757установок prd официальный github Собирает из идеи структурированный PRD с пользовательскими историями, техническими требованиями и рисками. Подходит для планирования новых функций, в том числе с AI. GitHub Copilot 24 035установок refactor официальный github Скилл помогает менять структуру кода без изменения внешнего поведения. Подойдёт для постепенной уборки сложных функций, дублирования и кодовых запахов. GitHub Copilot 22 321установок java-springboot официальный github Задаёт практики разработки Spring Boot-приложений: от структуры проекта до тестов и безопасности. Пригодится, когда Copilot пишет или проверяет Java-код. GitHub Copilot 21 272установок create-readme официальный github Скилл изучает проект и создаёт структурированный README.md. Подойдёт, когда документацию нужно собрать по коду и файлам проекта. GitHub Copilot 19 081установок

Похожие

rails-expert VoltAgent Community Настраивает архитектуру под Rails 7.x или 8.x по данным Gemfile.lock. Помогает с Hotwire, очередями Solid Queue, миграциями и тестами. Claude Code 199установок dotnet-framework-4.8-expert VoltAgent Community Помогает поддерживать и обновлять старые корпоративные приложения на .NET Framework 4.8. Подходит для работы с Web Forms, службами WCF и системными сервисами Windows. Claude Code 187установок elixir-expert VoltAgent Community Разбирает архитектуру Elixir-проекта и помогает менять код с опорой на OTP, Phoenix и Ecto. Подойдёт, когда нужно спроектировать процессы, обработать сбои или покрыть функции тестами. Claude Code 167установок fullstack-developer VoltAgent Community Субагент ведёт фичу через базу данных, API и frontend как единую задачу. Подходит для сквозной разработки с общей логикой и тестами. Claude Code 18 117установок python-pro VoltAgent Community Субагент пишет типобезопасный Python-код для веб API, системных утилит и сложных приложений. Пригодится для async-задач и проектов с высокими требованиями к типам. Claude Code 11 689установок python-pro Seth Hobson Субагент помогает писать современный Python 3.12+, разбирать async-код, тесты, API и производительность. Подойдёт для разработки и рефакторинга Python-проектов. Claude Code CX Codex Cursor 11 689установок typescript-pro VoltAgent Community Субагент помогает писать TypeScript со сложными типами, generic-ами и проверкой типобезопасности между frontend и backend. Пригодится для крупных типизированных модулей. Claude Code 9 602установок ai-engineer Seth Hobson Субагент проектирует LLM-приложения, RAG-системы и AI-агентов. Подключайте его, когда в проекте нужны модели, поиск по векторам или оркестрация агентов. Claude Code CX Codex Cursor 7 687установок

Вопросы о Go MCP Server Development Expert

Как установить Go MCP Server Development Expert в GitHub Copilot?

Сохраните файл конфигурации субагента по пути .cursor/agents/go-mcp-expert.md, .claude/agents/go-mcp-expert.md или .codex/agents/go-mcp-expert.md в зависимости от используемого редактора.

Какой SDK использует этот субагент?

Он ориентирован на официальную библиотеку github.com/modelcontextprotocol/go-sdk/mcp.

Какая модель лежит в основе субагента?

В конфигурационном файле субагента прописана модель GPT-4.1.

Исходный текст

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

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой