Skip to content

Add WithAppTool helper for MCP Apps - #1815

Open
KirschBluteX wants to merge 1 commit into
modelcontextprotocol:mainfrom
KirschBluteX:feat/with-app-tool-1607
Open

Add WithAppTool helper for MCP Apps#1815
KirschBluteX wants to merge 1 commit into
modelcontextprotocol:mainfrom
KirschBluteX:feat/with-app-tool-1607

Conversation

@KirschBluteX

@KirschBluteX KirschBluteX commented Aug 13, 2026

Copy link
Copy Markdown

Fixes #1607

Summary

  • add WithAppTool to register a tool and its linked HTML app resource in one call
  • preserve tool options and explicit _meta.ui, use text/html;profile=mcp-app, and enable the MCP Apps capability
  • document the helper and cover registration, metadata, arguments, resource content, duplicate URIs, and invalid configuration

Testing

  • dotnet test tests/ModelContextProtocol.Tests/ModelContextProtocol.Tests.csproj -f net10.0 --no-build --no-restore --filter (Execution!=Manual) (2362 passed)
  • dotnet test tests/ModelContextProtocol.Tests/ModelContextProtocol.Tests.csproj -f net10.0 --no-build --no-restore --filter FullyQualifiedName~McpApps (39 passed)
  • dotnet test tests/ModelContextProtocol.Tests/ModelContextProtocol.Tests.csproj -f net10.0 --no-build --no-restore --filter FullyQualifiedName~WithAppTool (6 passed after the final validation change)
  • dotnet build src/ModelContextProtocol.Extensions.Apps/ModelContextProtocol.Extensions.Apps.csproj --no-restore --configuration Release --no-incremental (4 projects, 0 warnings, 0 errors)
  • dotnet format whitespace ... --verify-no-changes --include ... for the three changed C# files

A full solution restore/build was also attempted with the offline package cache. Restore lacked runtime.win-x86.Microsoft.DotNet.ILCompiler 9.0.11 for TestServerWithHosting; the subsequent build failed only for the existing QuickstartWeatherServer and InMemoryTransport samples because runtime.win-x64.Microsoft.DotNet.ILCompiler 8.0.22 was unavailable. The Apps package and test projects built successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP Apps: Add ergonomic WithAppTool helper to reduce wiring boilerplate

1 participant