A Model Context Protocol (MCP) server built with C# and .NET 10. Tools, resources and prompts, backed by Azure SQL, secured with Microsoft Entra ID and deployed to Azure Container Apps. Companion code for the series on bitoftech.net.
MCPpedia last refreshed this data
Building MCP Servers Dotnet is an MCP server that a Model Context Protocol (MCP) server built with C# and .NET 10. Tools, resources and prompts, backed by Azure SQL, secured with Microsoft Entra ID and deployed to Azure Container Apps. Companion code for the series on bitoftech.net. Its tool list has not been published yet over http, requires no API key, and scores 33/100 on MCPpedia's security, maintenance and efficiency rubric.
Config is the same across clients - only the file and path differ.
{
"mcpServers": {
"building-mcp-servers-dotnet": {
"url": "<see-readme-for-url>"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
Source code for the blog series Building MCP Servers in .NET for AI Agents on bitoftech.net.
This server supports HTTP transport. Be the first to test it - help the community know if it works.
Five weighted categories - click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Be the first to review
Have you used this server?
Share your experience - it helps other developers decide.
Sign in to write a review.
Others in cloud / developer-tools
XcodeBuildMCP provides tools for Xcode project management, simulator management, and app utilities.
Manage Supabase projects — databases, auth, storage, and edge functions
MCP server for using the GitLab API
The official MCP Server for the Mux API
MCP Security Weekly
Get CVE alerts and security updates for Building MCP Servers Dotnet and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
Source code for the blog series Building MCP Servers in .NET for AI Agents on bitoftech.net.
The sample is a Model Context Protocol server for expense reports and approvals. It starts as a console application with two tools and in-memory data, and ends as a secured service running in Azure that four different AI clients can call.
| Part | Post | Tag |
|---|---|---|
| 1 | What is the Model Context Protocol? An Introduction for .NET Developers | no code |
| 2 | Building Your First MCP Server in C# | part-02 |
| 3 | MCP Tools, Resources and Prompts in .NET | part-03 |
| 4 | Wiring MCP Tools to Azure SQL and External APIs | part-04 |
| 5 | Hosting an MCP Server in ASP.NET Core with Streamable HTTP | part-05 |
| 6 | Building an MCP Client and AI Agent in .NET | part-06 |
| 7 | Securing an MCP Server with Microsoft Entra ID | part-07 |
| 8 | Deploying an MCP Server to Azure Container Apps | part-08 |
| 9 | Connecting an MCP Server to Microsoft Foundry Agent Service | part-09 |
| 10 | Observability, Cost Control and MCP Security | part-10 |
main always holds the latest state. To get the code exactly as it appears in a given post,
check out that post's tag:
git checkout part-02
Tools:
| Tool | Added in |
|---|---|
search_expense_reports | Part 2 |
get_expense_report | Part 2 |
convert_currency | Part 4 |
create_expense_report | Part 4 |
submit_expense_report | Part 4 |
approve_expense_report | Part 7 |
notify_employee | Part 8 |
Resources:
| Resource | Added in |
|---|---|
expenses://policy | Part 3 |
expenses://reports/{reportId} | Part 3 |
Prompts:
| Prompt | Added in |
|---|---|
review_expense_report | Part 3 |
The same server, unchanged, is called by all four of these:
| Client | From |
|---|---|
| VS Code Copilot | Part 2 |
BitOfTech.Expenses.Agent, written in the series | Part 6 |
| Claude | Part 8 |
| Microsoft Foundry Agent Service | Part 9 |
docker-compose.yml is included if you would rather
run SQL Server locally.Start at part-02 or part-03. Those two tags are self contained. Clone, build, open the
folder in VS Code, and the bitoftech-expenses server appears in the MCP server list. Start it,
switch Copilot Chat to Agent mode, and ask something like:
Which expense reports has Sara submitted?
git clone https://github.com/tjoudeh/building-mcp-servers-dotnet.git
cd building-mcp-servers-dotnet
git checkout part-02
dotnet build
From Part 4 onwards the code expects resources that belong to whoever is running it. main and
the later tags carry my endpoints, my tenant id and my client ids in .vscode/mcp.json and in
each appsettings.json. You cannot reach any of them.
So treat Part 4 and later as code to read alongside the post, and create your own resources by following the Azure CLI commands in it. Then put your own values in the configuration files.
src/BitOfTech.Expenses.Mcp/ the MCP server
Models/ expense report, line and employee
Data/ EF Core context, queries and seed data
Migrations/ EF Core migrations, from Part 4
Contracts/ the shapes returned to the model
Tools/ tools the model can call
Resources/
... [View full README on GitHub](https://github.com/tjoudeh/building-mcp-servers-dotnet#readme)