Skip to content
Draft
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
4 changes: 3 additions & 1 deletion docs/concepts/apps/apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ uid: apps

## Installation

MCP Apps is provided in the `ModelContextProtocol.Extensions.Apps` package, which layers on top of the core SDK:
MCP Apps is provided in the `ModelContextProtocol.Extensions.Apps` package, which depends only on `ModelContextProtocol.Core`:

```shell
dotnet add package ModelContextProtocol.Extensions.Apps
```

To host a server, also reference `ModelContextProtocol` (for `AddMcpServer()`) or `ModelContextProtocol.AspNetCore` (for HTTP transports).

## Overview

The MCP Apps extension introduces the concept of **UI resources** — HTML pages served by the MCP server that a client can display alongside the conversation. Tools can be associated with a UI resource so the client knows which interface to show when a tool is called.
Expand Down
2 changes: 2 additions & 0 deletions docs/concepts/skills/skills.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ methods for discovering skills and obtaining a verifiable manifest of their file
Skills are provided by the `ModelContextProtocol.Extensions.Skills` package. The implementation follows the
[Skills extension specification](https://github.com/modelcontextprotocol/ext-skills/blob/main/specification/beta/skills.mdx)
(SEP-2640, extension id `io.modelcontextprotocol/skills`).
The package depends only on `ModelContextProtocol.Core`, so clients don't need the hosting dependencies. Servers also
reference `ModelContextProtocol` (for `AddMcpServer()`) or `ModelContextProtocol.AspNetCore`.

> [!IMPORTANT]
> Skills support is experimental. All public APIs use `[Experimental("MCPEXP005")]`; suppress that diagnostic
Expand Down
3 changes: 3 additions & 0 deletions docs/concepts/tasks/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ and the client polls for status, optionally exchanging additional input along th
Tasks are provided by the `ModelContextProtocol.Extensions.Tasks` package and require MCP protocol
version `2026-07-28` or later. The implementation follows
[SEP-2663 (Tasks Extension)](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/seps/2663-tasks-extension.md).
The package depends only on `ModelContextProtocol.Core`, so clients don't need the hosting
dependencies. Servers also reference `ModelContextProtocol` (for `AddMcpServer()`) or
`ModelContextProtocol.AspNetCore`.

### Overview

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ namespace Microsoft.Extensions.DependencyInjection;
/// and server transports, allowing for comprehensive server configuration through a chain of method calls.
/// </para>
/// <para>
/// The builder is obtained from the <see cref="McpServerServiceCollectionExtensions.AddMcpServer"/> extension
/// method and provides access to the underlying service collection via the <see cref="Services"/> property.
/// The builder is obtained from the <c>AddMcpServer</c> extension method in the <c>ModelContextProtocol</c> package
/// and provides access to the underlying service collection via the <see cref="Services"/> property.
/// </para>
/// <para>
/// This interface is defined in <c>ModelContextProtocol.Core</c> so that extension packages can add builder
/// extension methods without depending on the hosting implementation in the <c>ModelContextProtocol</c> package.
/// </para>
/// </remarks>
public interface IMcpServerBuilder
Expand Down
2 changes: 1 addition & 1 deletion src/ModelContextProtocol.Core/Server/RequestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace ModelContextProtocol.Server;
/// <typeparam name="TParams">Type of the request parameters specific to each MCP operation.</typeparam>
/// <remarks>
/// The <see cref="RequestContext{TParams}"/> encapsulates all contextual information for handling an MCP request.
/// This type is typically received as a parameter in handler delegates registered with IMcpServerBuilder,
/// This type is typically received as a parameter in handler delegates registered with <see cref="Microsoft.Extensions.DependencyInjection.IMcpServerBuilder"/>,
/// and can be injected as parameters into <see cref="McpServerTool"/>s.
/// </remarks>
public sealed class RequestContext<TParams> : MessageContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ModelContextProtocol\ModelContextProtocol.csproj" />
<ProjectReference Include="..\ModelContextProtocol.Core\ModelContextProtocol.Core.csproj" />
<PackageReference Include="Microsoft.Extensions.Options" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ModelContextProtocol\ModelContextProtocol.csproj" />
<ProjectReference Include="..\ModelContextProtocol.Core\ModelContextProtocol.Core.csproj" />
<PackageReference Include="Microsoft.Extensions.Options" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ public static IMcpServerBuilder WithSkillPackages(this IMcpServerBuilder builder
var materialized = packages.ToArray();
McpServerSkillPackage.ValidatePackages(materialized, nameof(packages));
builder.WithSkills(materialized.Select(package => package.Skill));
builder.WithResources(materialized.SelectMany(package => package.Resources));
foreach (var resource in materialized.SelectMany(package => package.Resources))
{
builder.Services.AddSingleton(resource);
}

return builder;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ModelContextProtocol\ModelContextProtocol.csproj" />
<ProjectReference Include="..\ModelContextProtocol.Core\ModelContextProtocol.Core.csproj" />
<PackageReference Include="Microsoft.Extensions.Options" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/ModelContextProtocol/TypeForwards.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using System.Runtime.CompilerServices;

// IMcpServerBuilder was defined in this assembly before moving to ModelContextProtocol.Core.
[assembly: TypeForwardedTo(typeof(Microsoft.Extensions.DependencyInjection.IMcpServerBuilder))]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Microsoft.Extensions.DependencyInjection;
using ModelContextProtocol.Server;

namespace ModelContextProtocol.Tests.Configuration;

public class McpServerBuilderTypeForwardingTests
{
[Fact]
public void IMcpServerBuilder_IsDefinedInCore_AndForwardedFromModelContextProtocol()
{
Assert.Same(typeof(McpServer).Assembly, typeof(IMcpServerBuilder).Assembly);

// Code compiled against older ModelContextProtocol versions references IMcpServerBuilder
// in the ModelContextProtocol assembly, so it must resolve through the type forwarder.
var forwarded = typeof(McpServerServiceCollectionExtensions).Assembly
.GetType("Microsoft.Extensions.DependencyInjection.IMcpServerBuilder", throwOnError: true);
Assert.Same(typeof(IMcpServerBuilder), forwarded);
}
}
Loading