Conversation
|
Thanks for opening this, but we'd appreciate a little more information. Could you update it with more details? |
📝 WalkthroughWalkthroughThis refactoring consolidates MCP server configuration from scattered sources (appsettings.json, IConfiguration injection) into centralized static config classes (McpConfig, SystemBehaviorConfig), eliminating configuration dependency injection from McpServerHost. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Web/Resgrid.Web.Mcp/Program.cs (1)
47-101:⚠️ Potential issue | 🟡 Minor
McpConfig.Transportis defined but never consumed.
McpConfig.Transport(set to"stdio") is declared in the configuration class but is never referenced in the codebase. The transport mechanism is hardcoded as "stdio" inMcpServerHost.cs(line 101) andMcpServer.cs(line 43). Either use this configuration value in the server initialization, remove it if truly not needed, or add a TODO comment if intended for future implementation.
🧹 Nitpick comments (2)
Core/Resgrid.Config/McpConfig.cs (1)
7-23: Consider making fieldsstatic readonlyor properties with private setters if mutation is only needed at startup.The fields are currently publicly mutable (
public static string), which means any code can change them at runtime. This is consistent with the existingSystemBehaviorConfigpattern in the codebase, but per the coding guidelines favoring immutable data, consider whether these need to be writable after initial configuration loading.If
ConfigProcessorneeds to set them, a pattern likepublic static string ServerName { get; internal set; } = "Resgrid CAD System";would limit mutation to theResgrid.Configassembly.Web/Resgrid.Web.Mcp/McpServerHost.cs (1)
42-44: Static config dependency reduces testability.Switching from
IConfigurationtoMcpConfigstatic fields creates a hidden dependency that's harder to mock in unit tests. If you want to testMcpServerHost.StartAsyncwith different server names/versions, you'd need to mutate global state.This is consistent with the existing
Resgrid.Configpattern, so not a blocker — just noting the trade-off. If testability becomes a concern later, consider injecting anMcpOptionsrecord or similar.
|
Approve |
Summary by CodeRabbit
Refactor
Chores