Skip to content

Optimizing MCP Server Compatibility for VS 2026 and VS Code#348

Merged
Ellerbach merged 2 commits intonanoframework:mainfrom
Vagabond-K:fix/update-mcp
Mar 29, 2026
Merged

Optimizing MCP Server Compatibility for VS 2026 and VS Code#348
Ellerbach merged 2 commits intonanoframework:mainfrom
Vagabond-K:fix/update-mcp

Conversation

@Vagabond-K
Copy link
Copy Markdown
Contributor

Description

  1. Added support for multiple protocol versions
    GitHub Copilot Chat in Visual Studio 2026 requires version 2025-06-18, while Visual Studio Code requires version 2025-11-25. Accordingly, the MCP server has been updated to support the latest version (2025-11-25) as well as legacy versions (2025-06-18 and 2025-03-26).

  2. Omit outputschema for simple outputs
    The outputschema should be omitted from the MCP Tool metadata when the output is not complex. In the latest MCP C# SDK, if an outputschema exists and the type is not an 'object', an exception is thrown. A similar issue was also observed in GitHub Copilot Chat for Visual Studio 2026.

  3. Omit "nextCursor": null
    In Visual Studio Code, failing to omit nextCursor when it is not needed causes an infinite loop of requests for tools/list and prompts/list methods. Since nextCursor is always fixed to null in the last implementation, it has been removed from the source code.

Motivation and Context

These updates were implemented after discovering that the .NET nanoFramework MCP server was not functioning correctly with GitHub Copilot Chat in Visual Studio 2026.

How Has This Been Tested?

Verified successful operation in GitHub Copilot Chat for both Visual Studio 2026 and Visual Studio Code. Compatibility has also been confirmed with clients based on the latest MCP C# SDK.

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Unit Tests (add new Unit Test(s) or improved existing one(s), has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist:

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).
  • I have added new tests to cover my changes.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 26, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (5)
  • nanoFramework.WebServer.Mcp/McpPromptRegistry.cs is excluded by none and included by none
  • nanoFramework.WebServer.Mcp/McpServerController.cs is excluded by none and included by none
  • nanoFramework.WebServer.Mcp/McpToolRegistry.cs is excluded by none and included by none
  • tests/McpServerTests/McpPromptRegistryTests.cs is excluded by none and included by none
  • tests/McpServerTests/McpToolRegistryTests.cs is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 09b1cf0a-d0c1-40ec-bda0-67a7bd9f594b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the nanoFramework MCP server to improve interoperability across MCP clients that require different protocol versions (VS 2026 vs VS Code), and to align metadata formatting with newer MCP SDK/client expectations.

Changes:

  • Added multi-version protocol support during initialize (accept latest + legacy protocol versions).
  • Updated tool metadata generation to omit outputSchema for primitive/string outputs.
  • Removed nextCursor: null from tools/prompts list metadata.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
nanoFramework.WebServer.Mcp/McpServerController.cs Negotiates/validates protocol versions during initialize and returns supported versions on error.
nanoFramework.WebServer.Mcp/McpToolRegistry.cs Omits outputSchema for primitive/string outputs and removes nextCursor from tool list metadata.
nanoFramework.WebServer.Mcp/McpPromptRegistry.cs Removes nextCursor from prompt list metadata.
tests/McpServerTests/McpToolRegistryTests.cs Updates assertions to match the new tools metadata shape without nextCursor.
tests/McpServerTests/McpPromptRegistryTests.cs Updates assertions to match the new prompts metadata shape without nextCursor.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread nanoFramework.WebServer.Mcp/McpServerController.cs
Comment thread nanoFramework.WebServer.Mcp/McpServerController.cs
Comment thread tests/McpServerTests/McpToolRegistryTests.cs
Comment thread tests/McpServerTests/McpPromptRegistryTests.cs
Comment thread nanoFramework.WebServer.Mcp/McpToolRegistry.cs
Comment thread nanoFramework.WebServer.Mcp/McpPromptRegistry.cs
Comment thread nanoFramework.WebServer.Mcp/McpToolRegistry.cs
Comment thread nanoFramework.WebServer.Mcp/McpToolRegistry.cs
Copy link
Copy Markdown
Member

@Ellerbach Ellerbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good overall, please make sure to properly lint the code

Comment thread nanoFramework.WebServer.Mcp/McpServerController.cs Outdated
Comment thread nanoFramework.WebServer.Mcp/McpServerController.cs
Comment thread nanoFramework.WebServer.Mcp/McpServerController.cs
Comment thread nanoFramework.WebServer.Mcp/McpServerController.cs
Comment thread nanoFramework.WebServer.Mcp/McpServerController.cs
@Ellerbach
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@Ellerbach Ellerbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks good!

@Ellerbach Ellerbach merged commit 576d13d into nanoframework:main Mar 29, 2026
6 checks passed
@Vagabond-K
Copy link
Copy Markdown
Contributor Author

Thanks! Looks good!

Thanks! I'm honored to contribute.

@Vagabond-K Vagabond-K deleted the fix/update-mcp branch March 30, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants