diff --git a/README.chatmodes.md b/README.chatmodes.md index 32d39b2..d03ecaf 100644 --- a/README.chatmodes.md +++ b/README.chatmodes.md @@ -41,6 +41,7 @@ Custom chat modes define specific behaviors and tools for GitHub Copilot Chat, e | [Expert C++ software engineer mode instructions](chatmodes/expert-cpp-software-engineer.chatmode.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/chatmode?url=vscode%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fexpert-cpp-software-engineer.chatmode.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/chatmode?url=vscode-insiders%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fexpert-cpp-software-engineer.chatmode.md) | Provide expert C++ software engineering guidance using modern C++ and industry best practices. | | [Expert React Frontend Engineer Mode Instructions](chatmodes/expert-react-frontend-engineer.chatmode.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/chatmode?url=vscode%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fexpert-react-frontend-engineer.chatmode.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/chatmode?url=vscode-insiders%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fexpert-react-frontend-engineer.chatmode.md) | Provide expert React frontend engineering guidance using modern TypeScript and design patterns. | | [Gilfoyle Code Review Mode](chatmodes/gilfoyle.chatmode.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/chatmode?url=vscode%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fgilfoyle.chatmode.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/chatmode?url=vscode-insiders%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fgilfoyle.chatmode.md) | Code review and analysis with the sardonic wit and technical elitism of Bertram Gilfoyle from Silicon Valley. Prepare for brutal honesty about your code. | +| [Go MCP Server Development Expert](chatmodes/go-mcp-expert.chatmode.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/chatmode?url=vscode%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fgo-mcp-expert.chatmode.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/chatmode?url=vscode-insiders%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fgo-mcp-expert.chatmode.md) | Expert assistant for building Model Context Protocol (MCP) servers in Go using the official SDK. | | [GPT 5 Beast Mode](chatmodes/gpt-5-beast-mode.chatmode.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/chatmode?url=vscode%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fgpt-5-beast-mode.chatmode.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/chatmode?url=vscode-insiders%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fgpt-5-beast-mode.chatmode.md) | Beast Mode 2.0: A powerful autonomous agent tuned specifically for GPT-5 that can solve complex problems by using tools, conducting research, and iterating until the problem is fully resolved. | | [High-Level Big Picture Architect (HLBPA)](chatmodes/hlbpa.chatmode.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/chatmode?url=vscode%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fhlbpa.chatmode.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/chatmode?url=vscode-insiders%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fhlbpa.chatmode.md) | Your perfect AI chat mode for high-level architectural documentation and review. Perfect for targeted updates after a story or researching that legacy system when nobody remembers what it's supposed to be doing. | | [Idea Generator mode instructions](chatmodes/simple-app-idea-generator.chatmode.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/chatmode?url=vscode%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fsimple-app-idea-generator.chatmode.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/chatmode?url=vscode-insiders%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fsimple-app-idea-generator.chatmode.md) | Brainstorm and develop new application ideas through fun, interactive questioning until ready for specification creation. | diff --git a/README.collections.md b/README.collections.md index 4232b0e..b7a4230 100644 --- a/README.collections.md +++ b/README.collections.md @@ -22,6 +22,7 @@ Curated collections of related prompts, instructions, and chat modes organized a | [Database & Data Management](collections/database-data-management.md) | Database administration, SQL optimization, and data management tools for PostgreSQL, SQL Server, and general database development best practices. | 8 items | database, sql, postgresql, sql-server, dba, optimization, queries, data-management | | [DevOps On-Call](collections/devops-oncall.md) | A focused set of prompts, instructions, and a chat mode to help triage incidents and respond quickly with DevOps tools and Azure resources. | 5 items | devops, incident-response, oncall, azure | | [Frontend Web Development](collections/frontend-web-dev.md) | Essential prompts, instructions, and chat modes for modern frontend web development including React, Angular, Vue, TypeScript, and CSS frameworks. | 11 items | frontend, web, react, typescript, javascript, css, html, angular, vue | +| [Go MCP Server Development](collections/go-mcp-development.md) | Complete toolkit for building Model Context Protocol (MCP) servers in Go using the official github.com/modelcontextprotocol/go-sdk. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance. | 3 items | go, golang, mcp, model-context-protocol, server-development, sdk | | [Java Development](collections/java-development.md) | Comprehensive collection of prompts and instructions for Java development including Spring Boot, Quarkus, testing, documentation, and best practices. | 12 items | java, springboot, quarkus, jpa, junit, javadoc | | [Power Apps Code Apps Development](collections/power-apps-code-apps.md) | Complete toolkit for Power Apps Code Apps development including project scaffolding, development standards, and expert guidance for building code-first applications with Power Platform integration. | 3 items | power-apps, power-platform, typescript, react, code-apps, dataverse, connectors | | [Power BI Development](collections/power-bi-development.md) | Comprehensive Power BI development resources including data modeling, DAX optimization, performance tuning, visualization design, security best practices, and DevOps/ALM guidance for building enterprise-grade Power BI solutions. | 14 items | power-bi, dax, data-modeling, performance, visualization, security, devops, business-intelligence | diff --git a/README.instructions.md b/README.instructions.md index c17bcd9..55b9f8a 100644 --- a/README.instructions.md +++ b/README.instructions.md @@ -54,6 +54,7 @@ Team and project-specific instructions to enhance GitHub Copilot's behavior for | [Gilfoyle Code Review Instructions](instructions/gilfoyle-code-review.instructions.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fgilfoyle-code-review.instructions.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fgilfoyle-code-review.instructions.md) | Gilfoyle-style code review instructions that channel the sardonic technical supremacy of Silicon Valley's most arrogant systems architect. | | [GitHub Actions CI/CD Best Practices](instructions/github-actions-ci-cd-best-practices.instructions.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fgithub-actions-ci-cd-best-practices.instructions.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fgithub-actions-ci-cd-best-practices.instructions.md) | Comprehensive guide for building robust, secure, and efficient CI/CD pipelines using GitHub Actions. Covers workflow structure, jobs, steps, environment variables, secret management, caching, matrix strategies, testing, and deployment strategies. | | [Go Development Instructions](instructions/go.instructions.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fgo.instructions.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fgo.instructions.md) | Instructions for writing Go code following idiomatic Go practices and community standards | +| [Go MCP Server Development Guidelines](instructions/go-mcp-server.instructions.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fgo-mcp-server.instructions.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fgo-mcp-server.instructions.md) | Best practices and patterns for building Model Context Protocol (MCP) servers in Go using the official github.com/modelcontextprotocol/go-sdk package. | | [Guidance for Localization](instructions/localization.instructions.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Flocalization.instructions.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Flocalization.instructions.md) | Guidelines for localizing markdown documents | | [Instructions for accessibility](instructions/a11y.instructions.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fa11y.instructions.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fa11y.instructions.md) | Guidance for creating more accessible code | | [Java 11 to Java 17 Upgrade Guide](instructions/java-11-to-java-17-upgrade.instructions.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fjava-11-to-java-17-upgrade.instructions.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fjava-11-to-java-17-upgrade.instructions.md) | Comprehensive best practices for adopting new Java 17 features since the release of Java 11. | diff --git a/README.prompts.md b/README.prompts.md index e433bcc..1a7bcb6 100644 --- a/README.prompts.md +++ b/README.prompts.md @@ -63,6 +63,7 @@ Ready-to-use prompt templates for specific development scenarios and tasks, defi | [Git Flow Branch Creator](prompts/git-flow-branch-creator.prompt.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fgit-flow-branch-creator.prompt.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fgit-flow-branch-creator.prompt.md) | Intelligent Git Flow branch creator that analyzes git status/diff and creates appropriate branches following the nvie Git Flow branching model. | | [Github Copilot Starter](prompts/github-copilot-starter.prompt.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fgithub-copilot-starter.prompt.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fgithub-copilot-starter.prompt.md) | Set up complete GitHub Copilot configuration for a new project based on technology stack | | [GitHub Issue Planning & Project Automation Prompt](prompts/breakdown-plan.prompt.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fbreakdown-plan.prompt.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fbreakdown-plan.prompt.md) | Issue Planning and Automation prompt that generates comprehensive project plans with Epic > Feature > Story/Enabler > Test hierarchy, dependencies, priorities, and automated tracking. | +| [Go MCP Server Project Generator](prompts/go-mcp-server-generator.prompt.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fgo-mcp-server-generator.prompt.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fgo-mcp-server-generator.prompt.md) | Generate a complete Go MCP server project with proper structure, dependencies, and implementation using the official github.com/modelcontextprotocol/go-sdk. | | [Interactive Programming Nudge](prompts/remember-interactive-programming.prompt.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fremember-interactive-programming.prompt.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fremember-interactive-programming.prompt.md) | A micro-prompt that reminds the agent that it is an interactive programmer. Works great in Clojure when Copilot has access to the REPL (probably via Backseat Driver). Will work with any system that has a live REPL that the agent can use. Adapt the prompt with any specific reminders in your workflow and/or workspace. | | [Java Documentation (Javadoc) Best Practices](prompts/java-docs.prompt.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fjava-docs.prompt.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fjava-docs.prompt.md) | Ensure that Java types are documented with Javadoc comments and follow best practices for documentation. | | [Javascript Typescript Jest](prompts/javascript-typescript-jest.prompt.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fjavascript-typescript-jest.prompt.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fjavascript-typescript-jest.prompt.md) | Best practices for writing JavaScript/TypeScript tests using Jest, including mocking strategies, test structure, and common patterns. | diff --git a/chatmodes/go-mcp-expert.chatmode.md b/chatmodes/go-mcp-expert.chatmode.md new file mode 100644 index 0000000..35da98f --- /dev/null +++ b/chatmodes/go-mcp-expert.chatmode.md @@ -0,0 +1,122 @@ +--- +model: GPT-4.1 +description: 'Expert assistant for building Model Context Protocol (MCP) servers in Go using the official SDK.' +--- + +# 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. diff --git a/collections/go-mcp-development.collection.yml b/collections/go-mcp-development.collection.yml new file mode 100644 index 0000000..c9e3053 --- /dev/null +++ b/collections/go-mcp-development.collection.yml @@ -0,0 +1,35 @@ +id: go-mcp-development +name: Go MCP Server Development +description: Complete toolkit for building Model Context Protocol (MCP) servers in Go using the official github.com/modelcontextprotocol/go-sdk. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance. +tags: [go, golang, mcp, model-context-protocol, server-development, sdk] +items: + - path: instructions/go-mcp-server.instructions.md + kind: instruction + - path: prompts/go-mcp-server-generator.prompt.md + kind: prompt + - path: chatmodes/go-mcp-expert.chatmode.md + kind: chat-mode + usage: | + recommended + + This chat mode provides expert guidance for building MCP servers in Go. + + This chat mode is ideal for: + - Creating new MCP server projects with Go + - Implementing type-safe tools with structs and JSON schema tags + - Setting up stdio or HTTP transports + - Debugging context handling and error patterns + - Learning Go MCP best practices with the official SDK + - Optimizing server performance and concurrency + + To get the best results, consider: + - Using the instruction file to set context for Go MCP development + - Using the prompt to generate initial project structure + - Switching to the expert chat mode for detailed implementation help + - Specifying whether you need stdio or HTTP transport + - Providing details about what tools or functionality you need + - Mentioning if you need resources, prompts, or special capabilities + +display: + ordering: manual + show_badge: true diff --git a/collections/go-mcp-development.md b/collections/go-mcp-development.md new file mode 100644 index 0000000..9358234 --- /dev/null +++ b/collections/go-mcp-development.md @@ -0,0 +1,41 @@ +# Go MCP Server Development + +Complete toolkit for building Model Context Protocol (MCP) servers in Go using the official github.com/modelcontextprotocol/go-sdk. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance. + +**Tags:** go, golang, mcp, model-context-protocol, server-development, sdk + +## Items in this Collection + +| Title | Type | Description | +| ----- | ---- | ----------- | +| [Go MCP Server Development Guidelines](../instructions/go-mcp-server.instructions.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fgo-mcp-server.instructions.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fgo-mcp-server.instructions.md) | Instruction | Best practices and patterns for building Model Context Protocol (MCP) servers in Go using the official github.com/modelcontextprotocol/go-sdk package. | +| [Go MCP Server Project Generator](../prompts/go-mcp-server-generator.prompt.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fgo-mcp-server-generator.prompt.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fgo-mcp-server-generator.prompt.md) | Prompt | Generate a complete Go MCP server project with proper structure, dependencies, and implementation using the official github.com/modelcontextprotocol/go-sdk. | +| [Go MCP Server Development Expert](../chatmodes/go-mcp-expert.chatmode.md)
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/chatmode?url=vscode%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fgo-mcp-expert.chatmode.md)
[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/chatmode?url=vscode-insiders%3Achat-mode%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fchatmodes%2Fgo-mcp-expert.chatmode.md) | Chat Mode | Expert assistant for building Model Context Protocol (MCP) servers in Go using the official SDK. [see usage](#go-mcp-server-development-expert) | + +## Collection Usage + +### Go MCP Server Development Expert + +recommended + +This chat mode provides expert guidance for building MCP servers in Go. + +This chat mode is ideal for: +- Creating new MCP server projects with Go +- Implementing type-safe tools with structs and JSON schema tags +- Setting up stdio or HTTP transports +- Debugging context handling and error patterns +- Learning Go MCP best practices with the official SDK +- Optimizing server performance and concurrency + +To get the best results, consider: +- Using the instruction file to set context for Go MCP development +- Using the prompt to generate initial project structure +- Switching to the expert chat mode for detailed implementation help +- Specifying whether you need stdio or HTTP transport +- Providing details about what tools or functionality you need +- Mentioning if you need resources, prompts, or special capabilities + +--- + +*This collection includes 3 curated items for go mcp server development.* \ No newline at end of file diff --git a/instructions/go-mcp-server.instructions.md b/instructions/go-mcp-server.instructions.md new file mode 100644 index 0000000..fc05b87 --- /dev/null +++ b/instructions/go-mcp-server.instructions.md @@ -0,0 +1,346 @@ +--- +description: 'Best practices and patterns for building Model Context Protocol (MCP) servers in Go using the official github.com/modelcontextprotocol/go-sdk package.' +applyTo: "**/*.go, **/go.mod, **/go.sum" +--- + +# Go MCP Server Development Guidelines + +When building MCP servers in Go, follow these best practices and patterns using the official Go SDK. + +## Server Setup + +Create an MCP server using `mcp.NewServer`: + +```go +import "github.com/modelcontextprotocol/go-sdk/mcp" + +server := mcp.NewServer( + &mcp.Implementation{ + Name: "my-server", + Version: "v1.0.0", + }, + nil, // or provide mcp.Options +) +``` + +## Adding Tools + +Use `mcp.AddTool` with struct-based input and output for type safety: + +```go +type ToolInput struct { + Query string `json:"query" jsonschema:"the search query"` + Limit int `json:"limit,omitempty" jsonschema:"maximum results to return"` +} + +type ToolOutput struct { + Results []string `json:"results" jsonschema:"list of search results"` + Count int `json:"count" jsonschema:"number of results found"` +} + +func SearchTool(ctx context.Context, req *mcp.CallToolRequest, input ToolInput) ( + *mcp.CallToolResult, + ToolOutput, + error, +) { + // Implement tool logic + results := performSearch(ctx, input.Query, input.Limit) + + return nil, ToolOutput{ + Results: results, + Count: len(results), + }, nil +} + +// Register the tool +mcp.AddTool(server, + &mcp.Tool{ + Name: "search", + Description: "Search for information", + }, + SearchTool, +) +``` + +## Adding Resources + +Use `mcp.AddResource` for providing accessible data: + +```go +func GetResource(ctx context.Context, req *mcp.ReadResourceRequest) (*mcp.ReadResourceResult, error) { + content, err := loadResourceContent(ctx, req.URI) + if err != nil { + return nil, err + } + + return &mcp.ReadResourceResult{ + Contents: []any{ + &mcp.TextResourceContents{ + ResourceContents: mcp.ResourceContents{ + URI: req.URI, + MIMEType: "text/plain", + }, + Text: content, + }, + }, + }, nil +} + +mcp.AddResource(server, + &mcp.Resource{ + URI: "file:///data/example.txt", + Name: "Example Data", + Description: "Example resource data", + MIMEType: "text/plain", + }, + GetResource, +) +``` + +## Adding Prompts + +Use `mcp.AddPrompt` for reusable prompt templates: + +```go +type PromptInput struct { + Topic string `json:"topic" jsonschema:"the topic to analyze"` +} + +func AnalyzePrompt(ctx context.Context, req *mcp.GetPromptRequest, input PromptInput) ( + *mcp.GetPromptResult, + error, +) { + return &mcp.GetPromptResult{ + Description: "Analyze the given topic", + Messages: []mcp.PromptMessage{ + { + Role: mcp.RoleUser, + Content: mcp.TextContent{ + Text: fmt.Sprintf("Analyze this topic: %s", input.Topic), + }, + }, + }, + }, nil +} + +mcp.AddPrompt(server, + &mcp.Prompt{ + Name: "analyze", + Description: "Analyze a topic", + Arguments: []mcp.PromptArgument{ + { + Name: "topic", + Description: "The topic to analyze", + Required: true, + }, + }, + }, + AnalyzePrompt, +) +``` + +## Transport Configuration + +### Stdio Transport + +For communication over stdin/stdout (most common for desktop integrations): + +```go +if err := server.Run(ctx, &mcp.StdioTransport{}); err != nil { + log.Fatal(err) +} +``` + +### HTTP Transport + +For HTTP-based communication: + +```go +import "github.com/modelcontextprotocol/go-sdk/mcp" + +transport := &mcp.HTTPTransport{ + Addr: ":8080", + // Optional: configure TLS, timeouts, etc. +} + +if err := server.Run(ctx, transport); err != nil { + log.Fatal(err) +} +``` + +## Error Handling + +Always return proper errors and use context for cancellation: + +```go +func MyTool(ctx context.Context, req *mcp.CallToolRequest, input MyInput) ( + *mcp.CallToolResult, + MyOutput, + error, +) { + // Check context cancellation + if ctx.Err() != nil { + return nil, MyOutput{}, ctx.Err() + } + + // Return errors for invalid input + if input.Query == "" { + return nil, MyOutput{}, fmt.Errorf("query cannot be empty") + } + + // Perform operation + result, err := performOperation(ctx, input) + if err != nil { + return nil, MyOutput{}, fmt.Errorf("operation failed: %w", err) + } + + return nil, result, nil +} +``` + +## JSON Schema Tags + +Use `jsonschema` tags to document your structs for better client integration: + +```go +type Input struct { + Name string `json:"name" jsonschema:"required,description=User's name"` + Age int `json:"age" jsonschema:"minimum=0,maximum=150"` + Email string `json:"email,omitempty" jsonschema:"format=email"` + Tags []string `json:"tags,omitempty" jsonschema:"uniqueItems=true"` + Active bool `json:"active" jsonschema:"default=true"` +} +``` + +## Context Usage + +Always respect context cancellation and deadlines: + +```go +func LongRunningTool(ctx context.Context, req *mcp.CallToolRequest, input Input) ( + *mcp.CallToolResult, + Output, + error, +) { + select { + case <-ctx.Done(): + return nil, Output{}, ctx.Err() + case result := <-performWork(ctx, input): + return nil, result, nil + } +} +``` + +## Server Options + +Configure server behavior with options: + +```go +options := &mcp.Options{ + Capabilities: &mcp.ServerCapabilities{ + Tools: &mcp.ToolsCapability{}, + Resources: &mcp.ResourcesCapability{ + Subscribe: true, // Enable resource subscriptions + }, + Prompts: &mcp.PromptsCapability{}, + }, +} + +server := mcp.NewServer( + &mcp.Implementation{Name: "my-server", Version: "v1.0.0"}, + options, +) +``` + +## Testing + +Test your MCP tools using standard Go testing patterns: + +```go +func TestSearchTool(t *testing.T) { + ctx := context.Background() + input := ToolInput{Query: "test", Limit: 10} + + result, output, err := SearchTool(ctx, nil, input) + if err != nil { + t.Fatalf("SearchTool failed: %v", err) + } + + if len(output.Results) == 0 { + t.Error("Expected results, got none") + } +} +``` + +## Module Setup + +Initialize your Go module properly: + +```bash +go mod init github.com/yourusername/yourserver +go get github.com/modelcontextprotocol/go-sdk@latest +``` + +Your `go.mod` should include: + +```go +module github.com/yourusername/yourserver + +go 1.23 + +require github.com/modelcontextprotocol/go-sdk v1.0.0 +``` + +## Common Patterns + +### Logging + +Use structured logging: + +```go +import "log/slog" + +logger := slog.Default() +logger.Info("tool called", "name", req.Params.Name, "args", req.Params.Arguments) +``` + +### Configuration + +Use environment variables or config files: + +```go +type Config struct { + ServerName string + Version string + Port int +} + +func LoadConfig() *Config { + return &Config{ + ServerName: getEnv("SERVER_NAME", "my-server"), + Version: getEnv("VERSION", "v1.0.0"), + Port: getEnvInt("PORT", 8080), + } +} +``` + +### Graceful Shutdown + +Handle shutdown signals properly: + +```go +ctx, cancel := context.WithCancel(context.Background()) +defer cancel() + +sigCh := make(chan os.Signal, 1) +signal.Notify(sigCh, os.Interrupt, syscall.SIGTERM) + +go func() { + <-sigCh + cancel() +}() + +if err := server.Run(ctx, transport); err != nil { + log.Fatal(err) +} +``` diff --git a/prompts/go-mcp-server-generator.prompt.md b/prompts/go-mcp-server-generator.prompt.md new file mode 100644 index 0000000..55832d2 --- /dev/null +++ b/prompts/go-mcp-server-generator.prompt.md @@ -0,0 +1,334 @@ +--- +mode: agent +description: 'Generate a complete Go MCP server project with proper structure, dependencies, and implementation using the official github.com/modelcontextprotocol/go-sdk.' +--- + +# 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.go Template + +```go +package config + +import "os" + +type Config struct { + ServerName string + Version string + LogLevel string +} + +func Load() *Config { + return &Config{ + ServerName: getEnv("SERVER_NAME", "{{PROJECT_NAME}}"), + Version: getEnv("VERSION", "v1.0.0"), + LogLevel: getEnv("LOG_LEVEL", "info"), + } +} + +func getEnv(key, defaultValue string) string { + if value := os.Getenv(key); value != "" { + return value + } + return defaultValue +} +``` + +## main_test.go Template + +```go +package main + +import ( + "context" + "testing" + + "github.com/yourusername/{{PROJECT_NAME}}/tools" +) + +func TestTool1Handler(t *testing.T) { + ctx := context.Background() + input := tools.Tool1Input{ + Param1: "test", + Param2: 42, + } + + result, output, err := tools.Tool1Handler(ctx, nil, input) + if err != nil { + t.Fatalf("Tool1Handler failed: %v", err) + } + + if output.Status != "success" { + t.Errorf("Expected status 'success', got '%s'", output.Status) + } + + if result != nil { + t.Error("Expected result to be nil") + } +} +``` + +## README.md Template + +```markdown +# {{PROJECT_NAME}} + +A Model Context Protocol (MCP) server built with Go. + +## Description + +{{PROJECT_DESCRIPTION}} + +## Installation + +\`\`\`bash +go mod download +go build -o {{PROJECT_NAME}} +\`\`\` + +## Usage + +Run the server with stdio transport: + +\`\`\`bash +./{{PROJECT_NAME}} +\`\`\` + +## Configuration + +Configure via environment variables: + +- `SERVER_NAME`: Server name (default: "{{PROJECT_NAME}}") +- `VERSION`: Server version (default: "v1.0.0") +- `LOG_LEVEL`: Logging level (default: "info") + +## Available Tools + +### tool1 +{{TOOL1_DESCRIPTION}} + +**Input:** +- `param1` (string, required): First parameter +- `param2` (int, optional): Second parameter + +**Output:** +- `result` (string): Operation result +- `status` (string): Status of the operation + +## Development + +Run tests: + +\`\`\`bash +go test ./... +\`\`\` + +Build: + +\`\`\`bash +go build -o {{PROJECT_NAME}} +\`\`\` + +## License + +MIT +``` + +## Generation Instructions + +When generating a Go MCP server: + +1. **Initialize Module**: Create `go.mod` with proper module path +2. **Structure**: Follow the template directory structure +3. **Type Safety**: Use structs with JSON schema tags for all inputs/outputs +4. **Error Handling**: Validate inputs, check context, wrap errors +5. **Documentation**: Add clear descriptions and examples +6. **Testing**: Include at least one test per tool +7. **Configuration**: Use environment variables for config +8. **Logging**: Use structured logging (log/slog) +9. **Graceful Shutdown**: Handle signals properly +10. **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 functions