Skip to content

Add MCP server transport for Copilot Chat integration#36

Merged
Redth merged 5 commits intoRedth:mainfrom
emaf:dev/ema/mcp
Mar 11, 2026
Merged

Add MCP server transport for Copilot Chat integration#36
Redth merged 5 commits intoRedth:mainfrom
emaf:dev/ema/mcp

Conversation

@emaf
Copy link
Copy Markdown
Contributor

@emaf emaf commented Mar 11, 2026

Add 'maui-devflow mcp-serve' command that starts an MCP (Model Context
Protocol) server over stdio. This enables VS Code Copilot Chat and other
MCP-compatible AI hosts to interact with running MAUI apps through
structured, typed tool responses — including inline screenshots.

emaf and others added 5 commits March 11, 2026 13:19
Add 'maui-devflow mcp-serve' command that starts an MCP (Model Context
Protocol) server over stdio. This enables VS Code Copilot Chat and other
MCP-compatible AI hosts to interact with running MAUI apps through
structured, typed tool responses — including inline screenshots.

27 MCP tools exposed:
- maui_screenshot (returns image directly), maui_tree (structured JSON)
- maui_logs, maui_network, maui_network_detail, maui_network_clear
- maui_tap, maui_fill, maui_clear, maui_scroll
- maui_set_property, maui_get_property
- maui_navigate, maui_focus, maui_resize
- maui_query, maui_query_css, maui_element, maui_hittest
- maui_list_agents, maui_status, maui_wait, maui_select_agent
- maui_cdp_evaluate, maui_cdp_screenshot, maui_cdp_source, maui_cdp_webviews

The existing CLI is unchanged — MCP is purely additive.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add maui_assert tool for element property assertions
- Add maui_recording_start/stop/status tools for screen recording
- Update maui_scroll with itemIndex, groupIndex, scrollToPosition params
- Update maui_screenshot with maxWidth and scale params
- Update maui_logs with skip param for pagination
- Register new tools in McpServerHost

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add SetPropertyAsync, GetLogsAsync, SendCdpCommandAsync to AgentClient
- Refactor MCP PropertyTools, LogsTool, CdpTools to use AgentClient
  instead of direct HTTP calls (removed static HttpClient instances)
- Extract shared port resolution to BrokerClient.ResolveAgentPortForProjectAsync()
- Simplify McpAgentSession (87 → 33 lines) by delegating to BrokerClient
- Simplify Program.ResolveAgentPort() by delegating to shared helper
- Move ReadConfigPort() to BrokerClient, remove duplicate in Program.cs
- Update CLI handlers (set-property, logs, CDP, webviews, source) to use AgentClient

Net: -130 lines, 0 direct HttpClient usage in MCP tools

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…sors

New MCP tools:
- maui_preferences_list/get/set/delete/clear
- maui_secure_storage_get/set/delete/clear
- maui_app_info, maui_device_info, maui_display_info
- maui_battery_info, maui_connectivity, maui_geolocation
- maui_sensors_list/start/stop

AgentClient: added methods for preferences, secure storage,
platform info, geolocation, and sensor management.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Redth Redth merged commit f7703bc into Redth:main Mar 11, 2026
2 checks passed
@emaf emaf deleted the dev/ema/mcp branch March 11, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants