diff --git a/README.chatmodes.md b/README.chatmodes.md index 47d9ed8..32d39b2 100644 --- a/README.chatmodes.md +++ b/README.chatmodes.md @@ -28,6 +28,7 @@ Custom chat modes define specific behaviors and tools for GitHub Copilot Chat, e | [Azure Terraform Infrastructure Planning](chatmodes/terraform-azure-planning.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%2Fterraform-azure-planning.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%2Fterraform-azure-planning.chatmode.md) | Act as implementation planner for your Azure Terraform Infrastructure as Code task. | | [Blueprint Mode Codex v1](chatmodes/blueprint-mode-codex.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%2Fblueprint-mode-codex.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%2Fblueprint-mode-codex.chatmode.md) | Executes structured workflows with strict correctness and maintainability. Enforces a minimal tool usage policy, never assumes facts, prioritizes reproducible solutions, self-correction, and edge-case handling. | | [Blueprint Mode v39](chatmodes/blueprint-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%2Fblueprint-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%2Fblueprint-mode.chatmode.md) | Executes structured workflows (Debug, Express, Main, Loop) with strict correctness and maintainability. Enforces an improved tool usage policy, never assumes facts, prioritizes reproducible solutions, self-correction, and edge-case handling. | +| [C# MCP Server Expert](chatmodes/csharp-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%2Fcsharp-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%2Fcsharp-mcp-expert.chatmode.md) | Expert assistant for developing Model Context Protocol (MCP) servers in C# | | [C#/.NET Janitor](chatmodes/csharp-dotnet-janitor.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%2Fcsharp-dotnet-janitor.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%2Fcsharp-dotnet-janitor.chatmode.md) | Perform janitorial tasks on C#/.NET code including cleanup, modernization, and tech debt remediation. | | [Clojure Interactive Programming with Backseat Driver](chatmodes/clojure-interactive-programming.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%2Fclojure-interactive-programming.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%2Fclojure-interactive-programming.chatmode.md) | Expert Clojure pair programmer with REPL-first methodology, architectural oversight, and interactive problem-solving. Enforces quality standards, prevents workarounds, and develops solutions incrementally through live REPL evaluation before file modifications. | | [Create PRD Chat Mode](chatmodes/prd.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%2Fprd.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%2Fprd.chatmode.md) | Generate a comprehensive Product Requirements Document (PRD) in Markdown, detailing user stories, acceptance criteria, technical considerations, and metrics. Optionally create GitHub issues upon user confirmation. | @@ -79,6 +80,7 @@ Custom chat modes define specific behaviors and tools for GitHub Copilot Chat, e | [Technical Debt Remediation Plan](chatmodes/tech-debt-remediation-plan.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%2Ftech-debt-remediation-plan.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%2Ftech-debt-remediation-plan.chatmode.md) | Generate technical debt remediation plans for code, tests, and documentation. | | [Technical spike research mode](chatmodes/research-technical-spike.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%2Fresearch-technical-spike.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%2Fresearch-technical-spike.chatmode.md) | Systematically research and validate technical spike documents through exhaustive investigation and controlled experimentation. | | [Thinking Beast Mode](chatmodes/Thinking-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%2FThinking-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%2FThinking-Beast-Mode.chatmode.md) | A transcendent coding agent with quantum cognitive architecture, adversarial intelligence, and unrestricted creative freedom. | +| [TypeScript MCP Server Expert](chatmodes/typescript-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%2Ftypescript-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%2Ftypescript-mcp-expert.chatmode.md) | Expert assistant for developing Model Context Protocol (MCP) servers in TypeScript | | [Ultimate Transparent Thinking Beast Mode](chatmodes/Ultimate-Transparent-Thinking-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%2FUltimate-Transparent-Thinking-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%2FUltimate-Transparent-Thinking-Beast-Mode.chatmode.md) | Ultimate Transparent Thinking Beast Mode | | [Universal Janitor](chatmodes/janitor.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%2Fjanitor.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%2Fjanitor.chatmode.md) | Perform janitorial tasks on any codebase including cleanup, simplification, and tech debt remediation. | | [Universal PR Comment Addresser](chatmodes/address-comments.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%2Faddress-comments.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%2Faddress-comments.chatmode.md) | Address PR comments | diff --git a/README.collections.md b/README.collections.md index b79736e..4232b0e 100644 --- a/README.collections.md +++ b/README.collections.md @@ -17,6 +17,7 @@ Curated collections of related prompts, instructions, and chat modes organized a | ---- | ----------- | ----- | ---- | | [Azure & Cloud Development](collections/azure-cloud-development.md) | Comprehensive Azure cloud development tools including Infrastructure as Code, serverless functions, architecture patterns, and cost optimization for building scalable cloud applications. | 18 items | azure, cloud, infrastructure, bicep, terraform, serverless, architecture, devops | | [C# .NET Development](collections/csharp-dotnet-development.md) | Essential prompts, instructions, and chat modes for C# and .NET development including testing, documentation, and best practices. | 7 items | csharp, dotnet, aspnet, testing | +| [C# MCP Server Development](collections/csharp-mcp-development.md) | Complete toolkit for building Model Context Protocol (MCP) servers in C# using the official SDK. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance. | 3 items | csharp, mcp, model-context-protocol, dotnet, server-development | | [Clojure Interactive Programming](collections/clojure-interactive-programming.md) | Tools for REPL-first Clojure workflows featuring Clojure instructions, the interactive programming chat mode and supporting guidance. | 3 items | clojure, repl, interactive-programming | | [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 | @@ -31,3 +32,4 @@ Curated collections of related prompts, instructions, and chat modes organized a | [Tasks by microsoft/edge-ai](collections/edge-ai-tasks.md) | Task Researcher and Task Planner for intermediate to expert users and large codebases - Brought to you by microsoft/edge-ai | 3 items | architecture, planning, research, tasks, implementation | | [Technical Spike](collections/technical-spike.md) | Tools for creation, management and research of technical spikes to reduce unknowns and assumptions before proceeding to specification and implementation of solutions. | 2 items | technical-spike, assumption-testing, validation, research | | [Testing & Test Automation](collections/testing-automation.md) | Comprehensive collection for writing tests, test automation, and test-driven development including unit tests, integration tests, and end-to-end testing strategies. | 11 items | testing, tdd, automation, unit-tests, integration, playwright, jest, nunit | +| [TypeScript MCP Server Development](collections/typescript-mcp-development.md) | Complete toolkit for building Model Context Protocol (MCP) servers in TypeScript/Node.js using the official SDK. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance. | 3 items | typescript, mcp, model-context-protocol, nodejs, server-development | diff --git a/README.instructions.md b/README.instructions.md index 25911a5..c17bcd9 100644 --- a/README.instructions.md +++ b/README.instructions.md @@ -29,6 +29,7 @@ Team and project-specific instructions to enhance GitHub Copilot's behavior for | [Bicep Code Best Practices](instructions/bicep-code-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%2Fbicep-code-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%2Fbicep-code-best-practices.instructions.md) | Infrastructure as Code with Bicep | | [Blazor](instructions/blazor.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%2Fblazor.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%2Fblazor.instructions.md) | Blazor component and application patterns | | [C# Development](instructions/csharp.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%2Fcsharp.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%2Fcsharp.instructions.md) | Guidelines for building C# applications | +| [C# MCP Server Development](instructions/csharp-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%2Fcsharp-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%2Fcsharp-mcp-server.instructions.md) | Instructions for building Model Context Protocol (MCP) servers using the C# SDK | | [C# 코드 작성 규칙](instructions/csharp-ko.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%2Fcsharp-ko.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%2Fcsharp-ko.instructions.md) | C# 애플리케이션 개발을 위한 코드 작성 규칙 by @jgkim999 | | [C# アプリケーション開発](instructions/csharp-ja.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%2Fcsharp-ja.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%2Fcsharp-ja.instructions.md) | C# アプリケーション構築指針 by @tsubakimoto | | [Clojure Development Instructions](instructions/clojure.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%2Fclojure.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%2Fclojure.instructions.md) | Clojure-specific coding patterns, inline def usage, code block templates, and namespace handling for Clojure development. | @@ -107,5 +108,6 @@ Team and project-specific instructions to enhance GitHub Copilot's behavior for | [TaskSync V4 Protocol](instructions/tasksync.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%2Ftasksync.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%2Ftasksync.instructions.md) | TaskSync V4 - Allows you to give the agent new instructions or feedback after completing a task using terminal while agent is running. | | [Terraform Conventions](instructions/terraform.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%2Fterraform.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%2Fterraform.instructions.md) | Terraform Conventions and Guidelines | | [TypeScript Development](instructions/typescript-5-es2022.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%2Ftypescript-5-es2022.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%2Ftypescript-5-es2022.instructions.md) | Guidelines for TypeScript Development targeting TypeScript 5.x and ES2022 output | +| [TypeScript MCP Server Development](instructions/typescript-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%2Ftypescript-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%2Ftypescript-mcp-server.instructions.md) | Instructions for building Model Context Protocol (MCP) servers using the TypeScript SDK | | [VueJS 3 Development Instructions](instructions/vuejs3.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%2Fvuejs3.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%2Fvuejs3.instructions.md) | VueJS 3 development standards and best practices with Composition API and TypeScript | | [WordPress Development — Copilot Instructions](instructions/wordpress.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%2Fwordpress.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%2Fwordpress.instructions.md) | Coding, security, and testing rules for WordPress plugins and themes | diff --git a/README.prompts.md b/README.prompts.md index 1038342..e433bcc 100644 --- a/README.prompts.md +++ b/README.prompts.md @@ -56,8 +56,10 @@ Ready-to-use prompt templates for specific development scenarios and tasks, defi | [Feature Implementation Plan Prompt](prompts/breakdown-feature-implementation.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-feature-implementation.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-feature-implementation.prompt.md) | Prompt for creating detailed feature implementation plans, following Epoch monorepo structure. | | [Feature PRD Prompt](prompts/breakdown-feature-prd.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-feature-prd.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-feature-prd.prompt.md) | Prompt for creating Product Requirements Documents (PRDs) for new features, based on an Epic. | | [Finalize Agent Prompt](prompts/finalize-agent-prompt.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%2Ffinalize-agent-prompt.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%2Ffinalize-agent-prompt.prompt.md) | Finalize prompt file using the role of an AI agent to polish the prompt for the end user. | +| [Generate C# MCP Server](prompts/csharp-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%2Fcsharp-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%2Fcsharp-mcp-server-generator.prompt.md) | Generate a complete MCP server project in C# with tools, prompts, and proper configuration | | [Generate Python MCP Server](prompts/python-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%2Fpython-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%2Fpython-mcp-server-generator.prompt.md) | Generate a complete MCP server project in Python with tools, resources, and proper configuration | | [Generate Standard OO Component Documentation](prompts/create-oo-component-documentation.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%2Fcreate-oo-component-documentation.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%2Fcreate-oo-component-documentation.prompt.md) | Create comprehensive, standardized documentation for object-oriented components following industry best practices and architectural documentation standards. | +| [Generate TypeScript MCP Server](prompts/typescript-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%2Ftypescript-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%2Ftypescript-mcp-server-generator.prompt.md) | Generate a complete MCP server project in TypeScript with tools, resources, and proper configuration | | [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. | diff --git a/chatmodes/csharp-mcp-expert.chatmode.md b/chatmodes/csharp-mcp-expert.chatmode.md new file mode 100644 index 0000000..69ce7d7 --- /dev/null +++ b/chatmodes/csharp-mcp-expert.chatmode.md @@ -0,0 +1,69 @@ +--- +description: 'Expert assistant for developing Model Context Protocol (MCP) servers in C#' +model: GPT-4.1 +--- + +# C# MCP Server Expert + +You are a world-class expert in building Model Context Protocol (MCP) servers using the C# SDK. You have deep knowledge of the ModelContextProtocol NuGet packages, .NET dependency injection, async programming, and best practices for building robust, production-ready MCP servers. + +## Your Expertise + +- **C# MCP SDK**: Complete mastery of ModelContextProtocol, ModelContextProtocol.AspNetCore, and ModelContextProtocol.Core packages +- **.NET Architecture**: Expert in Microsoft.Extensions.Hosting, dependency injection, and service lifetime management +- **MCP Protocol**: Deep understanding of the Model Context Protocol specification, client-server communication, and tool/prompt patterns +- **Async Programming**: Expert in async/await patterns, cancellation tokens, and proper async error handling +- **Tool Design**: Creating intuitive, well-documented tools that LLMs can effectively use +- **Best Practices**: Security, error handling, logging, testing, and maintainability +- **Debugging**: Troubleshooting stdio transport issues, serialization problems, and protocol errors + +## Your Approach + +- **Start with Context**: Always understand the user's goal and what their MCP server needs to accomplish +- **Follow Best Practices**: Use proper attributes (`[McpServerToolType]`, `[McpServerTool]`, `[Description]`), configure logging to stderr, and implement comprehensive error handling +- **Write Clean Code**: Follow C# conventions, use nullable reference types, include XML documentation, and organize code logically +- **Dependency Injection First**: Leverage DI for services, use parameter injection in tool methods, and manage service lifetimes properly +- **Test-Driven Mindset**: Consider how tools will be tested and provide testing guidance +- **Security Conscious**: Always consider security implications of tools that access files, networks, or system resources +- **LLM-Friendly**: Write descriptions that help LLMs understand when and how to use tools effectively + +## Guidelines + +- Always use prerelease NuGet packages with `--prerelease` flag +- Configure logging to stderr using `LogToStandardErrorThreshold = LogLevel.Trace` +- Use `Host.CreateApplicationBuilder` for proper DI and lifecycle management +- Add `[Description]` attributes to all tools and parameters for LLM understanding +- Support async operations with proper `CancellationToken` usage +- Use `McpProtocolException` with appropriate `McpErrorCode` for protocol errors +- Validate input parameters and provide clear error messages +- Use `McpServer.AsSamplingChatClient()` when tools need to interact with the client's LLM +- Organize related tools into classes with `[McpServerToolType]` +- Return simple types or JSON-serializable objects from tools +- Provide complete, runnable code examples that users can immediately use +- Include comments explaining complex logic or protocol-specific patterns +- Consider performance implications of tool operations +- Think about error scenarios and handle them gracefully + +## Common Scenarios You Excel At + +- **Creating New Servers**: Generating complete project structures with proper configuration +- **Tool Development**: Implementing tools for file operations, HTTP requests, data processing, or system interactions +- **Prompt Implementation**: Creating reusable prompt templates with `[McpServerPrompt]` +- **Debugging**: Helping diagnose stdio transport issues, serialization errors, or protocol problems +- **Refactoring**: Improving existing MCP servers for better maintainability, performance, or functionality +- **Integration**: Connecting MCP servers with databases, APIs, or other services via DI +- **Testing**: Writing unit tests for tools and integration tests for servers +- **Optimization**: Improving performance, reducing memory usage, or enhancing error handling + +## Response Style + +- Provide complete, working code examples that can be copied and used immediately +- Include necessary using statements and namespace declarations +- Add inline comments for complex or non-obvious code +- Explain the "why" behind design decisions +- Highlight potential pitfalls or common mistakes to avoid +- Suggest improvements or alternative approaches when relevant +- Include troubleshooting tips for common issues +- Format code clearly with proper indentation and spacing + +You help developers build high-quality MCP servers that are robust, maintainable, secure, and easy for LLMs to use effectively. diff --git a/chatmodes/typescript-mcp-expert.chatmode.md b/chatmodes/typescript-mcp-expert.chatmode.md new file mode 100644 index 0000000..a1f1c78 --- /dev/null +++ b/chatmodes/typescript-mcp-expert.chatmode.md @@ -0,0 +1,91 @@ +--- +description: 'Expert assistant for developing Model Context Protocol (MCP) servers in TypeScript' +model: GPT-4.1 +--- + +# TypeScript MCP Server Expert + +You are a world-class expert in building Model Context Protocol (MCP) servers using the TypeScript SDK. You have deep knowledge of the @modelcontextprotocol/sdk package, Node.js, TypeScript, async programming, zod validation, and best practices for building robust, production-ready MCP servers. + +## Your Expertise + +- **TypeScript MCP SDK**: Complete mastery of @modelcontextprotocol/sdk, including McpServer, Server, all transports, and utility functions +- **TypeScript/Node.js**: Expert in TypeScript, ES modules, async/await patterns, and Node.js ecosystem +- **Schema Validation**: Deep knowledge of zod for input/output validation and type inference +- **MCP Protocol**: Complete understanding of the Model Context Protocol specification, transports, and capabilities +- **Transport Types**: Expert in both StreamableHTTPServerTransport (with Express) and StdioServerTransport +- **Tool Design**: Creating intuitive, well-documented tools with proper schemas and error handling +- **Best Practices**: Security, performance, testing, type safety, and maintainability +- **Debugging**: Troubleshooting transport issues, schema validation errors, and protocol problems + +## Your Approach + +- **Understand Requirements**: Always clarify what the MCP server needs to accomplish and who will use it +- **Choose Right Tools**: Select appropriate transport (HTTP vs stdio) based on use case +- **Type Safety First**: Leverage TypeScript's type system and zod for runtime validation +- **Follow SDK Patterns**: Use `registerTool()`, `registerResource()`, `registerPrompt()` methods consistently +- **Structured Returns**: Always return both `content` (for display) and `structuredContent` (for data) from tools +- **Error Handling**: Implement comprehensive try-catch blocks and return `isError: true` for failures +- **LLM-Friendly**: Write clear titles and descriptions that help LLMs understand tool capabilities +- **Test-Driven**: Consider how tools will be tested and provide testing guidance + +## Guidelines + +- Always use ES modules syntax (`import`/`export`, not `require`) +- Import from specific SDK paths: `@modelcontextprotocol/sdk/server/mcp.js` +- Use zod for all schema definitions: `{ inputSchema: { param: z.string() } }` +- Provide `title` field for all tools, resources, and prompts (not just `name`) +- Return both `content` and `structuredContent` from tool implementations +- Use `ResourceTemplate` for dynamic resources: `new ResourceTemplate('resource://{param}', { list: undefined })` +- Create new transport instances per request in stateless HTTP mode +- Enable DNS rebinding protection for local HTTP servers: `enableDnsRebindingProtection: true` +- Configure CORS and expose `Mcp-Session-Id` header for browser clients +- Use `completable()` wrapper for argument completion support +- Implement sampling with `server.server.createMessage()` when tools need LLM help +- Use `server.server.elicitInput()` for interactive user input during tool execution +- Handle cleanup with `res.on('close', () => transport.close())` for HTTP transports +- Use environment variables for configuration (ports, API keys, paths) +- Add proper TypeScript types for all function parameters and returns +- Implement graceful error handling and meaningful error messages +- Test with MCP Inspector: `npx @modelcontextprotocol/inspector` + +## Common Scenarios You Excel At + +- **Creating New Servers**: Generating complete project structures with package.json, tsconfig, and proper setup +- **Tool Development**: Implementing tools for data processing, API calls, file operations, or database queries +- **Resource Implementation**: Creating static or dynamic resources with proper URI templates +- **Prompt Development**: Building reusable prompt templates with argument validation and completion +- **Transport Setup**: Configuring both HTTP (with Express) and stdio transports correctly +- **Debugging**: Diagnosing transport issues, schema validation errors, and protocol problems +- **Optimization**: Improving performance, adding notification debouncing, and managing resources efficiently +- **Migration**: Helping migrate from older MCP implementations to current best practices +- **Integration**: Connecting MCP servers with databases, APIs, or other services +- **Testing**: Writing tests and providing integration testing strategies + +## Response Style + +- Provide complete, working code that can be copied and used immediately +- Include all necessary imports at the top of code blocks +- Add inline comments explaining important concepts or non-obvious code +- Show package.json and tsconfig.json when creating new projects +- Explain the "why" behind architectural decisions +- Highlight potential issues or edge cases to watch for +- Suggest improvements or alternative approaches when relevant +- Include MCP Inspector commands for testing +- Format code with proper indentation and TypeScript conventions +- Provide environment variable examples when needed + +## Advanced Capabilities You Know + +- **Dynamic Updates**: Using `.enable()`, `.disable()`, `.update()`, `.remove()` for runtime changes +- **Notification Debouncing**: Configuring debounced notifications for bulk operations +- **Session Management**: Implementing stateful HTTP servers with session tracking +- **Backwards Compatibility**: Supporting both Streamable HTTP and legacy SSE transports +- **OAuth Proxying**: Setting up proxy authorization with external providers +- **Context-Aware Completion**: Implementing intelligent argument completions based on context +- **Resource Links**: Returning ResourceLink objects for efficient large file handling +- **Sampling Workflows**: Building tools that use LLM sampling for complex operations +- **Elicitation Flows**: Creating interactive tools that request user input during execution +- **Low-Level API**: Using the Server class directly for maximum control when needed + +You help developers build high-quality TypeScript MCP servers that are type-safe, robust, performant, and easy for LLMs to use effectively. diff --git a/collections/csharp-mcp-development.collection.yml b/collections/csharp-mcp-development.collection.yml new file mode 100644 index 0000000..ae5d6b2 --- /dev/null +++ b/collections/csharp-mcp-development.collection.yml @@ -0,0 +1,32 @@ +id: csharp-mcp-development +name: C# MCP Server Development +description: Complete toolkit for building Model Context Protocol (MCP) servers in C# using the official SDK. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance. +tags: [csharp, mcp, model-context-protocol, dotnet, server-development] +items: + - path: instructions/csharp-mcp-server.instructions.md + kind: instruction + - path: prompts/csharp-mcp-server-generator.prompt.md + kind: prompt + - path: chatmodes/csharp-mcp-expert.chatmode.md + kind: chat-mode + usage: | + recommended + + This chat mode provides expert guidance for building MCP servers in C#. + + This chat mode is ideal for: + - Creating new MCP server projects + - Implementing tools and prompts + - Debugging protocol issues + - Optimizing server performance + - Learning MCP best practices + + To get the best results, consider: + - Using the instruction file to set context for all Copilot interactions + - Using the prompt to generate initial project structure + - Switching to the expert chat mode for detailed implementation help + - Providing specific details about what tools or functionality you need + +display: + ordering: manual + show_badge: true diff --git a/collections/csharp-mcp-development.md b/collections/csharp-mcp-development.md new file mode 100644 index 0000000..5d57b93 --- /dev/null +++ b/collections/csharp-mcp-development.md @@ -0,0 +1,38 @@ +# C# MCP Server Development + +Complete toolkit for building Model Context Protocol (MCP) servers in C# using the official SDK. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance. + +**Tags:** csharp, mcp, model-context-protocol, dotnet, server-development + +## Items in this Collection + +| Title | Type | Description | +| ----- | ---- | ----------- | +| [C# MCP Server Development](../instructions/csharp-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%2Fcsharp-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%2Fcsharp-mcp-server.instructions.md) | Instruction | Instructions for building Model Context Protocol (MCP) servers using the C# SDK | +| [Generate C# MCP Server](../prompts/csharp-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%2Fcsharp-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%2Fcsharp-mcp-server-generator.prompt.md) | Prompt | Generate a complete MCP server project in C# with tools, prompts, and proper configuration | +| [C# MCP Server Expert](../chatmodes/csharp-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%2Fcsharp-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%2Fcsharp-mcp-expert.chatmode.md) | Chat Mode | Expert assistant for developing Model Context Protocol (MCP) servers in C# [see usage](#c#-mcp-server-expert) | + +## Collection Usage + +### C# MCP Server Expert + +recommended + +This chat mode provides expert guidance for building MCP servers in C#. + +This chat mode is ideal for: +- Creating new MCP server projects +- Implementing tools and prompts +- Debugging protocol issues +- Optimizing server performance +- Learning MCP best practices + +To get the best results, consider: +- Using the instruction file to set context for all Copilot interactions +- Using the prompt to generate initial project structure +- Switching to the expert chat mode for detailed implementation help +- Providing specific details about what tools or functionality you need + +--- + +*This collection includes 3 curated items for c# mcp server development.* \ No newline at end of file diff --git a/collections/typescript-mcp-development.collection.yml b/collections/typescript-mcp-development.collection.yml new file mode 100644 index 0000000..72ff68a --- /dev/null +++ b/collections/typescript-mcp-development.collection.yml @@ -0,0 +1,34 @@ +id: typescript-mcp-development +name: TypeScript MCP Server Development +description: Complete toolkit for building Model Context Protocol (MCP) servers in TypeScript/Node.js using the official SDK. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance. +tags: [typescript, mcp, model-context-protocol, nodejs, server-development] +items: + - path: instructions/typescript-mcp-server.instructions.md + kind: instruction + - path: prompts/typescript-mcp-server-generator.prompt.md + kind: prompt + - path: chatmodes/typescript-mcp-expert.chatmode.md + kind: chat-mode + usage: | + recommended + + This chat mode provides expert guidance for building MCP servers in TypeScript/Node.js. + + This chat mode is ideal for: + - Creating new MCP server projects with TypeScript + - Implementing tools, resources, and prompts with zod validation + - Setting up HTTP or stdio transports + - Debugging schema validation and transport issues + - Learning TypeScript MCP best practices + - Optimizing server performance and reliability + + To get the best results, consider: + - Using the instruction file to set context for TypeScript/Node.js development + - Using the prompt to generate initial project structure with proper configuration + - Switching to the expert chat mode for detailed implementation help + - Specifying whether you need HTTP or stdio transport + - Providing details about what tools or functionality you need + +display: + ordering: manual + show_badge: true diff --git a/collections/typescript-mcp-development.md b/collections/typescript-mcp-development.md new file mode 100644 index 0000000..6c0b2ea --- /dev/null +++ b/collections/typescript-mcp-development.md @@ -0,0 +1,40 @@ +# TypeScript MCP Server Development + +Complete toolkit for building Model Context Protocol (MCP) servers in TypeScript/Node.js using the official SDK. Includes instructions for best practices, a prompt for generating servers, and an expert chat mode for guidance. + +**Tags:** typescript, mcp, model-context-protocol, nodejs, server-development + +## Items in this Collection + +| Title | Type | Description | +| ----- | ---- | ----------- | +| [TypeScript MCP Server Development](../instructions/typescript-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%2Ftypescript-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%2Ftypescript-mcp-server.instructions.md) | Instruction | Instructions for building Model Context Protocol (MCP) servers using the TypeScript SDK | +| [Generate TypeScript MCP Server](../prompts/typescript-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%2Ftypescript-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%2Ftypescript-mcp-server-generator.prompt.md) | Prompt | Generate a complete MCP server project in TypeScript with tools, resources, and proper configuration | +| [TypeScript MCP Server Expert](../chatmodes/typescript-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%2Ftypescript-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%2Ftypescript-mcp-expert.chatmode.md) | Chat Mode | Expert assistant for developing Model Context Protocol (MCP) servers in TypeScript [see usage](#typescript-mcp-server-expert) | + +## Collection Usage + +### TypeScript MCP Server Expert + +recommended + +This chat mode provides expert guidance for building MCP servers in TypeScript/Node.js. + +This chat mode is ideal for: +- Creating new MCP server projects with TypeScript +- Implementing tools, resources, and prompts with zod validation +- Setting up HTTP or stdio transports +- Debugging schema validation and transport issues +- Learning TypeScript MCP best practices +- Optimizing server performance and reliability + +To get the best results, consider: +- Using the instruction file to set context for TypeScript/Node.js development +- Using the prompt to generate initial project structure with proper configuration +- Switching to the expert chat mode for detailed implementation help +- Specifying whether you need HTTP or stdio transport +- Providing details about what tools or functionality you need + +--- + +*This collection includes 3 curated items for typescript mcp server development.* \ No newline at end of file diff --git a/instructions/csharp-mcp-server.instructions.md b/instructions/csharp-mcp-server.instructions.md new file mode 100644 index 0000000..137ce1b --- /dev/null +++ b/instructions/csharp-mcp-server.instructions.md @@ -0,0 +1,95 @@ +--- +description: 'Instructions for building Model Context Protocol (MCP) servers using the C# SDK' +applyTo: '**/*.cs, **/*.csproj' +--- + +# C# MCP Server Development + +## Instructions + +- Use the **ModelContextProtocol** NuGet package (prerelease) for most projects: `dotnet add package ModelContextProtocol --prerelease` +- Use **ModelContextProtocol.AspNetCore** for HTTP-based MCP servers +- Use **ModelContextProtocol.Core** for minimal dependencies (client-only or low-level server APIs) +- Always configure logging to stderr using `LogToStandardErrorThreshold = LogLevel.Trace` to avoid interfering with stdio transport +- Use the `[McpServerToolType]` attribute on classes containing MCP tools +- Use the `[McpServerTool]` attribute on methods to expose them as tools +- Use the `[Description]` attribute from `System.ComponentModel` to document tools and parameters +- Support dependency injection in tool methods - inject `McpServer`, `HttpClient`, or other services as parameters +- Use `McpServer.AsSamplingChatClient()` to make sampling requests back to the client from within tools +- Expose prompts using `[McpServerPromptType]` on classes and `[McpServerPrompt]` on methods +- For stdio transport, use `WithStdioServerTransport()` when building the server +- Use `WithToolsFromAssembly()` to auto-discover and register all tools from the current assembly +- Tool methods can be synchronous or async (return `Task` or `Task`) +- Always include comprehensive descriptions for tools and parameters to help LLMs understand their purpose +- Use `CancellationToken` parameters in async tools for proper cancellation support +- Return simple types (string, int, etc.) or complex objects that can be serialized to JSON +- For fine-grained control, use `McpServerOptions` with custom handlers like `ListToolsHandler` and `CallToolHandler` +- Use `McpProtocolException` for protocol-level errors with appropriate `McpErrorCode` values +- Test MCP servers using the `McpClient` from the same SDK or any compliant MCP client +- Structure projects with Microsoft.Extensions.Hosting for proper DI and lifecycle management + +## Best Practices + +- Keep tool methods focused and single-purpose +- Use meaningful tool names that clearly indicate their function +- Provide detailed descriptions that explain what the tool does, what parameters it expects, and what it returns +- Validate input parameters and throw `McpProtocolException` with `McpErrorCode.InvalidParams` for invalid inputs +- Use structured logging to help with debugging without polluting stdout +- Organize related tools into logical classes with `[McpServerToolType]` +- Consider security implications when exposing tools that access external resources +- Use the built-in DI container to manage service lifetimes and dependencies +- Implement proper error handling and return meaningful error messages +- Test tools individually before integrating with LLMs + +## Common Patterns + +### Basic Server Setup +```csharp +var builder = Host.CreateApplicationBuilder(args); +builder.Logging.AddConsole(options => + options.LogToStandardErrorThreshold = LogLevel.Trace); +builder.Services + .AddMcpServer() + .WithStdioServerTransport() + .WithToolsFromAssembly(); +await builder.Build().RunAsync(); +``` + +### Simple Tool +```csharp +[McpServerToolType] +public static class MyTools +{ + [McpServerTool, Description("Description of what the tool does")] + public static string ToolName( + [Description("Parameter description")] string param) => + $"Result: {param}"; +} +``` + +### Tool with Dependency Injection +```csharp +[McpServerTool, Description("Fetches data from a URL")] +public static async Task FetchData( + HttpClient httpClient, + [Description("The URL to fetch")] string url, + CancellationToken cancellationToken) => + await httpClient.GetStringAsync(url, cancellationToken); +``` + +### Tool with Sampling +```csharp +[McpServerTool, Description("Analyzes content using the client's LLM")] +public static async Task Analyze( + McpServer server, + [Description("Content to analyze")] string content, + CancellationToken cancellationToken) +{ + var messages = new ChatMessage[] + { + new(ChatRole.User, $"Analyze this: {content}") + }; + return await server.AsSamplingChatClient() + .GetResponseAsync(messages, cancellationToken: cancellationToken); +} +``` diff --git a/instructions/typescript-mcp-server.instructions.md b/instructions/typescript-mcp-server.instructions.md new file mode 100644 index 0000000..97185e6 --- /dev/null +++ b/instructions/typescript-mcp-server.instructions.md @@ -0,0 +1,228 @@ +--- +description: 'Instructions for building Model Context Protocol (MCP) servers using the TypeScript SDK' +applyTo: '**/*.ts, **/*.js, **/package.json' +--- + +# TypeScript MCP Server Development + +## Instructions + +- Use the **@modelcontextprotocol/sdk** npm package: `npm install @modelcontextprotocol/sdk` +- Import from specific paths: `@modelcontextprotocol/sdk/server/mcp.js`, `@modelcontextprotocol/sdk/server/stdio.js`, etc. +- Use `McpServer` class for high-level server implementation with automatic protocol handling +- Use `Server` class for low-level control with manual request handlers +- Use **zod** for input/output schema validation: `npm install zod@3` +- Always provide `title` field for tools, resources, and prompts for better UI display +- Use `registerTool()`, `registerResource()`, and `registerPrompt()` methods (recommended over older APIs) +- Define schemas using zod: `{ inputSchema: { param: z.string() }, outputSchema: { result: z.string() } }` +- Return both `content` (for display) and `structuredContent` (for structured data) from tools +- For HTTP servers, use `StreamableHTTPServerTransport` with Express or similar frameworks +- For local integrations, use `StdioServerTransport` for stdio-based communication +- Create new transport instances per request to prevent request ID collisions (stateless mode) +- Use session management with `sessionIdGenerator` for stateful servers +- Enable DNS rebinding protection for local servers: `enableDnsRebindingProtection: true` +- Configure CORS headers and expose `Mcp-Session-Id` for browser-based clients +- Use `ResourceTemplate` for dynamic resources with URI parameters: `new ResourceTemplate('resource://{param}', { list: undefined })` +- Support completions for better UX using `completable()` wrapper from `@modelcontextprotocol/sdk/server/completable.js` +- Implement sampling with `server.server.createMessage()` to request LLM completions from clients +- Use `server.server.elicitInput()` to request additional user input during tool execution +- Enable notification debouncing for bulk updates: `debouncedNotificationMethods: ['notifications/tools/list_changed']` +- Dynamic updates: call `.enable()`, `.disable()`, `.update()`, or `.remove()` on registered items to emit `listChanged` notifications +- Use `getDisplayName()` from `@modelcontextprotocol/sdk/shared/metadataUtils.js` for UI display names +- Test servers with MCP Inspector: `npx @modelcontextprotocol/inspector` + +## Best Practices + +- Keep tool implementations focused on single responsibilities +- Provide clear, descriptive titles and descriptions for LLM understanding +- Use proper TypeScript types for all parameters and return values +- Implement comprehensive error handling with try-catch blocks +- Return `isError: true` in tool results for error conditions +- Use async/await for all asynchronous operations +- Close database connections and clean up resources properly +- Validate input parameters before processing +- Use structured logging for debugging without polluting stdout/stderr +- Consider security implications when exposing file system or network access +- Implement proper resource cleanup on transport close events +- Use environment variables for configuration (ports, API keys, etc.) +- Document tool capabilities and limitations clearly +- Test with multiple clients to ensure compatibility + +## Common Patterns + +### Basic Server Setup (HTTP) +```typescript +import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; +import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js'; +import express from 'express'; + +const server = new McpServer({ + name: 'my-server', + version: '1.0.0' +}); + +const app = express(); +app.use(express.json()); + +app.post('/mcp', async (req, res) => { + const transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: undefined, + enableJsonResponse: true + }); + + res.on('close', () => transport.close()); + + await server.connect(transport); + await transport.handleRequest(req, res, req.body); +}); + +app.listen(3000); +``` + +### Basic Server Setup (stdio) +```typescript +import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; +import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'; + +const server = new McpServer({ + name: 'my-server', + version: '1.0.0' +}); + +// ... register tools, resources, prompts ... + +const transport = new StdioServerTransport(); +await server.connect(transport); +``` + +### Simple Tool +```typescript +import { z } from 'zod'; + +server.registerTool( + 'calculate', + { + title: 'Calculator', + description: 'Perform basic calculations', + inputSchema: { a: z.number(), b: z.number(), op: z.enum(['+', '-', '*', '/']) }, + outputSchema: { result: z.number() } + }, + async ({ a, b, op }) => { + const result = op === '+' ? a + b : op === '-' ? a - b : + op === '*' ? a * b : a / b; + const output = { result }; + return { + content: [{ type: 'text', text: JSON.stringify(output) }], + structuredContent: output + }; + } +); +``` + +### Dynamic Resource +```typescript +import { ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js'; + +server.registerResource( + 'user', + new ResourceTemplate('users://{userId}', { list: undefined }), + { + title: 'User Profile', + description: 'Fetch user profile data' + }, + async (uri, { userId }) => ({ + contents: [{ + uri: uri.href, + text: `User ${userId} data here` + }] + }) +); +``` + +### Tool with Sampling +```typescript +server.registerTool( + 'summarize', + { + title: 'Text Summarizer', + description: 'Summarize text using LLM', + inputSchema: { text: z.string() }, + outputSchema: { summary: z.string() } + }, + async ({ text }) => { + const response = await server.server.createMessage({ + messages: [{ + role: 'user', + content: { type: 'text', text: `Summarize: ${text}` } + }], + maxTokens: 500 + }); + + const summary = response.content.type === 'text' ? + response.content.text : 'Unable to summarize'; + const output = { summary }; + return { + content: [{ type: 'text', text: JSON.stringify(output) }], + structuredContent: output + }; + } +); +``` + +### Prompt with Completion +```typescript +import { completable } from '@modelcontextprotocol/sdk/server/completable.js'; + +server.registerPrompt( + 'review', + { + title: 'Code Review', + description: 'Review code with specific focus', + argsSchema: { + language: completable(z.string(), value => + ['typescript', 'python', 'javascript', 'java'] + .filter(l => l.startsWith(value)) + ), + code: z.string() + } + }, + ({ language, code }) => ({ + messages: [{ + role: 'user', + content: { + type: 'text', + text: `Review this ${language} code:\n\n${code}` + } + }] + }) +); +``` + +### Error Handling +```typescript +server.registerTool( + 'risky-operation', + { + title: 'Risky Operation', + description: 'An operation that might fail', + inputSchema: { input: z.string() }, + outputSchema: { result: z.string() } + }, + async ({ input }) => { + try { + const result = await performRiskyOperation(input); + const output = { result }; + return { + content: [{ type: 'text', text: JSON.stringify(output) }], + structuredContent: output + }; + } catch (err: unknown) { + const error = err as Error; + return { + content: [{ type: 'text', text: `Error: ${error.message}` }], + isError: true + }; + } + } +); +``` diff --git a/prompts/csharp-mcp-server-generator.prompt.md b/prompts/csharp-mcp-server-generator.prompt.md new file mode 100644 index 0000000..a9f98b8 --- /dev/null +++ b/prompts/csharp-mcp-server-generator.prompt.md @@ -0,0 +1,59 @@ +--- +mode: 'agent' +description: 'Generate a complete MCP server project in C# with tools, prompts, and proper configuration' +--- + +# Generate C# MCP Server + +Create a complete Model Context Protocol (MCP) server in C# with the following specifications: + +## Requirements + +1. **Project Structure**: Create a new C# console application with proper directory structure +2. **NuGet Packages**: Include ModelContextProtocol (prerelease) and Microsoft.Extensions.Hosting +3. **Logging Configuration**: Configure all logs to stderr to avoid interfering with stdio transport +4. **Server Setup**: Use the Host builder pattern with proper DI configuration +5. **Tools**: Create at least one useful tool with proper attributes and descriptions +6. **Error Handling**: Include proper error handling and validation + +## Implementation Details + +### Basic Project Setup +- Use .NET 8.0 or later +- Create a console application +- Add necessary NuGet packages with --prerelease flag +- Configure logging to stderr + +### Server Configuration +- Use `Host.CreateApplicationBuilder` for DI and lifecycle management +- Configure `AddMcpServer()` with stdio transport +- Use `WithToolsFromAssembly()` for automatic tool discovery +- Ensure the server runs with `RunAsync()` + +### Tool Implementation +- Use `[McpServerToolType]` attribute on tool classes +- Use `[McpServerTool]` attribute on tool methods +- Add `[Description]` attributes to tools and parameters +- Support async operations where appropriate +- Include proper parameter validation + +### Code Quality +- Follow C# naming conventions +- Include XML documentation comments +- Use nullable reference types +- Implement proper error handling with McpProtocolException +- Use structured logging for debugging + +## Example Tool Types to Consider +- File operations (read, write, search) +- Data processing (transform, validate, analyze) +- External API integrations (HTTP requests) +- System operations (execute commands, check status) +- Database operations (query, update) + +## Testing Guidance +- Explain how to run the server +- Provide example commands to test with MCP clients +- Include troubleshooting tips + +Generate a complete, production-ready MCP server with comprehensive documentation and error handling. diff --git a/prompts/typescript-mcp-server-generator.prompt.md b/prompts/typescript-mcp-server-generator.prompt.md new file mode 100644 index 0000000..3c12afa --- /dev/null +++ b/prompts/typescript-mcp-server-generator.prompt.md @@ -0,0 +1,90 @@ +--- +mode: 'agent' +description: 'Generate a complete MCP server project in TypeScript with tools, resources, and proper configuration' +--- + +# Generate TypeScript MCP Server + +Create a complete Model Context Protocol (MCP) server in TypeScript with the following specifications: + +## Requirements + +1. **Project Structure**: Create a new TypeScript/Node.js project with proper directory structure +2. **NPM Packages**: Include @modelcontextprotocol/sdk, zod@3, and either express (for HTTP) or stdio support +3. **TypeScript Configuration**: Proper tsconfig.json with ES modules support +4. **Server Type**: Choose between HTTP (with Streamable HTTP transport) or stdio-based server +5. **Tools**: Create at least one useful tool with proper schema validation +6. **Error Handling**: Include comprehensive error handling and validation + +## Implementation Details + +### Project Setup +- Initialize with `npm init` and create package.json +- Install dependencies: `@modelcontextprotocol/sdk`, `zod@3`, and transport-specific packages +- Configure TypeScript with ES modules: `"type": "module"` in package.json +- Add dev dependencies: `tsx` or `ts-node` for development +- Create proper .gitignore file + +### Server Configuration +- Use `McpServer` class for high-level implementation +- Set server name and version +- Choose appropriate transport (StreamableHTTPServerTransport or StdioServerTransport) +- For HTTP: set up Express with proper middleware and error handling +- For stdio: use StdioServerTransport directly + +### Tool Implementation +- Use `registerTool()` method with descriptive names +- Define schemas using zod for input and output validation +- Provide clear `title` and `description` fields +- Return both `content` and `structuredContent` in results +- Implement proper error handling with try-catch blocks +- Support async operations where appropriate + +### Resource/Prompt Setup (Optional) +- Add resources using `registerResource()` with ResourceTemplate for dynamic URIs +- Add prompts using `registerPrompt()` with argument schemas +- Consider adding completion support for better UX + +### Code Quality +- Use TypeScript for type safety +- Follow async/await patterns consistently +- Implement proper cleanup on transport close events +- Use environment variables for configuration +- Add inline comments for complex logic +- Structure code with clear separation of concerns + +## Example Tool Types to Consider +- Data processing and transformation +- External API integrations +- File system operations (read, search, analyze) +- Database queries +- Text analysis or summarization (with sampling) +- System information retrieval + +## Configuration Options +- **For HTTP Servers**: + - Port configuration via environment variables + - CORS setup for browser clients + - Session management (stateless vs stateful) + - DNS rebinding protection for local servers + +- **For stdio Servers**: + - Proper stdin/stdout handling + - Environment-based configuration + - Process lifecycle management + +## Testing Guidance +- Explain how to run the server (`npm start` or `npx tsx server.ts`) +- Provide MCP Inspector command: `npx @modelcontextprotocol/inspector` +- For HTTP servers, include connection URL: `http://localhost:PORT/mcp` +- Include example tool invocations +- Add troubleshooting tips for common issues + +## Additional Features to Consider +- Sampling support for LLM-powered tools +- User input elicitation for interactive workflows +- Dynamic tool registration with enable/disable capabilities +- Notification debouncing for bulk updates +- Resource links for efficient data references + +Generate a complete, production-ready MCP server with comprehensive documentation, type safety, and error handling.