chienyuanchang/SampleRemoteMcpServer
If you are the rightful owner of SampleRemoteMcpServer 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 is a specialized server designed to handle model context interactions, providing a structured way to manage and utilize tools and resources in a remote environment.
SampleRemoteMcpServer
Introduction
SampleRemoteMcpServer is a sample implementation of a Model Context Protocol (MCP) server built with .NET. It demonstrates how to expose tools and endpoints for communication between clients and the server using HTTP and Server-Sent Events (SSE).
The purpose of this project is to:
- Showcase how to build and run an MCP server using .NET.
- Demonstrate integration with VS Code and the MCP extension.
- Provide sample endpoints and tools for client-server interaction.
- Serve as a starting point for developers building their own MCP-compatible servers.
Start the Server
Under this project folder SampleRemoteMpcServer
Start the server
dotnet run
Interact with MCP Server
Option 1 with UI
Go to http://localhost:5251/index.html
Option 2 with Bash
-
Go to
http://localhost:5251/sse?sessionId=<string>Page Will seeevent: endpoint data: /message?sessionId=<sessionId> -
Use the
sessionIdto POST and can see the result onhttp://localhost:5251/sse?sessionId=<string>Page-
List tools
curl -X POST "http://localhost:5251/message?sessionId=<sessionId>" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "tools/list", "params": {}, "id": 1 }' -
Use tool
curl -X POST "http://localhost:5251/message?sessionId=<sessionId>" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "method": "tools/call", "params": { "name": "echo", "arguments": { "username": "<username>" } }, "id": 2 }'
-
Option 3 with Github Copliot in VS code
- Use Ctrl+Shift+P to open VS Code’s command palette and select
> MCP: Add Server....

- Next select
HTTP (HTTP or Server-Sent Events).

- Enter
http://localhost:5251/as sever url.

- Enter a custom Server ID or use the generated ID

- Pick Workspace.

- MCP configs would be added into
settings.json."mcp": { "servers": { "my-mcp-server-4193fcbc": { "url": "http://localhost:5251/" } } } - Open VS Code Copilot with Agent mode

- Check the toolbox icon and can find this MCP server we just set up
