Skip to content
orhunPublic

About

An accessibility & agentic layer for Rust UI applications πŸ€

Topics

Resources

Code of conduct

Contributing

Security policy

Accessibility

Stars

12 stars

Watchers

1 watching

Forks

molerat logo

molerat: An accessibility & agentic layer for Rust UI applications, built on AccessKit πŸ€

GitHub release MIT or Apache-2.0 license
Crate release Documentation Supports Ratatui

molerat-demo.mp4
Table of Contents

Quickstart

cargo add molerat

Add molerat to your app and publish a semantic view alongside your existing UI:

use molerat::Molerat;

let mut molerat = Molerat::<()>::new("Notes");
molerat.publish(|ui| {
    ui.text("status", "All changes saved");
});

See the available semantic UI components in the API documentation.

If you have actions in your app, define an enum and return them from your UI handlers:

use molerat::Molerat;

#[derive(Debug)]
enum Message {
    Save,
}

let mut molerat = Molerat::<Message>::new("Notes");
molerat.publish(|ui| {
    ui.button("save", "Save").on_click(|| Message::Save);
});

See the available semantic actions in the API documentation.

To handle the incoming actions:

for message in molerat.messages() {
    match message {
        Message::Save => { /* update app state */ }
    }
}

Here is how your semantic tree and actions will look in Accerciser:

Examples

Run one with:

cargo run --example <example-name> --features <mcp|atspi>

# For example:
cargo run --example ratatui-recipe-atspi --features atspi

# The MCP examples require the stdio bridge (molerat-mcp) to be installed:
cargo install molerat --features mcp --bin molerat-mcp
cargo run --example ratatui-recipe-mcp --features mcp

The examples above are built with Ratatui, but molerat is not designed for any specific UI framework.

Tip

If you want to integrate molerat with Ratatui, see the migration guide or simply give that document as a prompt to your agent πŸ§€

Showcase

Here is knife (a reverse-engineering TUI) solving a crackme challenge:

molerat-knife.mp4

Here is BugStalker (a Rust debugger) debugging an application:

molerat-bugstalker.mp4

Integrations

Screen readers

You can use the AT-SPI to expose your UI/actions to screen readers on Linux!

  1. Enable atspi feature:
cargo add molerat --features atspi
  1. And then adjust your constructor to use AT-SPI:
let mut molerat = Molerat::<Message>::new_atspi("Notes");

Nothing else is needed!

Agents

You can use the Model Context Protocol (MCP) to expose your UI/actions to agents!

  1. Install the molerat-mcp stdio bridge and register it with your MCP client:
cargo install molerat --features mcp --bin molerat-mcp
  1. Register the installed binary with your MCP client. e.g. Codex:
codex mcp add molerat -- "$(command -v molerat-mcp)"
  1. Enable mcp feature:
cargo add molerat --features mcp
  1. And then you can change your constructor to use the MCP bridge:
let mut molerat = Molerat::<Message>::new_mcp("Notes")?;

That's it! Your app is now agentic and can be controlled by your favorite agent.

License

Licensed under either of Apache License Version 2.0 or The MIT License at your option.

πŸ¦€ γƒŽ( ΒΊ _ ΒΊ γƒŽ) - respect crables!

Copyright

Copyright Β© 2026, Orhun ParmaksΔ±z

About

An accessibility & agentic layer for Rust UI applications πŸ€

Topics

Resources

Code of conduct

Contributing

Security policy

Accessibility

Stars

12 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages