Give Your .NET REST API an AI Mouth: Adding MCP So Claude and Gemini Can Actually Use It A developer at T1Tech detailed how to give a .NET REST API an AI interface by adding the Model Context Protocol (MCP), enabling AI clients like Claude and Gemini to discover and call API endpoints as tools. The approach uses the official C# SDK to create a thin MCP server that translates between AI clients and the existing JWT-secured API, with authentication handled via OAuth 2.1 to preserve user identity. Last quarter a product manager dropped a Slack message that a lot of us are getting now: "Can I just ask Claude to pull the open invoices from our system?" We already had the API. Fully built, JWT-secured, battle-tested in production. The problem was never the data — it was that an LLM has no idea our /api/invoices?status=open endpoint exists, and even if it did, it can't read our OpenAPI spec and authenticate itself. The Model Context Protocol MCP is the missing adapter. This is how you bolt it onto an API you already own, in an afternoon, and what to do about authentication before security reviews it. MCP is an open protocol that lets AI clients Claude Desktop, Gemini, Cursor, and others discover and call your capabilities as "tools." You do not rewrite your API. You stand up a thin MCP server that exposes selected endpoints as tools and forwards the calls. AI Chat Claude / Gemini │ MCP protocol JSON-RPC ▼ ┌──────────────────────┐ │ MCP Server .NET │ ← McpServerTool methods │ - GetOpenInvoices │ │ - CreateTicket │ └─────────┬────────────┘ │ HttpClient + Bearer/API key ▼ ┌──────────────────────┐ │ Existing REST API │ ← unchanged, still JWT-secured └──────────────────────┘ The MCP server is a translator: it speaks JSON-RPC to the model and plain HTTP to your existing API. Your business logic never moves. Use the official C SDK maintained together with Microsoft . Add it to a new minimal ASP.NET Core project so you can host a remote MCP server over Streamable HTTP: dotnet add package ModelContextProtocol.AspNetCore WebApplicationBuilder builder = WebApplication.CreateBuilder args ; builder.Services .AddMcpServer .WithHttpTransport // Streamable HTTP for remote clients .WithToolsFromAssembly ; // discover McpServerTool methods // Typed client to your EXISTING API builder.Services.AddHttpClient "BackendApi", static client = { client.BaseAddress = new Uri "https://api.internal.t1tech.com/" ; } ; WebApplication app = builder.Build ; app.MapMcp ; // exposes the /mcp endpoint app.Run ; That is the entire host. MapMcp wires up discovery, so any compliant AI client can enumerate your tools. A tool is just a method. The attributes and XML-style descriptions are not decoration — the model reads them to decide when and how to call you. Be explicit; vague descriptions cause hallucinated arguments. McpServerToolType public sealed class InvoiceTools { private readonly IHttpClientFactory httpClientFactory; public InvoiceTools IHttpClientFactory httpClientFactory { httpClientFactory = httpClientFactory; } McpServerTool Description "Returns open unpaid invoices for a given customer ID." public async Task