Skip to content

Align on modular MCP runtime and UI boundaries #196

@ctharvey

Description

@ctharvey

What

I’d like to work on some MCP runtime and UI cleanup, and wanted to align on scope before opening PRs.

MCP is already a core part of Reasonix. I’m not proposing a rewrite or trying to reframe it as something new. The thing I’m interested in is making the existing MCP pieces easier to work with: cleaner runtime boundaries, clearer lifecycle/status handling, and better TUI surfaces around what MCP servers are doing.

Why

The MCP code already covers a lot: client/transport, registry bridging, reconnect behavior, drift handling, slash commands, browser UI, disable/reconnect helpers, and status output.

That is useful, but it also means MCP behavior is spread across runtime code and UI code in a few different places. When working on it, I found myself wanting a cleaner boundary between “what is the MCP server state?” and “how should the TUI show that state?”

I think tightening that seam would make future MCP work easier to land as small PRs.

Areas I’m looking at

  • clearer MCP server lifecycle state
  • cleaner separation between MCP runtime logic and TUI formatting
  • reusable server summaries or view models for /mcp, browser, toast, reconnect, and inspect surfaces
  • enable / disable / reconnect / inspect behavior
  • registry and tool identity behavior across reconnects
  • tests around lifecycle transitions, recovery paths, and UI-facing status summaries

Proposed approach

I’d like to keep this as a sequence of small PRs rather than one large change.

I do already have some local work in this direction. I’m happy to split it up, reshape it, or start with a smaller first PR depending on what you think the right boundary should be.

A possible first PR would be a no-behavior-change extraction around MCP server summaries or lifecycle view models, used by the existing UI paths. The goal would be to give the TUI a cleaner object to render without changing MCP behavior.

After that, follow-up PRs could improve status display, reconnect/disable feedback, and recovery behavior one piece at a time.

Non-goals

  • no broad rewrite
  • no unrelated TUI redesign
  • no external server bundle or integration in core
  • no MCP protocol behavior changes without discussion
  • no CHANGELOG.md edits
  • no behavior changes without tests

Question

Does this direction fit where you want MCP to go?

If so, what would you prefer as the first small PR boundary?

Metadata

Metadata

Assignees

No one assigned

    Labels

    rfcArchitecture proposal / request for commentstrackingTracking issue / umbrella for a multi-PR effort

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions