csharp-mcp-server-blazor
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@csharp-mcp-server-blazorList the available C# methods and execute the Add tool with 5 and 3."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
C# MCP Server & Blazor WebAssembly Inspector
A companion repository for the blog post: Building a C# MCP Server with a Blazor WebAssembly Inspector.
This is a local, pedagogical MCP server built on .NET 10. It uses the official MCP C# SDK v2.2.0 and its stateless Streamable HTTP transport at POST /mcp, alongside a Blazor WebAssembly page for inspecting the sample tools. Customer and weather responses are simulated fixtures; the system-metrics tool intentionally reports live data from the local process. No tool queries an external system.
The Blazor page is a diagnostic UI, not an MCP client: its buttons use the application-specific/api/mcp/* API to inspect and invoke the sample tools. The actual MCP transport is POST /mcp.
Protocol and transport
The server uses the current 2026-07-28 MCP HTTP wire format through MCP C# SDK v2.2.0. It is stateless: each POST /mcp request is independent, and the server does not issue or retain an Mcp-Session-Id. The current revision uses server/discover for bootstrap rather than the historical initialize handshake, and HTTP requests carry the protocol version in the MCP-Protocol-Version header.
Streamable HTTP is the recommended HTTP transport for new MCP servers. See the official MCP C# SDK transport guidance and stateless HTTP guidance for the protocol behaviour and production deployment options.
Related MCP server: sharplens-mcp
Solution structure
McpServerApp/McpServerApp: ASP.NET Core host forPOST /mcpand the diagnostic inspector API.McpServerApp/McpServerApp.Client: Blazor WebAssembly diagnostic inspector UI.McpServerApp/McpServerApp.Tests: unit, integration, and bUnit component tests.e2e/: Playwright browser test for local diagnostic inspection and invocation.
Run locally
Prerequisites: .NET 10 SDK. Install Node.js only when running the browser test.
git clone https://github.com/cmalpass/csharp-mcp-server-blazor.git
cd csharp-mcp-server-blazor
dotnet run --project McpServerApp/McpServerAppOpen the local address printed by ASP.NET Core (normally http://localhost:5000) to explore the sample tools and local diagnostic log. For a client integration, point a current MCP client at the local POST /mcp endpoint and follow that client’s official, up-to-date configuration documentation.
Production considerations
This repository teaches the protocol and tool-inspection flow; it is not a complete production deployment template. Before exposing an MCP server, design authentication and authorization for the tool surface, validate allowed origins and host names, apply request/concurrency/rate limits, avoid logging secrets or raw untrusted payloads, and run behind HTTPS and an appropriate reverse proxy. The official C# SDK documentation is the source of truth for current transport and deployment behaviour.
If a reverse proxy terminates TLS, configure it to overwrite the forwarded headers and set Mcp:TrustedProxyAddress to that proxy's exact IP address (for example, Mcp__TrustedProxyAddress=10.0.0.10 as an environment variable). The application ignores forwarded headers unless this exact proxy is configured; never enable trust for arbitrary client-supplied X-Forwarded-* headers.
Testing
Run the .NET test suite:
dotnet test --solution McpServerApp/McpServerApp.sln --configuration ReleaseRun the local browser test:
npm ci
npm run test:e2ePlaywright keeps screenshots, traces, and its HTML report in ignored test-output directories (test-results/ and playwright-report/). Running the test never updates tracked documentation images.
License
This project is licensed under the MIT License.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA dual-transport MCP server that exposes your API as tools to LLM clients, supporting both stdio transport for local clients like Claude Desktop and HTTP/SSE transport for remote clients like OpenAI's Responses API.
- AlicenseAqualityAmaintenanceA Model Context Protocol (MCP) server providing 62 AI-optimized tools for .NET/C# semantic code analysis, navigation, refactoring, and code generation using Microsoft Roslyn. Built for AI coding agents - provides compiler-accurate code understanding that AI cannot infer from reading source files alone.6231MIT
- FlicenseAqualityDmaintenanceMinimal MCP server bridging a Roslyn C# language server to AI agents, exposing tools for diagnostics, call hierarchy, and type hierarchy.1
- AlicenseNot gradedqualityAmaintenanceGive your AI assistant superpowers for .NET development! This MCP server connects GitHub Copilot, Claude, and other AI assistants directly to the .NET SDK, enabling them to create projects, manage packages, run builds, and more—all through natural language.31MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cmalpass/csharp-mcp-server-blazor'
If you have feedback or need assistance with the MCP directory API, please join our Discord server