Skip to content

feat(runtimed-py): add kernel introspection methods and remove MCP#580

Merged
rgbkrk merged 1 commit intomainfrom
quill/python-bindings-parity
Mar 7, 2026
Merged

feat(runtimed-py): add kernel introspection methods and remove MCP#580
rgbkrk merged 1 commit intomainfrom
quill/python-bindings-parity

Conversation

@rgbkrk
Copy link
Member

@rgbkrk rgbkrk commented Mar 7, 2026

Summary

Add 5 new methods to Session/AsyncSession for better kernel introspection and agent workflows:

  • complete(code, cursor_pos) - Code completions from kernel (discover DataFrame columns, methods, etc.)
  • get_queue_state() - See which cell is executing and which are queued
  • clear_outputs(cell_id) - Clear cell outputs before re-execution
  • run_all_cells() - Batch execute all code cells
  • get_history(pattern, n, unique) - Search kernel input history

Also add new types: CompletionItem, CompletionResult, QueueState, HistoryEntry

Remove MCP server from runtimed-py package - MCP tools are now handled by the separate nteract package.

Changes

  • crates/runtimed-py/src/output.rs: Add 4 new result types with proper repr methods
  • crates/runtimed-py/src/session.rs: Add 5 sync methods following existing patterns
  • crates/runtimed-py/src/async_session.rs: Add 5 async methods with future_into_py
  • crates/runtimed-py/src/lib.rs: Register new types in module
  • python/runtimed/src/runtimed/init.py: Export new types
  • python/runtimed/pyproject.toml: Remove mcp and httpx dependencies, remove runtimed-mcp entry point
  • python/runtimed/src/runtimed/_mcp_server.py: Deleted
  • python/runtimed/tests/test_mcp.py: Deleted

Verification

  • All new types accessible from Python
  • All new methods present on Session and AsyncSession
  • MCP server removed correctly
  • Package builds successfully with maturin
  • Existing tests pass (except pre-existing test_binary.py failure)
  • Rust formatting and clippy checks pass

PR submitted by @rgbkrk's agent, Quill

Add 5 new methods to Session/AsyncSession for better agent workflows:
- complete(code, cursor_pos) - code completions from kernel
- get_queue_state() - see executing/queued cells
- clear_outputs(cell_id) - clear cell outputs
- run_all_cells() - batch execute all code cells
- get_history(pattern, n, unique) - search kernel input history

Also add new types: CompletionItem, CompletionResult, QueueState, HistoryEntry

Remove MCP server from runtimed-py package - MCP tools are now handled
by the separate nteract package. This removes the mcp and httpx
dependencies.
@rgbkrk rgbkrk merged commit 0c229a4 into main Mar 7, 2026
14 checks passed
@rgbkrk rgbkrk deleted the quill/python-bindings-parity branch March 7, 2026 04:05
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.

1 participant