unmyr/mcp-gh-copilot-starter-node
If you are the rightful owner of mcp-gh-copilot-starter-node and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Model Context Protocol (MCP) server facilitates dynamic interaction between a client and a server using a standardized protocol, enabling seamless execution of tasks and queries.
== MCP example using node.js
=== Environment This example uses the MCP protocol to run a TypeScript program that simulates a reincarnation scenario. The program is executed using Node.js and TypeScript, allowing for dynamic interaction with the MCP server.
- Windows 11 ** WSL2 *** Ubuntu 22.04.2 LTS
- Node.js: v18.18.0
- VS-Code ** Chat 〉 MCP: Enabled (Preview)
=== Installation
- Install node using n package manager:
[source,shell]
sudo n lts
- Install typescript package locally:
[source,shell]
npm install --save-dev ts-node typescript
=== To run mcp server write mcp.json file
Create a .vscode/mcp.json
file in the root of your project with the following content:
[source,json] ..vscode/mcp.json
{ "inputs": [], "servers": { "mcp-stdio-reincarnate": { "type": "stdio", "command": "npx", "args": ["ts-node", "${workspaceFolder}/src/tool_reincarnate.ts"], "env": {} } } }
=== Example
- Open
.vscode/mcp.json
, and start mcp server:
image::docs/images/chat_02_start_mcp_server.png[]
- Open the settings and ask the following question:
[source,plaintext] .Asking the question
Please tell me where Mary will be reincarnated.
- Click the "Continue" button to run the code:
image::docs/images/chat_03_1_reincarnate_run.png[]
- The answer will be displayed in the chat window:
image::docs/images/chat_03_2_reincarnate_result.png[]