Skip to content

Commit fb0a607

Browse files
authored
Update Awesome Copilot (#29)
* Add a prompt building block for easy search * Update README * Update parameter name to be more intuitive * Update GHA workflow
1 parent 1090739 commit fb0a607

File tree

16 files changed

+237
-72
lines changed

16 files changed

+237
-72
lines changed

.github/workflows/build-awesome-copilot.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
with:
2424
image_name: ${{ matrix.image_name }}
2525
extension: ${{ matrix.extension }}
26+
force: false
2627
secrets: inherit
2728

2829
build-and-push-image-http:
@@ -44,4 +45,5 @@ jobs:
4445
with:
4546
image_name: ${{ matrix.image_name }}
4647
extension: ${{ matrix.extension }}
48+
force: false
4749
secrets: inherit

.github/workflows/build-container.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
extension:
1010
required: true
1111
type: string
12+
force:
13+
required: false
14+
type: boolean
15+
default: false
1216

1317
env:
1418
REGISTRY: ghcr.io
@@ -91,7 +95,7 @@ jobs:
9195
fi
9296
9397
- name: Check if Dockerfile exists
94-
if: env.BUILD_IMAGE == 'true'
98+
if: env.BUILD_IMAGE == 'true' || inputs.force == true
9599
id: check-dockerfile
96100
shell: bash
97101
run: |
@@ -103,7 +107,7 @@ jobs:
103107
104108
- name: Log in to the Container registry
105109
if: |
106-
env.BUILD_IMAGE == 'true' &&
110+
(env.BUILD_IMAGE == 'true' || inputs.force == true) &&
107111
steps.check-dockerfile.outputs.exists == 'true'
108112
uses: docker/login-action@v3
109113
with:
@@ -113,7 +117,7 @@ jobs:
113117

114118
- name: Extract metadata (tags, labels) for Docker
115119
if: |
116-
env.BUILD_IMAGE == 'true' &&
120+
(env.BUILD_IMAGE == 'true' || inputs.force == true) &&
117121
steps.check-dockerfile.outputs.exists == 'true'
118122
id: meta
119123
uses: docker/metadata-action@v5
@@ -122,13 +126,13 @@ jobs:
122126

123127
- name: Set up Docker Buildx
124128
if: |
125-
env.BUILD_IMAGE == 'true' &&
129+
(env.BUILD_IMAGE == 'true' || inputs.force == true) &&
126130
steps.check-dockerfile.outputs.exists == 'true'
127131
uses: docker/setup-buildx-action@v3
128132

129133
- name: Build and push Docker image - multi-platform
130134
if: |
131-
env.BUILD_IMAGE == 'true' &&
135+
(env.BUILD_IMAGE == 'true' || inputs.force == true) &&
132136
steps.check-dockerfile.outputs.exists == 'true' &&
133137
steps.platform.outputs.supports_multiplatform == 'true'
134138
id: push-multiplatform
@@ -143,7 +147,7 @@ jobs:
143147

144148
- name: Generate artifact attestation - multi-platform
145149
if: |
146-
env.BUILD_IMAGE == 'true' &&
150+
(env.BUILD_IMAGE == 'true' || inputs.force == true) &&
147151
steps.check-dockerfile.outputs.exists == 'true' &&
148152
steps.platform.outputs.supports_multiplatform == 'true'
149153
uses: actions/attest-build-provenance@v2
@@ -154,7 +158,7 @@ jobs:
154158

155159
- name: Build and push Docker image - amd64 only
156160
if: |
157-
env.BUILD_IMAGE == 'true' &&
161+
(env.BUILD_IMAGE == 'true' || inputs.force == true) &&
158162
steps.check-dockerfile.outputs.exists == 'true' &&
159163
steps.platform.outputs.supports_multiplatform == 'false'
160164
id: push-amd64
@@ -169,7 +173,7 @@ jobs:
169173

170174
- name: Generate artifact attestation - amd64 only
171175
if: |
172-
env.BUILD_IMAGE == 'true' &&
176+
(env.BUILD_IMAGE == 'true' || inputs.force == true) &&
173177
steps.check-dockerfile.outputs.exists == 'true' &&
174178
steps.platform.outputs.supports_multiplatform == 'false'
175179
uses: actions/attest-build-provenance@v2

.github/workflows/build.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
with:
2424
image_name: ${{ matrix.image_name }}
2525
extension: ${{ matrix.extension }}
26+
force: true
2627
secrets: inherit
2728

2829
build-and-push-image-awesome-copilot-stdio:
@@ -44,6 +45,7 @@ jobs:
4445
with:
4546
image_name: ${{ matrix.image_name }}
4647
extension: ${{ matrix.extension }}
48+
force: true
4749
secrets: inherit
4850

4951
build-and-push-image-awesome-copilot-http:
@@ -65,4 +67,5 @@ jobs:
6567
with:
6668
image_name: ${{ matrix.image_name }}
6769
extension: ${{ matrix.extension }}
70+
force: true
6871
secrets: inherit

awesome-copilot/.vscode/mcp.http.container.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"servers": {
3-
"mcp-awesome-copilot-http-container": {
3+
"awesome-copilot": {
44
"type": "http",
55
"url": "http://0.0.0.0:8080/mcp"
66
}

awesome-copilot/.vscode/mcp.http.local.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"servers": {
3-
"mcp-awesome-copilot-http-local": {
3+
"awesome-copilot": {
44
"type": "http",
55
"url": "http://0.0.0.0:5250/mcp"
66
}

awesome-copilot/.vscode/mcp.http.remote.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
}
88
],
99
"servers": {
10-
"mcp-awesome-copilot-http-remote": {
10+
"awesome-copilot": {
1111
"type": "http",
1212
"url": "https://${input:acaapp-server-fqdn}/mcp"
1313
}

awesome-copilot/.vscode/mcp.stdio.container.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"servers": {
3-
"mcp-awesome-copilot-stdio-container": {
3+
"awesome-copilot": {
44
"type": "stdio",
55
"command": "docker",
66
"args": [
77
"run",
88
"-i",
99
"--rm",
10-
"mcp-awesome-copilot-stdio:latest"
10+
"ghcr.io/microsoft/mcp-dotnet-samples/awesome-copilot:stdio"
1111
]
1212
}
1313
}

awesome-copilot/.vscode/mcp.stdio.local.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
}
88
],
99
"servers": {
10-
"mcp-awesome-copilot-stdio-local": {
10+
"awesome-copilot": {
1111
"type": "stdio",
1212
"command": "dotnet",
1313
"args": [

awesome-copilot/README.md

Lines changed: 124 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ This is an MCP server that retrieves GitHub Copilot customizations from the [awe
1515
- [Azure Developer CLI](https://learn.microsoft.com/azure/developer/azure-developer-cli/install-azd)
1616
- [Docker Desktop](https://docs.docker.com/get-started/get-docker/)
1717

18+
## What's Included
19+
20+
Awesome Copilot MCP server includes:
21+
22+
| Building Block | Name | Description | Usage |
23+
|----------------|-----------------------|-----------------------------------------------------------------------|------------------------------------------|
24+
| Tools | `search_instructions` | Searches custom instructions based on keywords in their descriptions. | `#search_instructions` |
25+
| Tools | `load_instruction` | Loads a custom instruction from the repository. | `#load_instruction` |
26+
| Prompts | `get_search_prompt` | Get a prompt for searching copilot instructions. | `/mcp.awesome-copilot.get_search_prompt` |
27+
1828
## Getting Started
1929

2030
- [Build ASP.NET Core MCP server (STDIO) locally in a container](#build-aspnet-core-mcp-server-stdio-locally-in-a-container)
@@ -52,7 +62,7 @@ This is an MCP server that retrieves GitHub Copilot customizations from the [awe
5262

5363
```bash
5464
cd $REPOSITORY_ROOT/awesome-copilot
55-
docker build -f Dockerfile.stdio -t mcp-awesome-copilot-stdio:latest .
65+
docker build -f Dockerfile.stdio -t awesome-copilot:stdio .
5666
```
5767

5868
### Run ASP.NET Core MCP server (Streamable HTTP) locally
@@ -94,19 +104,19 @@ This is an MCP server that retrieves GitHub Copilot customizations from the [awe
94104

95105
```bash
96106
cd $REPOSITORY_ROOT/awesome-copilot
97-
docker build -f Dockerfile.http -t mcp-awesome-copilot-http:latest .
107+
docker build -f Dockerfile.http -t awesome-copilot:http .
98108
```
99109

100110
1. Run the MCP server app in a container
101111

102112
```bash
103-
docker run -d -p 8080:8080 --name mcp-awesome-copilot-http mcp-awesome-copilot-http:latest
113+
docker run -i --rm -p 8080:8080 awesome-copilot:http
104114
```
105115

106116
Alternatively, use the container image from the container registry.
107117

108118
```bash
109-
docker run -d -p 8080:8080 --name mcp-awesome-copilot-http ghcr.io/microsoft/mcp-dotnet-samples/awesome-copilot:http
119+
docker run -i --rm -p 8080:8080 ghcr.io/microsoft/mcp-dotnet-samples/awesome-copilot:http
110120
```
111121

112122
### Run ASP.NET Core MCP server (Streamable HTTP) remotely
@@ -165,13 +175,31 @@ This is an MCP server that retrieves GitHub Copilot customizations from the [awe
165175
```
166176
167177
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`.
168-
1. Choose `mcp-awesome-copilot-stdio-local` then click `Start Server`.
178+
1. Choose `awesome-copilot` then click `Start Server`.
169179
1. When prompted, enter the absolute directory of the `McpAwesomeCopilot.ConsoleApp` project.
170-
1. Enter prompt like:
180+
1. Use a prompt by typing `/mcp.awesome-copilot.get_search_prompt` and enter keywords to search. You'll get a prompt like:
171181

172182
```text
173-
Show me the list of copilot instructions about react.
174-
Save the react instruction to .github/copilot-instructions.md
183+
Please search all the chatmodes, instructions and prompts that are related to the search keyword, `{keyword}`.
184+
185+
Here's the process to follow:
186+
187+
1. Use the `awesome-copilot` MCP server.
188+
1. Search all chatmodes, instructions, and prompts for the keyword provided.
189+
1. Scan local chatmodes, instructions, and prompts markdown files in `.github/chatmodes`, `.github/instructions`, and `.github/prompts` directories respectively.
190+
1. Compare existing chatmodes, instructions, and prompts with the search results.
191+
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:
192+
193+
| Exists | Mode | Filename | Title | Description |
194+
|--------|--------------|------------------------|---------------|---------------|
195+
|| chatmodes | chatmode1.json | ChatMode 1 | Description 1 |
196+
|| instructions | instruction1.json | Instruction 1 | Description 1 |
197+
|| prompts | prompt1.json | Prompt 1 | Description 1 |
198+
199+
✅ indicates that the item already exists in this repository, while ❌ indicates that it does not.
200+
201+
1. If any item doesn't exist in the repository, ask which item the user wants to save.
202+
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.
175203
```
176204
177205
1. Confirm the result.
@@ -204,15 +232,31 @@ This is an MCP server that retrieves GitHub Copilot customizations from the [awe
204232
-Destination $REPOSITORY_ROOT/.vscode/mcp.json -Force
205233
```
206234
207-
> **NOTE**: If you want to use the container image from the container registry, replace `mcp-awesome-copilot-stdio:latest` with `ghcr.io/microsoft/mcp-dotnet-samples/awesome-copilot:stdio` in the `.vscode/mcp.json` file
208-
209235
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`.
210-
1. Choose `mcp-awesome-copilot-stdio-container` then click `Start Server`.
211-
1. Enter prompt like:
236+
1. Choose `awesome-copilot` then click `Start Server`.
237+
1. Use a prompt by typing `/mcp.awesome-copilot.get_search_prompt` and enter keywords to search. You'll get a prompt like:
212238
213239
```text
214-
Show me the list of copilot instructions about react.
215-
Save the react instruction to .github/copilot-instructions.md
240+
Please search all the chatmodes, instructions and prompts that are related to the search keyword, `{keyword}`.
241+
242+
Here's the process to follow:
243+
244+
1. Use the `awesome-copilot` MCP server.
245+
1. Search all chatmodes, instructions, and prompts for the keyword provided.
246+
1. Scan local chatmodes, instructions, and prompts markdown files in `.github/chatmodes`, `.github/instructions`, and `.github/prompts` directories respectively.
247+
1. Compare existing chatmodes, instructions, and prompts with the search results.
248+
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:
249+
250+
| Exists | Mode | Filename | Title | Description |
251+
|--------|--------------|------------------------|---------------|---------------|
252+
|| chatmodes | chatmode1.json | ChatMode 1 | Description 1 |
253+
|| instructions | instruction1.json | Instruction 1 | Description 1 |
254+
|| prompts | prompt1.json | Prompt 1 | Description 1 |
255+
256+
✅ indicates that the item already exists in this repository, while ❌ indicates that it does not.
257+
258+
1. If any item doesn't exist in the repository, ask which item the user wants to save.
259+
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.
216260
```
217261
218262
1. Confirm the result.
@@ -246,12 +290,30 @@ This is an MCP server that retrieves GitHub Copilot customizations from the [awe
246290
```
247291
248292
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`.
249-
1. Choose `mcp-awesome-copilot-http-local` then click `Start Server`.
250-
1. Enter prompt like:
293+
1. Choose `awesome-copilot` then click `Start Server`.
294+
1. Use a prompt by typing `/mcp.awesome-copilot.get_search_prompt` and enter keywords to search. You'll get a prompt like:
251295
252296
```text
253-
Show me the list of copilot instructions about react.
254-
Save the react instruction to .github/copilot-instructions.md
297+
Please search all the chatmodes, instructions and prompts that are related to the search keyword, `{keyword}`.
298+
299+
Here's the process to follow:
300+
301+
1. Use the `awesome-copilot` MCP server.
302+
1. Search all chatmodes, instructions, and prompts for the keyword provided.
303+
1. Scan local chatmodes, instructions, and prompts markdown files in `.github/chatmodes`, `.github/instructions`, and `.github/prompts` directories respectively.
304+
1. Compare existing chatmodes, instructions, and prompts with the search results.
305+
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:
306+
307+
| Exists | Mode | Filename | Title | Description |
308+
|--------|--------------|------------------------|---------------|---------------|
309+
|| chatmodes | chatmode1.json | ChatMode 1 | Description 1 |
310+
|| instructions | instruction1.json | Instruction 1 | Description 1 |
311+
|| prompts | prompt1.json | Prompt 1 | Description 1 |
312+
313+
✅ indicates that the item already exists in this repository, while ❌ indicates that it does not.
314+
315+
1. If any item doesn't exist in the repository, ask which item the user wants to save.
316+
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.
255317
```
256318
257319
1. Confirm the result.
@@ -285,12 +347,30 @@ This is an MCP server that retrieves GitHub Copilot customizations from the [awe
285347
```
286348
287349
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`.
288-
1. Choose `mcp-awesome-copilot-http-container` then click `Start Server`.
289-
1. Enter prompt like:
350+
1. Choose `awesome-copilot` then click `Start Server`.
351+
1. Use a prompt by typing `/mcp.awesome-copilot.get_search_prompt` and enter keywords to search. You'll get a prompt like:
290352
291353
```text
292-
Show me the list of copilot instructions about react.
293-
Save the react instruction to .github/copilot-instructions.md
354+
Please search all the chatmodes, instructions and prompts that are related to the search keyword, `{keyword}`.
355+
356+
Here's the process to follow:
357+
358+
1. Use the `awesome-copilot` MCP server.
359+
1. Search all chatmodes, instructions, and prompts for the keyword provided.
360+
1. Scan local chatmodes, instructions, and prompts markdown files in `.github/chatmodes`, `.github/instructions`, and `.github/prompts` directories respectively.
361+
1. Compare existing chatmodes, instructions, and prompts with the search results.
362+
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:
363+
364+
| Exists | Mode | Filename | Title | Description |
365+
|--------|--------------|------------------------|---------------|---------------|
366+
|| chatmodes | chatmode1.json | ChatMode 1 | Description 1 |
367+
|| instructions | instruction1.json | Instruction 1 | Description 1 |
368+
|| prompts | prompt1.json | Prompt 1 | Description 1 |
369+
370+
✅ indicates that the item already exists in this repository, while ❌ indicates that it does not.
371+
372+
1. If any item doesn't exist in the repository, ask which item the user wants to save.
373+
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.
294374
```
295375
296376
1. Confirm the result.
@@ -324,13 +404,31 @@ This is an MCP server that retrieves GitHub Copilot customizations from the [awe
324404
```
325405
326406
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`.
327-
1. Choose `mcp-awesome-copilot-http-remote` then click `Start Server`.
407+
1. Choose `awesome-copilot` then click `Start Server`.
328408
1. Enter the Azure Container Apps FQDN.
329-
1. Enter prompt like:
409+
1. Use a prompt by typing `/mcp.awesome-copilot.get_search_prompt` and enter keywords to search. You'll get a prompt like:
330410
331411
```text
332-
Show me the list of copilot instructions about react.
333-
Save the react instruction to .github/copilot-instructions.md
412+
Please search all the chatmodes, instructions and prompts that are related to the search keyword, `{keyword}`.
413+
414+
Here's the process to follow:
415+
416+
1. Use the `awesome-copilot` MCP server.
417+
1. Search all chatmodes, instructions, and prompts for the keyword provided.
418+
1. Scan local chatmodes, instructions, and prompts markdown files in `.github/chatmodes`, `.github/instructions`, and `.github/prompts` directories respectively.
419+
1. Compare existing chatmodes, instructions, and prompts with the search results.
420+
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:
421+
422+
| Exists | Mode | Filename | Title | Description |
423+
|--------|--------------|------------------------|---------------|---------------|
424+
|| chatmodes | chatmode1.json | ChatMode 1 | Description 1 |
425+
|| instructions | instruction1.json | Instruction 1 | Description 1 |
426+
|| prompts | prompt1.json | Prompt 1 | Description 1 |
427+
428+
✅ indicates that the item already exists in this repository, while ❌ indicates that it does not.
429+
430+
1. If any item doesn't exist in the repository, ask which item the user wants to save.
431+
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.
334432
```
335433
336434
1. Confirm the result.

0 commit comments

Comments
 (0)