How int04/chatcmd works
ChatCMD is a self-hosted MCP bridge that lets AI clients use permission-scoped tools on a local machine. A client connects through the MCP server; tool dispatch applies authorization and invokes terminal, filesystem, Git, process, skill, or task capabilities. The server persists local state and exposes a management API and live events to the React console. An optional browser extension bridges ChatGPT conversations and can provide a sub-agent fallback. The README documents these capabilities; sampled source confirms the route, persistence, and event boundaries, but not every internal dispatch call.
Main entry points: routes.rs Local API · runtime_host.rs Runtime host · dispatch.rs Tool dispatch · App.tsx Management console
Components 21
Entry points
- MCP HTTP
crates/chatcmd-mcp/src/http_transport.rs - MCP server
crates/chatcmd-mcp/src/mcp_server.rs - Local API
src/api/routes.rs - Live events
src/websocket/mod.rs
Control plane
- Runtime host
src/runtime_host.rs - Tool dispatch
src/runtime_host/dispatch.rs - Authorization
src/runtime_host/approval.rs - Sub-agent lifecycle
src/runtime_host/subagents.rs
Local execution
- Machine tools
crates/chatcmd-runtime/src/services.rs - PTY terminals
crates/chatcmd-runtime/src/shell.rs - Skill discovery
crates/chatcmd-runtime/src/skill_service.rs - ChatGPT bridge
src/api/chatgpt.rs - Browser extension
chatgpt-extension/background.js
Persistence
- SQLite repository
crates/chatcmd-storage/src/repository.rs - Compact sessions
crates/chatcmd-storage/src/compact/mod.rs
User interfaces
- Management console
web/src/App.tsx - Task supervision
web/src/pages/TasksPage.tsx - Access profiles
web/src/pages/AgentsPage.tsx
Other components
- MCP client
- Local operator
- ChatGPT browser
Connections 25
- MCP client → MCP HTTP: sends MCP requests
- MCP HTTP → MCP server: forwards requests
- MCP server → Runtime host: invokes runtime
- Runtime host → Tool dispatch: dispatches tools
- Tool dispatch → Authorization: checks permission
- Tool dispatch → Machine tools: invokes tools
- Tool dispatch → PTY terminals: controls terminals
- Tool dispatch → Skill discovery: discovers skills
- Runtime host → Sub-agent lifecycle: coordinates agents
- Runtime host → SQLite repository: persists state
- Local API → SQLite repository: reads and writes
- Local API → ChatGPT bridge: handles bridge routes
- ChatGPT bridge → Browser extension: exchanges requests
- Browser extension → ChatGPT browser: drives conversations
- Local API → Compact sessions: manages compact jobs
- Compact sessions → SQLite repository: stores checkpoints
- Runtime host → Live events: publishes activity
- Live events → Management console: streams events
- Local operator → Management console: uses console
- Management console → Local API: calls local API
- Management console → Task supervision: renders tasks
- Management console → Access profiles: renders profiles
- Access profiles → Local API: manages profiles
- Task supervision → Local API: loads task detail
- ChatGPT browser → Browser extension: initiates browser work