Skip to content

Conversation

Ellerbach
Copy link
Member

@Ellerbach Ellerbach commented Jun 26, 2025

Description

Add Model Context Protocol for AI Agent support

Motivation and Context

  • Add Model Context Protocol for AI Agent support
  • Allow smooth integration with AI Agents and bring nanoFramework to the next level

How Has This Been Tested?

  • With a specific AI Agent app present in the solution.
  • With a series of http requests and an end to end test application

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.

Summary by CodeRabbit

  • Chores
    • Added a development container configuration for a ready-to-use .NET 10 Preview environment with Docker support and essential editor extensions.
    • Updated the pipeline to build and publish a third library package.
    • Introduced lock files for multiple projects and test suites to ensure consistent dependency versions and reproducible builds.

Copy link

coderabbitai bot commented Jun 26, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (3)
  • .devcontainer/README.md is excluded by !**/*.md and included by none
  • .gitignore is excluded by none and included by none
  • tests/McpEndToEndTest/WiFi.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.

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

Walkthrough

A development container configuration for .NET 10 Preview is introduced, along with package lock files for the main and test projects to ensure consistent dependency management. The Azure pipeline is updated to build and publish a third library, with corresponding comments and steps adjusted for clarity and completeness.

Changes

File(s) Change Summary
.devcontainer/devcontainer.json Added configuration for a .NET 10 Preview development container with Docker and VS Code extension setup.
azure-pipelines.yml Updated to build and publish three libraries; added build step and revised comments.
nanoFramework.WebServer.Mcp/packages.lock.json Added lock file specifying exact dependency versions for the main project.
tests/McpEndToEndTest/packages.lock.json, tests/McpServerTests/packages.lock.json Added lock files specifying exact dependency versions for test projects.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant DevContainer
    participant VSCode
    participant Docker

    Developer->>VSCode: Open project in container
    VSCode->>DevContainer: Initialize using .devcontainer/devcontainer.json
    DevContainer->>Docker: Start container with .NET 10 Preview image
    DevContainer->>VSCode: Install extensions (C#, EditorConfig, Copilot Chat)
    DevContainer->>DevContainer: Run post-create command (dotnet --version)
    VSCode->>Developer: Ready-to-use .NET 10 Preview environment
Loading
sequenceDiagram
    participant Pipeline
    participant BuildStep1
    participant BuildStep2
    participant BuildStep3
    participant PublishStep

    Pipeline->>BuildStep1: Build Library 1
    Pipeline->>BuildStep2: Build Library 2
    Pipeline->>BuildStep3: Build Library 3 (nanoFramework.WebServer.Mcp)
    Pipeline->>PublishStep: Publish all three libraries
Loading

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (1)
azure-pipelines.yml (1)

90-93: Release notes omit the new MCP package

releaseNotesInline only advertises nanoFramework.WebServer and nanoFramework.WebServer.FileSystem. Add the MCP line or generate notes dynamically to avoid confusing consumers.

-:package: [nanoFramework.WebServer](...)
-:package: [nanoFramework.WebServer.FileSystem ...](...)
+:package: [nanoFramework.WebServer](...)
+:package: [nanoFramework.WebServer.FileSystem ...](...)
+:package: [nanoFramework.WebServer.Mcp](https://www.nuget.org/packages/nanoFramework.WebServer.Mcp/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)
🧹 Nitpick comments (5)
nanoFramework.WebServer.Mcp/packages.lock.json (1)

4-70: Lock-file committed – consider enforcing restore consistency

Great to see deterministic versions being locked. To guarantee CI fails whenever the lock file drifts, enable NuGet’s restoreLockedMode ( or RestoreLockedMode MSBuild property).
This prevents accidental dependency upgrades slipping through local restores.

.devcontainer/devcontainer.json (2)

3-6: Pin the Docker base image digest to avoid silent preview updates

mcr.microsoft.com/devcontainers/dotnet:dev-10.0-preview-noble is a moving tag; the underlying image may change and break reproducibility.
Recommend switching to a digest-pinned reference:

-"image": "mcr.microsoft.com/devcontainers/dotnet:dev-10.0-preview-noble",
+"image": "mcr.microsoft.com/devcontainers/dotnet@sha256:<exact-digest>",

9-13: Optional: freeze VS Code extension versions

For long-lived dev-containers it’s safer to pin specific extension versions (e.g. "ms-dotnettools.csharp@2.0.327") to avoid sudden breaking upgrades.
Purely optional, but helps CI / Codespaces reproducibility.

azure-pipelines.yml (2)

67-70: Trailing whitespace flagged by YAML-lint

Line 67 contains stray spaces – fails yamllint in strict setups.
Quick fix:

-  - template: azure-pipelines-templates/class-lib-package.yml@templates··
+  - template: azure-pipelines-templates/class-lib-package.yml@templates

46-49: Variable nugetPackageName is now misleading

Since three distinct packages are produced, keeping a single global nugetPackageName pointing at the base package can be error-prone (e.g., GitHub release title).
Consider removing the variable and inlining, or converting to a list.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b8d2869 and c9a9095.

⛔ Files ignored due to path filters (29)
  • .gitignore is excluded by none and included by none
  • README.md is excluded by !**/*.md and included by none
  • nanoFramework.WebServer.Mcp.nuspec is excluded by none and included by none
  • nanoFramework.WebServer.Mcp/DescriptionAttribute.cs is excluded by none and included by none
  • nanoFramework.WebServer.Mcp/HashtableExtension.cs is excluded by none and included by none
  • nanoFramework.WebServer.Mcp/McpServerBasicAuthenticationController.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/McpServerKeyAuthenticationController.cs is excluded by none and included by none
  • nanoFramework.WebServer.Mcp/McpServerToolAttribute.cs is excluded by none and included by none
  • nanoFramework.WebServer.Mcp/McpToolRegistry.cs is excluded by none and included by none
  • nanoFramework.WebServer.Mcp/McpToolsJsonHelper.cs is excluded by none and included by none
  • nanoFramework.WebServer.Mcp/Properties/AssemblyInfo.cs is excluded by none and included by none
  • nanoFramework.WebServer.Mcp/ToolMetadata.cs is excluded by none and included by none
  • nanoFramework.WebServer.Mcp/nanoFramework.WebServer.Mcp.nfproj is excluded by none and included by none
  • nanoFramework.WebServer.Mcp/packages.config is excluded by none and included by none
  • nanoFramework.WebServer.sln is excluded by none and included by none
  • tests/McpClientTest/McpClientTest.cs is excluded by none and included by none
  • tests/McpEndToEndTest/McpEndToEndTest.nfproj is excluded by none and included by none
  • tests/McpEndToEndTest/McpToolsClasses.cs is excluded by none and included by none
  • tests/McpEndToEndTest/Program.cs is excluded by none and included by none
  • tests/McpEndToEndTest/Properties/AssemblyInfo.cs is excluded by none and included by none
  • tests/McpEndToEndTest/packages.config is excluded by none and included by none
  • tests/McpEndToEndTest/requests.http is excluded by none and included by none
  • tests/McpServerTests/McpServerTests.nfproj is excluded by none and included by none
  • tests/McpServerTests/McpToolRegistryTests.cs is excluded by none and included by none
  • tests/McpServerTests/McpToolsAttributeTests.cs is excluded by none and included by none
  • tests/McpServerTests/Properties/AssemblyInfo.cs is excluded by none and included by none
  • tests/McpServerTests/nano.runsettings is excluded by none and included by none
  • tests/McpServerTests/packages.config is excluded by none and included by none
