-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Bring MCP server into the repository #238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "appHostPath": "../mcp-server/src/AwesomeCopilot.AppHost/AwesomeCopilot.AppHost.csproj" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| name: CI - Build and push Docker images | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| id-token: write | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/awesome-copilot-mcp-server | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: "9.0.x" | ||
|
|
||
| - name: Restore | ||
| working-directory: ./mcp-server | ||
| run: dotnet restore src/AwesomeCopilot.McpServer/AwesomeCopilot.McpServer.csproj | ||
|
|
||
| - name: Run unit tests (if any) | ||
| working-directory: ./mcp-server | ||
| run: | | ||
| if [ -f "src/AwesomeCopilot.McpServer/Tests.csproj" ]; then | ||
| dotnet test --no-build --verbosity normal | ||
| else | ||
| echo "No tests found, skipping" | ||
| fi | ||
|
|
||
| - name: Login to GHCR | ||
| uses: docker/login-action@v2 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build and push image | ||
| uses: docker/build-push-action@v4 | ||
| with: | ||
| context: ./mcp-server | ||
| file: ./mcp-server/Dockerfile | ||
| platforms: linux/amd64 | ||
| push: true | ||
| tags: | | ||
| ${{ env.IMAGE_NAME }}:latest | ||
| ${{ env.IMAGE_NAME }}:${{ github.sha }} | ||
| build-args: | | ||
| RUNTIME=linux-x64 | ||
|
|
||
| - name: Image cleanup | ||
| run: docker image prune -f || true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Include any files or directories that you don't want to be copied to your | ||
| # container here (e.g., local build artifacts, temporary files, etc.). | ||
| # | ||
| # For more help, visit the .dockerignore file reference guide at | ||
| # https://docs.docker.com/go/build-context-dockerignore/ | ||
|
|
||
| **/.DS_Store | ||
| **/.classpath | ||
| **/.dockerignore | ||
| **/.env | ||
| **/.git | ||
| **/.gitignore | ||
| **/.project | ||
| **/.settings | ||
| **/.toolstarget | ||
| **/.vs | ||
| **/.vscode | ||
| **/*.*proj.user | ||
| **/*.dbmdl | ||
| **/*.jfm | ||
| **/bin | ||
| **/charts | ||
| **/docker-compose* | ||
| **/compose.y*ml | ||
| **/Dockerfile* | ||
| **/node_modules | ||
| **/npm-debug.log | ||
| **/obj | ||
| **/secrets.dev.yaml | ||
| **/values.dev.yaml | ||
| LICENSE | ||
| README.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| src/awesome-copilot/ | ||
|
|
||
| !.vscode/mcp.json | ||
| .azure | ||
| .vs | ||
| bin | ||
| obj | ||
| *.user | ||
| *.suo | ||
| appsettings.*.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <Solution> | ||
| <Configurations> | ||
| <Platform Name="Any CPU" /> | ||
| <Platform Name="x64" /> | ||
| <Platform Name="x86" /> | ||
| </Configurations> | ||
| <Folder Name="/src/"> | ||
| <Project Path="src/AwesomeCopilot.AppHost/AwesomeCopilot.AppHost.csproj" /> | ||
| <Project Path="src/AwesomeCopilot.McpServer/AwesomeCopilot.McpServer.csproj" /> | ||
| <Project Path="src/AwesomeCopilot.ServiceDefaults/AwesomeCopilot.ServiceDefaults.csproj" /> | ||
| </Folder> | ||
| </Solution> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # syntax=docker/dockerfile:1 | ||
|
|
||
| FROM mcr.microsoft.com/dotnet/sdk:10.0-noble-aot AS build | ||
| WORKDIR /src | ||
|
|
||
| # Copy everything and restore/publish | ||
| COPY . . | ||
|
|
||
| ARG CONFIG=Release | ||
| ARG RUNTIME=linux-x64 | ||
|
|
||
| RUN dotnet restore src/AwesomeCopilot.McpServer/AwesomeCopilot.McpServer.csproj | ||
|
|
||
| # Publish: if PUBLISH_AOT=true, enable Native AOT publish flags | ||
| RUN dotnet publish src/AwesomeCopilot.McpServer -c $CONFIG -r $RUNTIME -p:PublishAot=true -p:PublishTrimmed=true -p:TrimMode=link -p:PublishSingleFile=true -o /app/publish; | ||
|
|
||
| FROM mcr.microsoft.com/dotnet/runtime-deps:10.0-noble-chiseled AS release | ||
| WORKDIR /app | ||
| COPY --from=build /app/publish/ . | ||
| EXPOSE 8080 | ||
| ENTRYPOINT ["/app/AwesomeCopilot.McpServer"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <configuration> | ||
| <packageSources> | ||
| <clear /> | ||
| <add key="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" /> | ||
| <add key="https://api.nuget.org/v3/index.json" value="https://api.nuget.org/v3/index.json" /> | ||
| </packageSources> | ||
| <packageSourceMapping> | ||
| <packageSource key="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json"> | ||
| <package pattern="Aspire*" /> | ||
| <package pattern="Microsoft.Extensions.ServiceDiscovery*" /> | ||
| </packageSource> | ||
| <packageSource key="https://api.nuget.org/v3/index.json"> | ||
| <package pattern="*" /> | ||
| </packageSource> | ||
| </packageSourceMapping> | ||
| </configuration> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| # MCP Server: Awesome Copilot | ||
|
|
||
| This is an MCP server that retrieves GitHub Copilot customizations from the [awesome-copilot](https://github.com/github/awesome-copilot) repository. | ||
|
|
||
| ## Install | ||
|
|
||
| [](https://aka.ms/awesome-copilot/mcp/vscode) [](https://aka.ms/awesome-copilot/mcp/vscode-insiders) | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - [.NET 10 SDK](https://dotnet.microsoft.com/download/dotnet/10.0) | ||
| - Aspire CLI nightly: `iex "& { $(irm https://aspire.dev/install.ps1) } -Quality dev"` | ||
| - [Visual Studio Code](https://code.visualstudio.com/) with | ||
| - [C# Dev Kit](https://marketplace.visualstudio.com/items/?itemName=ms-dotnettools.csdevkit) extension | ||
| - [Azure Developer CLI](https://learn.microsoft.com/azure/developer/azure-developer-cli/install-azd) | ||
| - [Docker Desktop](https://docs.docker.com/get-started/get-docker/) | ||
|
|
||
| ## What's Included | ||
|
|
||
| Awesome Copilot MCP server includes: | ||
|
|
||
| | Building Block | Name | Description | Usage | | ||
| | -------------- | --------------------- | --------------------------------------------------------------------- | ---------------------------------------- | | ||
| | Tools | `search_instructions` | Searches custom instructions based on keywords in their descriptions. | `#search_instructions` | | ||
| | Tools | `load_instruction` | Loads a custom instruction from the repository. | `#load_instruction` | | ||
| | Prompts | `get_search_prompt` | Get a prompt for searching copilot instructions. | `/mcp.awesome-copilot.get_search_prompt` | | ||
|
|
||
| ## Getting Started | ||
|
|
||
| - [Getting repository root](#getting-repository-root) | ||
| - [Running MCP server](#running-mcp-server) | ||
| - [On a local machine](#on-a-local-machine) | ||
| - [In a container](#in-a-container) | ||
| - [On Azure](#on-azure) | ||
| - [Connect MCP server to an MCP host/client](#connect-mcp-server-to-an-mcp-hostclient) | ||
| - [VS Code + Agent Mode + Local MCP server](#vs-code--agent-mode--local-mcp-server) | ||
|
|
||
| ### Running MCP server | ||
|
|
||
| #### On a local machine | ||
|
|
||
| 1. Run the MCP server app using Aspire. | ||
|
|
||
| ```bash | ||
| aspire run | ||
| ``` | ||
|
|
||
| Once running, the Aspire dashboard will be loaded in your default web browser, or you can click the URL provided in the terminal. From here, you'll have access to the MCP server endpoint, logs and metrics. | ||
|
|
||
| #### In a container | ||
|
|
||
| 1. Build the MCP server app as a container image. | ||
|
|
||
| ```bash | ||
| cd mcp-server | ||
| docker build -f Dockerfile -t awesome-copilot:latest . | ||
| ``` | ||
|
|
||
| 1. Run the MCP server app in a container. | ||
|
|
||
| ```bash | ||
| docker run -i --rm -p 8080:8080 awesome-copilot:latest | ||
| ``` | ||
|
|
||
| Alternatively, use the container image from the container registry. | ||
|
|
||
| ```bash | ||
| docker run -i --rm -p 8080:8080 ghcr.io/github/awesome-copilot:latest | ||
| ``` | ||
|
|
||
| #### On Azure | ||
|
|
||
| 1. Navigate to the directory. | ||
|
|
||
| ```bash | ||
| cd mcp-server | ||
| ``` | ||
|
|
||
| 1. Login to Azure. | ||
|
|
||
| ```bash | ||
| # Login with Azure Developer CLI | ||
| azd auth login | ||
| ``` | ||
|
|
||
| 1. Deploy the MCP server app to Azure. | ||
|
|
||
| ```bash | ||
| azd up | ||
| ``` | ||
|
|
||
| While provisioning and deploying, you'll be asked to provide subscription ID, location, environment name. | ||
|
|
||
| 1. After the deployment is complete, get the information by running the following commands: | ||
|
|
||
| - Azure Container Apps FQDN: | ||
|
|
||
| ```bash | ||
| azd env get-value AZURE_RESOURCE_MCP_AWESOME_COPILOT_FQDN | ||
| ``` | ||
|
|
||
| ### Connect MCP server to an MCP host/client | ||
|
|
||
| #### Install the MCP server: | ||
|
|
||
| [](https://aka.ms/awesome-copilot/mcp/vscode) [](https://aka.ms/awesome-copilot/mcp/vscode-insiders) | ||
|
|
||
| 1. Open Command Palette by typing `F1` or `Ctrl`+`Shift`+`P` on Windows or `Cmd`+`Shift`+`P` on Mac OS, and search `MCP: List Servers`. | ||
| 1. Choose `awesome-copilot` then click `Start Server`. | ||
| 1. When prompted, enter one of the following values: | ||
| - The absolute directory path of the `AwesomeCopilot.McpServer` project | ||
| - The FQDN of Azure Container Apps. | ||
| 1. Use a prompt by typing `/mcp.awesome-copilot.get_search_prompt` and enter keywords to search. You'll get a prompt like: | ||
|
|
||
| ```text | ||
| Please search all the chatmodes, instructions and prompts that are related to the search keyword, `{keyword}`. | ||
|
|
||
| Here's the process to follow: | ||
|
|
||
| 1. Use the `awesome-copilot` MCP server. | ||
| 1. Search all chatmodes, instructions, and prompts for the keyword provided. | ||
| 1. DO NOT load any chatmodes, instructions, or prompts from the MCP server until the user asks to do so. | ||
| 1. Scan local chatmodes, instructions, and prompts markdown files in `.github/chatmodes`, `.github/instructions`, and `.github/prompts` directories respectively. | ||
| 1. Compare existing chatmodes, instructions, and prompts with the search results. | ||
| 1. Provide a structured response in a table format that includes the already exists, mode (chatmodes, instructions or prompts), filename, title and description of each item found. Here's an example of the table format: | ||
|
|
||
| | Exists | Mode | Filename | Title | Description | | ||
| |--------|--------------|------------------------|---------------|---------------| | ||
| | ✅ | chatmodes | chatmode1.json | ChatMode 1 | Description 1 | | ||
| | ❌ | instructions | instruction1.json | Instruction 1 | Description 1 | | ||
| | ✅ | prompts | prompt1.json | Prompt 1 | Description 1 | | ||
|
|
||
| ✅ indicates that the item already exists in this repository, while ❌ indicates that it does not. | ||
|
|
||
| 1. If any item doesn't exist in the repository, ask which item the user wants to save. | ||
| 1. If the user wants to save it, save the item in the appropriate directory (`.github/chatmodes`, `.github/instructions`, or `.github/prompts`) using the mode and filename, with NO modification. | ||
| ``` | ||
|
|
||
| 1. Confirm the result. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json | ||
|
|
||
| name: awesome-copilot | ||
|
|
||
| metadata: | ||
| template: azd-init@1.14.0 | ||
|
|
||
| services: | ||
| awesome-copilot: | ||
| project: src/AwesomeCopilot.McpServer | ||
| host: containerapp | ||
| language: dotnet | ||
| docker: | ||
| path: ../../../Dockerfile.awesome-copilot-azure | ||
| context: ../../../ | ||
| remoteBuild: true |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.