mcpField
🧠
🧠 MCP Web API Example with .NET

🧠 MCP Web API Example with .NET

Local
github.com/coredevsushantDeveloper Tools3Updated 79w ago

About 🧠 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

  1. 01MCP bridge for Claude
  2. 02ASP.NET Core weather API
  3. 03HTTP communication with backend
  4. 04Weather forecast retrieval
  5. 05Example forecast entry creation

Use cases

  1. 01Prototype a Claude-connected backend
  2. 02Let Claude retrieve weather forecasts
  3. 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.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

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


🚀 How to Run This with Claude Desktop

1. Clone the Repo and run MCP.WebApi
  1. Open MCP.sln
  2. Make sure web api is running on https://localhost:44394/
  3. Build MCP.Server

2. Configure Claude
  1. Open Claude Desktop App.
  2. Go to File → Settings → Developer → Edit Config → claude_desktop_config.json.
  3. 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 for MCP.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 the MCP.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


Comments

Markdown supported

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.