Skip to content

Agent KB_mcp

grisun0 edited this page Oct 23, 2026 · 11 revisions

Subsystem: mcp

mcp/init.py

  • Layer: utility
  • Language: py

mcp/mcp_dbg_driver.py

  • Doc: Debug driver: boot MiniOS through the MCP bridge and run freedom.
  • Layer: infrastructure
  • Language: py
  • Symbols:
    • Client (class, line 15) class Client
    • main (function, line 64) def main()
    • __init__ (method, line 16) def __init__(self)
    • request (method, line 28) def request(self, method, params)
    • tool (method, line 46) def tool(self, name, params)
    • close (method, line 54) def close(self)
  • Depends on: kernel/time.c

mcp/mcp_dogfood.py

  • Doc: Dogfood: drive minios_mcp.py over stdio JSON-RPC and install the freedom addon from a git repo...
  • Layer: utility
  • Language: py
  • Symbols:
    • Client (class, line 19) class Client
    • main (function, line 78) def main()
    • __init__ (method, line 20) def __init__(self, addons_dir)
    • request (method, line 40) def request(self, method, params)
    • tool (method, line 58) def tool(self, name, params)
    • close (method, line 68) def close(self)
  • Depends on: kernel/time.c

mcp/minios_addons.py

  • Doc: MiniOS addon marketplace (lazyaddons-style).
  • Layer: utility
  • Language: py
  • Symbols:
    • AddonError (class, line 56) class AddonError(Exception)
    • _clean (function, line 62) def _clean(s)
    • _unquote (function, line 66) def _unquote(v)
    • parse_addon_yaml (function, line 73) def parse_addon_yaml(text)
    • validate_addon (function, line 205) def validate_addon(addon, source)
    • validate_addon_path (function, line 295) def validate_addon_path(path)
    • validate_shell_line (function, line 309) def validate_shell_line(line)
    • load_addons_dir (function, line 323) def load_addons_dir(addons_dir)
    • split_for_editor (function, line 347) def split_for_editor(text)
    • exit_code_of (function, line 372) def exit_code_of(text)
    • AddonState (class, line 377) class AddonState
    • install_addon (function, line 401) def install_addon(session, addon, cfg)
    • fail (function, line 85) def fail(lineno, why)
    • __init__ (method, line 380) def __init__(self, path)
    • load (method, line 383) def load(self)
    • save (method, line 393) def save(self, addons)
  • Depends on: kernel/time.c
  • Imported by: mcp/minios_mcp.py

mcp/minios_mcp.py

  • Doc: MiniOS MCP bridge.
  • Layer: utility
  • Language: py
  • Symbols:
    • env_config (function, line 71) def env_config()
    • clamp_timeout (function, line 89) def clamp_timeout(ms)
    • validate_path (function, line 102) def validate_path(name)
    • validate_content (function, line 118) def validate_content(text)
    • ToolError (class, line 131) class ToolError(Exception)
    • RPCError (class, line 137) class RPCError(Exception)
    • LogBuffer (class, line 146) class LogBuffer
    • MiniOSSession (class, line 216) class MiniOSSession
    • subprocess_launch (function, line 580) def subprocess_launch(cfg, slave_fd)
    • MCPServer (class, line 731) class MCPServer
    • main (function, line 888) def main()
    • __init__ (method, line 140) def __init__(self, code, message)
    • __init__ (method, line 149) def __init__(self, cap)
    • append (method, line 155) def append(self, data)
    • bytes_from (method, line 163) def bytes_from(self, pos)
    • text_from (method, line 168) def text_from(self, pos, end)
    • find (method, line 175) def find(self, marker, start)
    • wait_for (method, line 179) def wait_for(self, marker, start, timeout_ms)
    • wait_for_any (method, line 192) def wait_for_any(self, markers, start, timeout_ms)
    • _find_locked (method, line 206) def _find_locked(self, marker, start)
    • __init__ (method, line 219) def __init__(self, cfg)
    • booted (method, line 230) def booted(self)
    • status (method, line 233) def status(self)
    • _reap_stale (method, line 242) def _reap_stale(self)
    • _drop_pidfile (method, line 278) def _drop_pidfile(self)
    • boot (method, line 284) def boot(self, timeout_ms)
    • _read_loop (method, line 319) def _read_loop(self)
    • _close_pty (method, line 329) def _close_pty(self)
    • _write_line (method, line 339) def _write_line(self, line)
    • _write_editor_line (method, line 348) def _write_editor_line(self, line)
    • send (method, line 356) def send(self, line, timeout_ms)
    • expect (method, line 367) def expect(self, marker, timeout_ms)
    • snapshot (method, line 381) def snapshot(self, max_bytes)
    • run_test (method, line 391) def run_test(self, commands, expect, refute, timeout_ms)
    • cat (method, line 447) def cat(self, path)
    • run_python (method, line 453) def run_python(self, script, args, timeout_ms)
    • cat_body (method, line 464) def cat_body(self, path, missing_ok)
    • _cleanup_parts (method, line 493) def _cleanup_parts(self, parts)
    • write (method, line 500) def write(self, path, content)
    • poweroff (method, line 537) def poweroff(self, timeout_ms)
    • terminate (method, line 557) def terminate(self)
    • close (method, line 576) def close(self)
    • __init__ (method, line 734) def __init__(self, cfg)
    • run (method, line 738) def run(self)
    • _handle (method, line 746) def _handle(self, line)
    • _initialize (method, line 772) def _initialize(self, params)
    • _call (method, line 779) def _call(self, params)
    • _dispatch (method, line 796) def _dispatch(self, name, args)
    • _addons_list (method, line 842) def _addons_list(self)
    • _addon_install (method, line 863) def _addon_install(self, args)
    • _reply (method, line 884) def _reply(self, msg)
  • Depends on: kernel/time.c, mcp/minios_addons.py

