Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,30 @@ Examples:
- ❌ Bad: `configure_logging.md`
- ❌ Bad: `DependencyInjectionGuidelines.md`

## Documentation from External Sources (Blog Posts, Announcements)

When adapting content from external sources like blog posts into documentation:

**DO:**
- Work on one version, or topic at a time - never combine multiple versions in a single PR. Some blog posts or source material may include many versions or preview builds. The issue or task should specify which one to focus on.
- Copy working code samples directly from source when available. Follow the rules under ["Code Snippets"](#code-snippets) above.
- Create a checklist TODO for each section of the source document before writing.
- Map each documentation section 1:1 to source content.
- Explicitly state what is copied vs. generated in PR description.
- Add disclaimers about AI usage when applicable.

**DON'T:**
- Invent or elaborate on features not explicitly mentioned in source.
- Create placeholder sections without content.
- Assume feature details or characteristics.
- Combine information from multiple versions/sources.
- Add examples without verifying they demonstrate the stated feature.

**PR Description Must Include:**
- Content source breakdown. In the description, list each section of the source document and indicate whether it was copied verbatim, adapted, or newly generated.
- Note all generated sections requiring expert review.
- Clear warnings about any uncertainties.

## Special Cases

### Breaking Changes
Expand Down
52 changes: 24 additions & 28 deletions docs/ai/get-started-mcp.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
---
title: Get started with .NET AI and MCP
description: Learn about .NET AI and MCP key concepts and development resources to get started building MCP clients and servers
ms.date: 04/29/2025
ms.date: 11/20/2025
ms.topic: overview
author: alexwolfmsft
ms.author: alexwolf
# CustomerIntent: As a .NET developer new to OpenAI, I want deploy and use sample code to interact to learn from the sample code to summarize text.
---

# Get started with .NET AI and the Model Context Protocol

The Model Context Protocol (MCP) is an open protocol designed to standardize integrations between AI apps and external tools and data sources. By using MCP, developers can enhance the capabilities of AI models, enabling them to produce more accurate, relevant, and context-aware responses.
Model Context Protocol (MCP) is an open protocol designed to standardize integrations between AI apps and external tools and data sources. By using MCP, developers can enhance the capabilities of AI models, enabling them to produce more accurate, relevant, and context-aware responses.

For example, using MCP, you can connect your LLM to resources such as:

Expand All @@ -22,36 +21,36 @@ Many Microsoft products already support MCP, including:

- [Copilot Studio](https://www.microsoft.com/microsoft-copilot/blog/copilot-studio/introducing-model-context-protocol-mcp-in-copilot-studio-simplified-integration-with-ai-apps-and-agents/)
- [Visual Studio Code GitHub Copilot agent mode](https://code.visualstudio.com/blogs/2025/02/24/introducing-copilot-agent-mode)
- [Semantic Kernel](https://devblogs.microsoft.com/semantic-kernel/integrating-model-context-protocol-tools-with-semantic-kernel-a-step-by-step-guide/).
- [Agent Framework](/agent-framework/user-guide/model-context-protocol/using-mcp-tools)

You can use the [MCP C# SDK](#develop-with-the-mcp-c-sdk) to quickly create your own MCP integrations and switch between different AI models without significant code changes.

### MCP client-server architecture
## MCP client-server architecture

MCP uses a client-server architecture that enables an AI-powered app (the host) to connect to multiple MCP servers through MCP clients:

- **MCP Hosts**: AI tools, code editors, or other software that enhance their AI models using contextual resources through MCP. For example, GitHub Copilot in Visual Studio Code can act as an MCP host and use MCP clients and servers to expand its capabilities.
- **MCP Clients**: Clients used by the host application to connect to MCP servers to retrieve contextual data.
- **MCP Servers**: Services that expose capabilities to clients through MCP. For example, an MCP server might provide an abstraction over a REST API or local data source to provide business data to the AI model.
- **MCP hosts**: AI tools, code editors, or other software that enhance their AI models using contextual resources through MCP. For example, GitHub Copilot in Visual Studio Code can act as an MCP host and use MCP clients and servers to expand its capabilities.
- **MCP clients**: Clients used by the host application to connect to MCP servers to retrieve contextual data.
- **MCP servers**: Services that expose capabilities to clients through MCP. For example, an MCP server might provide an abstraction over a REST API or local data source to provide business data to the AI model.

The following diagram illustrates this architecture:

:::image type="content" source="media/mcp/model-context-protocol-architecture-diagram.png" alt-text="A diagram showing the architecture pattern of MCP, including hosts, clients, and servers.":::

MCP client and server can exchange a set of standard messages:

| Message | Description |
|---------------------|-------------|
| Message | Description |
|---------------------|---------------------------------------------------------------|
| `InitializeRequest` | This request is sent by the client to the server when it first connects, asking it to begin initialization. |
|`ListToolsRequest` | Sent by the client to request a list of tools the server has. |
|`CallToolRequest` | Used by the client to invoke a tool provided by the server. |
|`ListResourcesRequest` | Sent by the client to request a list of available server resources. |
|`ReadResourceRequest` | Sent by the client to the server to read a specific resource URI. |
|`ListPromptsRequest` | Sent by the client to request a list of available prompts and prompt templates from the server. |
|`GetPromptRequest` | Used by the client to get a prompt provided by the server. |
|`PingRequest` | A ping, issued by either the server or the client, to check that the other party is still alive. |
|`CreateMessageRequest` | A request by the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it. |
|`SetLevelRequest` | A request by the client to the server, to enable or adjust logging. |
| `ListToolsRequest` | Sent by the client to request a list of tools the server has. |
| `CallToolRequest` | Used by the client to invoke a tool provided by the server. |
| `ListResourcesRequest` | Sent by the client to request a list of available server resources. |
| `ReadResourceRequest` | Sent by the client to the server to read a specific resource URI. |
| `ListPromptsRequest` | Sent by the client to request a list of available prompts and prompt templates from the server. |
| `GetPromptRequest` | Used by the client to get a prompt provided by the server. |
| `PingRequest` | A ping, issued by either the server or the client, to check that the other party is still alive. |
| `CreateMessageRequest` | A request by the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it. |
| `SetLevelRequest` | A request by the client to the server, to enable or adjust logging. |

## Develop with the MCP C# SDK

Expand All @@ -74,25 +73,22 @@ Instead of building unique connectors for each integration point, you can often

The MCP C# SDK depends on the [Microsoft.Extensions.AI libraries](/dotnet/ai/ai-extensions) to handle various AI interactions and tasks. These extension libraries provides core types and abstractions for working with AI services, so developers can focus on coding against conceptual AI capabilities rather than specific platforms or provider implementations.

View the MCP C# SDK dependencies on the [NuGet package page](https://www.nuget.org/packages/ModelContextProtocol/0.1.0-preview.11).
View the MCP C# SDK dependencies on the [NuGet package page](https://www.nuget.org/packages/ModelContextProtocol).

## More .NET MCP development resources

Various tools, services, and learning resources are available in the .NET and Azure ecosystems to help you build MCP clients and servers or integrate with existing MCP servers.

Get started with the following development tools:

- [Semantic Kernel](/semantic-kernel/concepts/plugins/adding-mcp-plugins) allows you to add plugins for MCP servers. Semantic Kernel supports both local MCP servers through standard I/O and remote servers that connect through SSE over HTTPS.
- [Agent Framework](/agent-framework/user-guide/model-context-protocol/using-mcp-tools) supports integration with MCP servers, allowing your agents to access external tools and services. Agent Framework works with the official MCP C# SDK to enable agents to connect to MCP servers, retrieve available tools, and use them through function calling to extend agent capabilities with external data sources and services.
- [Azure Functions remote MCP servers](https://devblogs.microsoft.com/dotnet/build-mcp-remote-servers-with-azure-functions/) combine MCP standards with the flexible architecture of Azure Functions. Visit the [Remote MCP functions sample repository](https://aka.ms/cadotnet/mcp/functions/remote-sample) for code examples.
- [Azure MCP Server](https://github.com/Azure/azure-mcp) implements the MCP specification to seamlessly connect AI agents with key Azure services like Azure Storage, Cosmos DB, and more.

Learn more about .NET and MCP using these resources:
## See also

- [MCP C# SDK documentation](https://modelcontextprotocol.github.io/csharp-sdk/index.html)
- [MCP C# SDK API documentation](https://modelcontextprotocol.github.io/csharp-sdk/api/ModelContextProtocol.html)
- [MCP C# SDK README](https://github.com/modelcontextprotocol/csharp-sdk/blob/main/README.md)
- [Microsoft partners with Anthropic to create official C# SDK for Model Context Protocol](https://devblogs.microsoft.com/blog/microsoft-partners-with-anthropic-to-create-official-c-sdk-for-model-context-protocol)
- [Build a Model Context Protocol (MCP) server in C#](https://devblogs.microsoft.com/dotnet/build-a-model-context-protocol-mcp-server-in-csharp/)
- [MCP C# SDK README](https://github.com/modelcontextprotocol/csharp-sdk/blob/main/README.md)

## Related content

- [Overview of the .NET + AI ecosystem](dotnet-ai-ecosystem.md)
- [Microsoft.Extensions.AI](/dotnet/ai/ai-extensions)
Loading
Loading