📒 Files selected for processing (5)
  • .devcontainer/devcontainer.json (1 hunks)
  • azure-pipelines.yml (2 hunks)
  • nanoFramework.WebServer.Mcp/packages.lock.json (1 hunks)
  • tests/McpEndToEndTest/packages.lock.json (1 hunks)
  • tests/McpServerTests/packages.lock.json (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
azure-pipelines.yml

[error] 67-67: trailing spaces

(trailing-spaces)

🔇 Additional comments (2)
tests/McpServerTests/packages.lock.json (1)

53-58: 👍 Including nanoFramework.TestFramework is spot-on

Locking the test framework version alongside runtime libs will prevent mismatched runner issues. No further action required.

tests/McpEndToEndTest/packages.lock.json (1)

29-34: Wi-Fi package pulled into end-to-end tests

Just double-check that test devices truly require nanoFramework.System.Device.Wifi; if not, you can trim cold-start time by removing the extra native dependency. Otherwise, looks fine.

Copy link

Copy link
Member

@josesimoes josesimoes left a comment

Choose a reason for hiding this comment

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

LVGTM! 😉
This is a very nice addition. Well done.
Can't wait what the community will do with this.

Something for a future PR (same applies to a couple of other repos) the README is growing beyond a reasonable size. Despite the content being valuable, it makes it hard to find/read, completely "hides" the last sections, and doesn't provide a nice "pitch" which is the intended usage of the README here.
I suggest we split the various topics in a docs folder. Tidy and organized. Then replace the contents in the README with the links to those.
A good example on how something with similar complexity is well structured: https://github.com/microsoft/vstest

@Ellerbach
Copy link
Member Author

Yes, good feedback, let's then do it in another PR to rearrange the docs. Indeed, we can break it down.

@Ellerbach Ellerbach merged commit 7233f8d into main Jun 27, 2025
8 checks passed
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.

3 participants