McpServerDemo
This project showcases a complete MCP server built with .NET 10 that exposes tools through a JSON-RPC 2.0 interface over stdio transport.
Ask AI about McpServerDemo
Powered by Claude Β· Grounded in docs
I know everything about McpServerDemo. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
MCP Server Demo
A barebones .NET 10 MCP (Model Context Protocol) server demonstrating how to expose tools for AI assistants like Claude Desktop, Cursor, and VS Code Continue.
Prerequisites
- .NET 10 SDK
- Node.js (for MCP Inspector testing)
Running the Server
cd src/McpServerDemo.WebApi
dotnet run
The server will start on http://localhost:5125 with the SSE endpoint at http://localhost:5125/sse.
Testing
Option 1: MCP Inspector (Browser)
npx @modelcontextprotocol/inspector
Open http://localhost:6274 and connect to http://localhost:5125/sse.
Option 2: MCP Explorer (Windows)
Download from https://mcp-explorer.com and connect to http://localhost:5125/sse.
Client Configuration
Claude Desktop
Edit %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"demo-docs": {
"command": "npx",
"args": ["mcp-remote", "http://localhost:5125/sse"]
}
}
}
Cursor
In Settings β MCP:
{
"mcpServers": {
"demo-docs": {
"url": "http://localhost:5125/sse",
"transport": "sse"
}
}
}
VS Code Continue
Create ~/.continue/mcpServers/demo-docs.yaml:
name: Demo Docs
version: 0.0.1
schema: v1
mcpServers:
- name: demo-docs
type: sse
url: http://localhost:5125/sse
Project Structure
McpServerDemo/
βββ McpServerDemo.sln
βββ src/
βββ McpServerDemo.WebApi/
βββ Program.cs # MCP server configuration
βββ Tools/
β βββ SearchDocs.cs # MCP tool implementation
βββ Services/
β βββ IDocumentSearchService.cs
β βββ DocumentSearchService.cs
β βββ ILlmService.cs
β βββ LlmService.cs
βββ Properties/
βββ launchSettings.json
Extending
To add more tools, create a new class in the Tools folder with the [McpServerToolType] attribute and methods decorated with [McpServerTool].
[McpServerToolType]
public class MyNewTool
{
[McpServerTool]
[Description("Does something useful")]
public async Task<string> DoSomething(
[Description("Input parameter")] string input)
{
// Implementation
}
}
License
MIT