mcp/mutate_mcp.sh

  • Doc: Mutation testing for the MiniOS MCP bridge.
  • Layer: utility
  • Language: sh
  • Symbols:
    • run_one (function, line 116)

mcp/test_minios_mcp.py

  • Doc: Unit and BDD suite for the MiniOS MCP bridge.
  • Layer: testing
  • Language: py
  • Symbols:
    • load_module (function, line 29) def load_module()
    • have_qemu (function, line 52) def have_qemu()
    • MCPServer (class, line 58) class MCPServer
    • TestProtocol (class, line 141) class TestProtocol(TestCase)
    • TestValidation (class, line 205) class TestValidation(TestCase)
    • TestLogBuffer (class, line 254) class TestLogBuffer(TestCase)
    • _ConsoleBDDBase (class, line 306) class _ConsoleBDDBase(TestCase)
    • TestMiniOSBDD (class, line 342) class TestMiniOSBDD(_ConsoleBDDBase)
    • TestAddonYaml (class, line 480) class TestAddonYaml(TestCase)
    • TestAddonHelpers (class, line 602) class TestAddonHelpers(TestCase)
    • FakeOS (class, line 642) class FakeOS
    • TestAddonInstall (class, line 708) class TestAddonInstall(TestCase)
    • TestAddonBDD (class, line 844) class TestAddonBDD(_ConsoleBDDBase)
    • __init__ (method, line 61) def __init__(self, env_extra)
    • initialize (method, line 80) def initialize(self)
    • request (method, line 84) def request(self, method, params)
    • raw (method, line 91) def raw(self, line)
    • _read_response (method, line 96) def _read_response(self)
    • _roundtrip (method, line 102) def _roundtrip(self, msg)
    • tool (method, line 110) def tool(self, name, params)
    • close (method, line 120) def close(self)
    • setUpClass (method, line 143) def setUpClass(cls)
    • tearDownClass (method, line 149) def tearDownClass(cls)
    • test_initialize (method, line 152) def test_initialize(self)
    • test_tools_list (method, line 158) def test_tools_list(self)
    • test_ping (method, line 166) def test_ping(self)
    • test_unknown_method (method, line 170) def test_unknown_method(self)
    • test_malformed_json (method, line 174) def test_malformed_json(self)
    • test_unknown_tool (method, line 178) def test_unknown_tool(self)
    • test_send_not_booted (method, line 183) def test_send_not_booted(self)
    • test_send_empty_line_rejected (method, line 189) def test_send_empty_line_rejected(self)
    • test_test_not_booted (method, line 195) def test_test_not_booted(self)
    • setUpClass (method, line 207) def setUpClass(cls)
    • test_path_accepts_plain_names (method, line 212) def test_path_accepts_plain_names(self)
    • test_path_rejects_unsafe (method, line 216) def test_path_rejects_unsafe(self)
    • test_path_rejects_long (method, line 220) def test_path_rejects_long(self)
    • test_content_accepts_ascii (method, line 223) def test_content_accepts_ascii(self)
    • test_content_rejects_non_printable (method, line 226) def test_content_rejects_non_printable(self)
    • test_timeout_clamped (method, line 230) def test_timeout_clamped(self)
    • test_write_rejects_line_too_long (method, line 234) def test_write_rejects_line_too_long(self)
    • test_write_rejects_too_many_lines (method, line 243) def test_write_rejects_too_many_lines(self)
    • setUpClass (method, line 256) def setUpClass(cls)
    • test_bounds (method, line 261) def test_bounds(self)
    • test_find_and_total (method, line 268) def test_find_and_total(self)
    • test_cursor_prevents_stale_match (method, line 275) def test_cursor_prevents_stale_match(self)
    • test_wait_for_any_earliest (method, line 284) def test_wait_for_any_earliest(self)
    • test_cat_body_drops_console_framing (method, line 292) def test_cat_body_drops_console_framing(self)
    • test_editor_prompt_forms_cover_kernel_markers (method, line 298) def test_editor_prompt_forms_cover_kernel_markers(self)
    • guard_server (method, line 315) def guard_server(cls)
    • setUp (method, line 336) def setUp(self)
    • setUpClass (method, line 344) def setUpClass(cls)
    • tearDownClass (method, line 351) def tearDownClass(cls)
    • test_t01_boot (method, line 355) def test_t01_boot(self)
    • test_t02_expect (method, line 365) def test_t02_expect(self)
    • test_t03_write_and_cat (method, line 372) def test_t03_write_and_cat(self)
    • test_t04_toolchain_elf (method, line 382) def test_t04_toolchain_elf(self)
    • test_t05_toolchain_cvm (method, line 394) def test_t05_toolchain_cvm(self)
    • test_t06_selfhosted_compiler (method, line 404) def test_t06_selfhosted_compiler(self)
    • test_t07_bin_command_path (method, line 411) def test_t07_bin_command_path(self)
    • test_t08_python_script (method, line 419) def test_t08_python_script(self)
    • test_t09_py_eval (method, line 426) def test_t09_py_eval(self)
    • test_t10_minios_test (method, line 431) def test_t10_minios_test(self)
    • test_t11_poweroff_and_reboot (method, line 452) def test_t11_poweroff_and_reboot(self)
    • setUpClass (method, line 482) def setUpClass(cls)
    • test_parse_valid (method, line 492) def test_parse_valid(self)
    • test_validate_accepts_valid (method, line 502) def test_validate_accepts_valid(self)
    • test_unknown_key_rejected (method, line 506) def test_unknown_key_rejected(self)
    • test_bad_indent_rejected (method, line 510) def test_bad_indent_rejected(self)
    • test_validate_rejects_bad_dst (method, line 514) def test_validate_rejects_bad_dst(self)
    • test_validate_rejects_missing_name (method, line 519) def test_validate_rejects_missing_name(self)
    • test_validate_rejects_long_build_line (method, line 523) def test_validate_rejects_long_build_line(self)
    • test_validate_rejects_control_chars (method, line 531) def test_validate_rejects_control_chars(self)
    • test_validate_rejects_empty_files (method, line 536) def test_validate_rejects_empty_files(self)
    • test_host_kind_accepts_empty_files (method, line 541) def test_host_kind_accepts_empty_files(self)
    • test_reference_kind_carries_nothing (method, line 556) def test_reference_kind_carries_nothing(self)
    • test_bad_kind_rejected (method, line 564) def test_bad_kind_rejected(self)
    • test_host_kind_requires_artifact (method, line 572) def test_host_kind_requires_artifact(self)
    • test_install_refuses_host_before_touching_session (method, line 586) def test_install_refuses_host_before_touching_session(self)
    • setUpClass (method, line 604) def setUpClass(cls)
    • test_split_for_editor_chunks (method, line 614) def test_split_for_editor_chunks(self)
    • test_split_rejects_long_line (method, line 621) def test_split_rejects_long_line(self)
    • test_split_rejects_non_ascii (method, line 625) def test_split_rejects_non_ascii(self)
    • test_exit_code_of (method, line 629) def test_exit_code_of(self)
    • test_state_roundtrip (method, line 634) def test_state_roundtrip(self)
    • __init__ (method, line 645) def __init__(self, exit_codes)
    • booted (method, line 652) def booted(self)
    • boot (method, line 655) def boot(self, timeout_ms)
    • write (method, line 659) def write(self, path, content)
    • send (method, line 666) def send(self, line, timeout_ms)
    • cat_body (method, line 690) def cat_body(self, path, missing_ok)
    • _toolerror (class, line 697) class _toolerror(Exception)
    • _cleanup_parts (method, line 702) def _cleanup_parts(self, parts)
    • setUpClass (method, line 710) def setUpClass(cls)
    • tearDownClass (method, line 742) def tearDownClass(cls)
    • make_addon (method, line 747) def make_addon(self)
    • test_install_success (method, line 769) def test_install_success(self)
    • test_install_mismatch_aborts_and_cleans (method, line 782) def test_install_mismatch_aborts_and_cleans(self)
    • test_install_multi_chunk_reassembly (method, line 796) def test_install_multi_chunk_reassembly(self)
    • test_install_verify_failure_aborts (method, line 828) def test_install_verify_failure_aborts(self)
    • test_install_build_failure_aborts (method, line 835) def test_install_build_failure_aborts(self)
    • setUpClass (method, line 848) def setUpClass(cls)
    • tearDownClass (method, line 886) def tearDownClass(cls)
    • test_addons_list (method, line 894) def test_addons_list(self)
    • test_install_fixture (method, line 900) def test_install_fixture(self)
    • test_install_unknown_addon_fails (method, line 909) def test_install_unknown_addon_fails(self)
    • guarded (function, line 318) def guarded(name, params)
    • broken_cat (function, line 786) def broken_cat(path, missing_ok)

Start

Wiki

Agent Docs

Recipes

Clone this wiki locally