<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/building-your-own-mcp-server-lfpuf583i" -->

---
title: Building your own MCP server | daily.dev
description: A walkthrough demonstrates building a Model Context Protocol (MCP) server using the official .NET MCP SDK, covering the three core building blocks - tools...
canonical: https://daily.dev/posts/building-your-own-mcp-server-lfpuf583i
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Building your own MCP server | daily.dev
og:description: A walkthrough demonstrates building a Model Context Protocol (MCP) server using the official .NET MCP SDK, covering the three core building blocks - tools...
og:url: https://daily.dev/posts/building-your-own-mcp-server-lfpuf583i
og:image: https://api.daily.dev/og/posts/LFPuf583I.png
og:image:alt: Building your own MCP server
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Building your own MCP server

**[Microsoft Developer](https://daily.dev/sources/microsoftdeveloper)** · 19 min read · 0 upvotes · 0 comments

## Summary

A walkthrough demonstrates building a Model Context Protocol (MCP) server using the official .NET MCP SDK, covering the three core building blocks - tools (actions), prompts (reusable templates for humans), and resources (read-only context data). Using a fictional Dunder Mifflin example, the demo shows configuring an MCP.json file, running a local server via standard IO transport versus a remote server via HTTP, and connecting the server to GitHub Copilot for tool calls and resource-augmented Q&A. It also shows deploying the same MCP server remotely on Microsoft Foundry and connecting it to an agent so users don't need to run it locally.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=a2DSorZ-LeE>

## Questions this post answers

### What are the three main components of an MCP server and what does each one do?

An MCP server is built from tools, prompts, and resources. Tools let an AI model perform actions or carry out tasks, using a description that the model compares against a user prompt to decide whether to invoke it. Prompts are reusable templates aimed at human users showing how to interact with the server. Resources provide read-only context data, such as a company handbook, that the model can reference to avoid hallucinating.

_Developers wiring up their first MCP server can find deeper walkthroughs like this one on daily.dev._

### How do I set up a local MCP server in .NET using the official SDK?

Install the official ModelContextProtocol NuGet package, then in Program.cs call the AddMcpServer extension method along with WithStdioServerTransport for a local server, plus WithTools, WithPrompts, and WithResourcesFromAssembly to expose components via reflection over attributes like McpServerToolType and McpServerTool. Configure it in an mcp.json file in the .vscode folder specifying a name, type stdio, and the dotnet run command with arguments.

_Anyone scaffolding a first .NET MCP server can track SDK-specific tips like these on daily.dev._

### What is the difference between configuring a local versus a remote MCP server in mcp.json?

A local MCP server uses type stdio and specifies a command plus arguments, such as dotnet run with a project path, since the server runs on the same machine. A remote MCP server uses type http and instead specifies an endpoint URL, since execution happens elsewhere (for example, hosted in Azure via Microsoft Foundry) and the client has no control over how it runs.

_Teams choosing between local and remote MCP hosting can compare tradeoffs like these on daily.dev._

## Similar posts on daily.dev

- [Build Your First MCP Server in C\# with the Official SDK](https://daily.dev/posts/build-your-first-mcp-server-in-c-with-the-official-sdk-gfvr6bvsh) · Code with Mukesh · 17 upvotes · 2 comments
- [Building an MCP Server in .NET Without Buying the Hype — Daily DevOps & .NET](https://daily.dev/posts/building-an-mcp-server-in-net-without-buying-the-hype-daily-devops-net-f3pfe3wik) · Daily DevOps & .NET · 1 upvotes · 0 comments
- [Build Your First MCP Server in C\#: A Step-by-Step Quickstart](https://daily.dev/posts/build-your-first-mcp-server-in-c-a-step-by-step-quickstart-pt500c6tu) · We Are .NET · 4 upvotes · 0 comments
- [Your first MCP server with ASP.NET](https://daily.dev/posts/your-first-mcp-server-with-asp-net-0kwwmyuuj) · Tim Deschryver · 20 upvotes · 3 comments
- [Building our first MCP Resources enabled MCP Server with C\#](https://daily.dev/posts/building-our-first-mcp-resources-enabled-mcp-server-with-c--6i1z3fqjr) · The Art of Simplicity · 1 upvotes · 0 comments

---

Tags: [#github](https://daily.dev/tags/github), [#azure](https://daily.dev/tags/azure), [#.net](https://daily.dev/tags/.net), [#mcp](https://daily.dev/tags/mcp)

[View this post on daily.dev](https://daily.dev/posts/building-your-own-mcp-server-lfpuf583i)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Building your own MCP server","url":"https://daily.dev/posts/building-your-own-mcp-server-lfpuf583i","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/building-your-own-mcp-server-lfpuf583i"},"datePublished":"2026-08-24T21:28:53.514Z","dateModified":"2026-09-13T19:21:13.133Z","description":"A walkthrough demonstrates building a Model Context Protocol (MCP) server using the official .NET MCP SDK, covering the three core building blocks - tools...","image":"https://i.ytimg.com/vi/a2DSorZ-LeE/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/a2DSorZ-LeE/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Microsoft Developer","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Microsoft Developer","logo":"https://media.daily.dev/image/upload/s--xZzU3zUq--/f_auto/v1746714872/logos/microsoftdeveloper","url":"https://daily.dev/sources/microsoftdeveloper"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/building-your-own-mcp-server-lfpuf583i","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"github,azure,.net,mcp","timeRequired":"PT19M","video":{"@type":"VideoObject","name":"Building your own MCP server","description":"A walkthrough demonstrates building a Model Context Protocol (MCP) server using the official .NET MCP SDK, covering the three core building blocks - tools...","thumbnailUrl":"https://i.ytimg.com/vi/a2DSorZ-LeE/sddefault.jpg","uploadDate":"2026-08-24T21:28:53.514Z","duration":"PT19M","url":"https://api.daily.dev/r/LFPuf583I","embedUrl":"https://www.youtube.com/embed/a2DSorZ-LeE"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Microsoft Developer","item":"https://daily.dev/sources/microsoftdeveloper"},{"@type":"ListItem","position":3,"name":"Building your own MCP server"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/building-your-own-mcp-server-lfpuf583i#faq","mainEntity":[{"@type":"Question","name":"What are the three main components of an MCP server and what does each one do?","acceptedAnswer":{"@type":"Answer","text":"An MCP server is built from tools, prompts, and resources. Tools let an AI model perform actions or carry out tasks, using a description that the model compares against a user prompt to decide whether to invoke it. Prompts are reusable templates aimed at human users showing how to interact with the server. Resources provide read-only context data, such as a company handbook, that the model can reference to avoid hallucinating. Developers wiring up their first MCP server can find deeper walkthroughs like this one on daily.dev."}},{"@type":"Question","name":"How do I set up a local MCP server in .NET using the official SDK?","acceptedAnswer":{"@type":"Answer","text":"Install the official ModelContextProtocol NuGet package, then in Program.cs call the AddMcpServer extension method along with WithStdioServerTransport for a local server, plus WithTools, WithPrompts, and WithResourcesFromAssembly to expose components via reflection over attributes like McpServerToolType and McpServerTool. Configure it in an mcp.json file in the .vscode folder specifying a name, type stdio, and the dotnet run command with arguments. Anyone scaffolding a first .NET MCP server can track SDK-specific tips like these on daily.dev."}},{"@type":"Question","name":"What is the difference between configuring a local versus a remote MCP server in mcp.json?","acceptedAnswer":{"@type":"Answer","text":"A local MCP server uses type stdio and specifies a command plus arguments, such as dotnet run with a project path, since the server runs on the same machine. A remote MCP server uses type http and instead specifies an endpoint URL, since execution happens elsewhere (for example, hosted in Azure via Microsoft Foundry) and the client has no control over how it runs. Teams choosing between local and remote MCP hosting can compare tradeoffs like these on daily.dev."}}]}
```

