coredevsushant/mcp.example
If you are the rightful owner of mcp.example 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.
This repository demonstrates how to integrate a .NET-based MCP Server with a Web API to connect with Claude (Anthropic) using the Model Context Protocol (MCP).
π§ MCP Web API Example with .NET
This repository contains a simple .NET
-based MCP Server and Web API integration that demonstrates how to build and connect an API to Claude (Anthropic) using Model Context Protocol (MCP) via stdio
.
π Projects
MCP.Server
- The bridge server that connects Claude to your backend logic using MCP.MCP.WebApi
- A simple ASP.NET Core Web API exposing weather forecast data.
β Requirements
- .NET 8 SDK
- Claude Desktop App (from Anthropic)
- Git & CLI
π How to Run This with Claude Desktop
1. Clone the Repo and run MCP.WebApi
- Open MCP.sln
- Make sure web api is running on https://localhost:44394/
- Build MCP.Server
2. Configure Claude
- Open Claude Desktop App.
- Go to
File β Settings β Developer β Edit Config β claude_desktop_config.json
. - Replace it with the following:
{
"inputs": [],
"mcpServers": {
"weather": {
"type": "stdio",
"command": "dotnet",
"args": [
"run",
"--project",
"D:/MCP.example/MCP.Server",
"--no-build"
]
}
}
}
β Make sure to update the
--project
path above to point to your local path forMCP.Server
.
3. Restart Claude Desktop
Once the config is updated, restart Claude Desktop. It should automatically pick up the weather
MCP server.
4. Test it!
Ask Claude:
Get weather forecast
Claude will call your API using the MCP Server and return 5 randomized forecasts.
Then try:
create new weather entry for 1 May 2025 as temperature will be 30 and it will be very hot
Then try:
what will be temparature for 1 may
π Notes
- The
MCP.Server
communicates with theMCP.WebApi
via HTTP under the hood. - You can extend the API to support
POST
,PUT
, etc., and Claude will pick up those too (if described in your OpenAPI spec). - This is a great starter template to build your own Claude-interactive backends.
π§ Inspired by
Anthropicβs Model Context Protocol + .NET π‘
Built by Sushant