Here we assume you already have a working server code. Please locate a server from one of the earlier chapters.
Here's a file you use for reference, mcp.json.
Change the server entry as needed to point out the absolute path to your server including the needed full command to run.
In the example file referred above the server entry looks like so:
node.js
```json "hello-mcp": { "command": "node", "args": [ "build/index.js" ] } ```.NET
You might have to enter the GitHub repository root, which can be fetched from the command, git rev-parse --show-toplevel.
This corresponds to running a command like so: node build/index.js.
- Change this server entry to fit where your server file is located or to what's needed to startup your server depending on your chosen runtime and server location.
-
Click the
playicon, once you've added mcp.json to ./vscode folder,Observe the tooling icon change to increase the number of available tools. Tooling icon is located right above the chat field in GitHub Copilot.
-
Type a prompt in your chat window that matches the description of your tool. For example to trigger the tool
addtype something like "add 3 to 20".You should see a tool being presented above the chat text box indicating for you to select to run the tool like in this visual:
Selecting the tool should produce a numeric result saying "23" if your prompt was like we mentioned previously.

{ "inputs": [ { "type": "promptString", "id": "repository-root", "description": "The absolute path to the repository root" } ], "servers": { "calculator-mcp-dotnet": { "type": "stdio", "command": "dotnet", "args": [ "run", "--project", "${input:repository-root}/03-GettingStarted/02-client/solution/server/server.csproj" ] } } }