Skip to content

Fix compilation errors in README code samples#1369

Merged
jeffhandley merged 1 commit intomodelcontextprotocol:mainfrom
jeffhandley:jeffhandley/readme
Feb 24, 2026
Merged

Fix compilation errors in README code samples#1369
jeffhandley merged 1 commit intomodelcontextprotocol:mainfrom
jeffhandley:jeffhandley/readme

Conversation

@jeffhandley
Copy link
Contributor

  • Core README client sample: Use .OfType() instead of .First(c => c.Type == "text").Text since ContentBlock base class lacks Text
  • Core README server sample: Use McpServerOptions.ToolCollection, McpServer.Create(), StdioServerTransport(name), and await using
  • Root README advanced server: Remove read-only Type property from TextContentBlock initializer
  • Both IChatClient snippets: Fix trailing comma and missing closing paren

- Core README client sample: Use .OfType<TextContentBlock>() instead of
  .First(c => c.Type == "text").Text since ContentBlock base class lacks Text
- Core README server sample: Use McpServerOptions.ToolCollection,
  McpServer.Create(), StdioServerTransport(name), and await using
- Root README advanced server: Remove read-only Type property from
  TextContentBlock initializer
- Both IChatClient snippets: Fix trailing comma and missing closing paren

Co-authored-by: Copilot <[email protected]>
@jeffhandley jeffhandley added this to the 1.0.0 (GA) milestone Feb 24, 2026
@jeffhandley jeffhandley added the documentation Improvements or additions to documentation label Feb 24, 2026
@jeffhandley jeffhandley merged commit 1446cd7 into modelcontextprotocol:main Feb 24, 2026
8 checks passed
@jeffhandley jeffhandley deleted the jeffhandley/readme branch February 24, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants