MCP Apps: Add ergonomic WithAppTool helper to reduce wiring boilerplate

Open
#1,607 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
csharp, typescript

Research direction

Start by reading the review discussion in PR #1484 and tracing the current WithTools(), WithResources(), WithMcpApps(), [McpServerTool], [McpAppUi], and [McpServerResource] usage. Compare the TypeScript registerAppTool(...) pattern, then clarify whether the desired outcome is a C# WithAppTool overload or an end-to-end documentation recipe. Done means the chosen approach removes or clearly documents the repeated tool and UI-resource wiring.

Written by the indexing model from the issue text.

Description

enhancement P3 ready for work

From PR #1484 review comment by @halter73:

Ergonomics suggestion (worth considering as a follow-up): the TypeScript @modelcontextprotocol/ext-apps package exposes a registerAppTool(...) helper that bundles tool registration + UI resource linkage in one call. Today a C# user has to do WithTools<T>() + WithResources<T>() + WithMcpApps() + [McpServerTool] + [McpAppUi] + a matching [McpServerResource] with the right MIME type. A combined WithAppTool(method, resourceUri, htmlFactory) overload — or at least a doc section showing the "complete recipe" end-to-end — would cut the wiring boilerplate significantly.

Consider adding a combined helper (e.g. WithAppTool) that bundles tool registration + UI resource linkage into a single call, similar to the TypeScript SDK's registerAppTool(...) pattern.

Dominant language
C#
Stars
4.5k
Forks
814
Avg merge
9d 19h
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelcontextprotocol/csharp-sdk

All issues in modelcontextprotocol/csharp-sdk

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.