🧠 MCP Web API Example with .NET
LocalAbout 🧠 MCP Web API Example with .NET
A .NET example project that connects Claude to an ASP.NET Core weather API through an MCP bridge. It is intended as a starting point for developers building API-backed Claude integrations.
Key features
- 01MCP bridge for Claude
- 02ASP.NET Core weather API
- 03HTTP communication with backend
- 04Weather forecast retrieval
- 05Example forecast entry creation
Use cases
- 01Prototype a Claude-connected backend
- 02Let Claude retrieve weather forecasts
- 03Extend an API with described operations
MCP support
The MCP.Server component connects Claude over stdio and forwards requests to MCP.WebApi over HTTP. The example demonstrates exposing API-backed weather operations through MCP.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project README🧠 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
--projectpath 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.Servercommunicates with theMCP.WebApivia 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
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.