Components
MomcpTUI (Main App)
The main Textual application that orchestrates everything.
Responsibilities:
- Compose the TUI layout (header, chat, input, footer)
- Handle user input and command routing
- Manage chat history and display
- Coordinate LLM calls and tool execution
LLMClient
Handles communication with LLM provider APIs.
Features:
- Streaming SSE response parsing
- Tool call streaming with argument buffering
- Thinking/reasoning content extraction
- API key management per provider
- Special header handling for MiMo (
api-keyvsAuthorization)
MCPManager
Manages connections to MCP servers.
Features:
- Register stdio and HTTP MCP servers
- Lazy connection (connects on first tool call)
- Thread-safe async bridge
- Tool discovery and invocation
Config
Configuration management.
Features:
- Load/save configuration file
- Built-in model registry (9 providers)
- Custom model support
- Provider API key URL mapping
MomcpServer
The built-in MCP server providing file and command tools.
Built-in tools:
fs_list,fs_read,fs_write,fs_mkdir,fs_deletecode_replace,code_writerun_command