> For the complete documentation index, see [llms.txt](https://roam-tui.avelino.run/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://roam-tui.avelino.run/readme.md).

# Introduction

A Rust SDK, terminal UI, and MCP server for [Roam Research](https://roamresearch.com).

The `roam-sdk` crate provides three things in one package:

* **SDK** — a Rust client for the Roam Research API. Use it to build your own tools, scripts, or integrations.
* **TUI** — a terminal-based interface for navigating and editing your Roam graph.
* **MCP Server** — expose your Roam graph to AI assistants via the Model Context Protocol.

## Quick links

| I want to...                 | Go to                                                                        |
| ---------------------------- | ---------------------------------------------------------------------------- |
| Use the terminal app         | [TUI Installation](/tui/installation.md)                                     |
| Configure the app            | [Configuration](/tui/configuration.md)                                       |
| Learn keybindings            | [Keybindings](/tui/keybindings.md)                                           |
| Export notes                 | [Export](/export.md)                                                         |
| Select multiple blocks       | [Multi-Block Selection](/tui/multi-select.md)                                |
| Set up MCP for AI assistants | [MCP Setup](/mcp-server/setup.md)                                            |
| See MCP tools                | [Tools Reference](/mcp-server/tools.md)                                      |
| Use the Rust SDK             | [SDK Getting Started](/sdk/getting-started.md)                               |
| See API reference            | [Client](/sdk/client.md), [Types](/sdk/types.md), [Queries](/sdk/queries.md) |

## Architecture

```
roam-sdk (crate)
├── lib.rs          → SDK: RoamClient, types, queries, errors
├── main.rs         → TUI: terminal interface using the SDK
├── mcp.rs          → MCP: stdio server with 18 tools
└── export.rs       → Export: markdown and JSON formatters
```

The TUI is built on [Ratatui](https://ratatui.rs) + [Tokio](https://tokio.rs) and uses the SDK internally. The MCP server uses [rmcp](https://crates.io/crates/rmcp) for the Model Context Protocol implementation. Both ship from the same crate — install the binary with `cargo install roam-sdk`, or add the library with `cargo add roam-sdk`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://roam-tui.avelino.run/readme.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
