|
| 1 | +# MauiReactor MCP Server |
| 2 | + |
| 3 | +This package exposes a Model Context Protocol (MCP) server for working with MauiReactor and .NET MAUI projects. It provides tools for component scaffolding, workspace inspection, and basic build/test actions via stdio. |
| 4 | + |
| 5 | +## Install (NuGet, `dnx`) |
| 6 | + |
| 7 | +Once the package is published to NuGet, configure your IDE to install and run the server via `dnx`: |
| 8 | + |
| 9 | +VS Code: create `.vscode/mcp.json` in your workspace |
| 10 | + |
| 11 | +```json |
| 12 | +{ |
| 13 | + "servers": { |
| 14 | + "MauiReactor.MCP": { |
| 15 | + "type": "stdio", |
| 16 | + "command": "dnx", |
| 17 | + "args": [ |
| 18 | + "MauiReactor.MCP", |
| 19 | + "--version", |
| 20 | + "0.1.0-preview", |
| 21 | + "--yes" |
| 22 | + ] |
| 23 | + } |
| 24 | + } |
| 25 | +} |
| 26 | +``` |
| 27 | + |
| 28 | +Visual Studio: create `.mcp.json` in the solution directory with the same content as above. |
| 29 | + |
| 30 | +Notes: |
| 31 | +- Replace the version with the latest published package version. |
| 32 | +- `dnx` downloads and caches the self-contained binary per RID. |
| 33 | + |
| 34 | +## Run from source (development) |
| 35 | + |
| 36 | +To test locally without packaging: |
| 37 | + |
| 38 | +```json |
| 39 | +{ |
| 40 | + "servers": { |
| 41 | + "MauiReactor.MCP": { |
| 42 | + "type": "stdio", |
| 43 | + "command": "dotnet", |
| 44 | + "args": [ |
| 45 | + "run", |
| 46 | + "--project", |
| 47 | + "<absolute path to src/MauiReactor.MCP>" |
| 48 | + ] |
| 49 | + } |
| 50 | + } |
| 51 | +} |
| 52 | +``` |
| 53 | + |
| 54 | +## Server capabilities |
| 55 | + |
| 56 | +- Tools: scaffolding MAUI components, reading/writing workspace files, basic build/test tasks. |
| 57 | +- Resources: embedded templates under `Tools/Resources/Components`. |
| 58 | +- Prompts: MCP-compliant prompt definitions for guided workflows. |
| 59 | + |
| 60 | +## Client configuration (`.mcp/server.json`) |
| 61 | + |
| 62 | +This package includes `.mcp/server.json` for IDE browsing. You can declare required inputs (e.g., workspace paths or feature flags) following MCP guidance. See [aka.ms/nuget/mcp/guide/configuring-inputs](https://aka.ms/nuget/mcp/guide/configuring-inputs). |
| 63 | + |
| 64 | +## Pack and publish |
| 65 | + |
| 66 | +```bash |
| 67 | +dotnet pack -c Release |
| 68 | +dotnet nuget push bin/Release/*.nupkg --source https://api.nuget.org/v3/index.json |
| 69 | +``` |
| 70 | + |
| 71 | +Ensure `PackageId`, `RepositoryUrl`, and metadata are set in `MauiReactor.MCP.csproj`. |
| 72 | + |
| 73 | +## Troubleshooting |
| 74 | + |
| 75 | +- `dnx` not found: update to the latest Copilot/IDE preview that supports MCP. |
| 76 | +- Startup errors: run with `dotnet run` to view detailed logs. |
| 77 | +- RID mismatch: confirm your platform is listed in `<RuntimeIdentifiers>`. |
| 78 | + |
| 79 | +## References |
| 80 | + |
| 81 | +- Model Context Protocol: https://modelcontextprotocol.io/ |
| 82 | +- Specification: https://spec.modelcontextprotocol.io/ |
| 83 | +- .NET MCP SDK (NuGet): https://www.nuget.org/packages/ModelContextProtocol |
| 84 | +- VS Code MCP servers: https://code.visualstudio.com/docs/copilot/chat/mcp-servers |
| 85 | +- Visual Studio MCP servers: https://learn.microsoft.com/visualstudio/ide/mcp-servers |
0 commit comments