csharpdeeb25a2 | 1 | using CascadeIDE.Contracts.Experimental; |
| 2 | using CascadeIDE.Features.Forge; |
| 3 | using CascadeIDE.Features.Forge.Mcp; |
| 4 | using CascadeIDE.ViewModels; |
| 5 | |
| 6 | namespace CascadeIDE.Features.IdeMcp.Execution; |
| 7 | |
| 8 | internal sealed partial class IdeMcpCommandExecutor |
| 9 | { |
| 10 | private void RegisterForge(Action<string, Handler> add) |
| 11 | { |
| 12 | var ctx = new ForgeMcpHostContext |
| 13 | { |
| 14 | Vm = _vm, |
| 15 | Actions = _actions, |
| 16 | TryGetWorkspaceRoot = () => TryGetWorkspaceRoot(_actions), |
| 17 | TryGetAttachSolutionPath = TryGetAttachSolutionPath, |
| 18 | }; |
| 19 | |
| 20 | ForgeFeatureModule.Instance.BindMcpHost(ctx); |
| 21 | ForgeFeatureModule.Instance.RegisterMcpHandlers( |
| 22 | ctx, |
| 23 | new McpHandlerRegistrarAdapter((id, handler) => add(id, (args, ct) => handler(args, ct)))); |
| 24 | } |
| 25 | } |
| 26 | |
View only · write via MCP/CIDE