About Roam
Roam is an MCP server in the Search category: roam Research MCP server.
Install
claude mcp add roam -- npx -y @roam-research/roam-mcpnpx -y @roam-research/roam-mcpThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Tools (33)
add_commentAdd a comment to a block (comment thread, not child block)
Parameters not published.
add_shortcutAdd a page to the left sidebar Shortcuts / starred pages (optional `index` to position it)
Parameters not published.
append_to_daily_noteAppend/capture markdown to a daily note (today by default, or MM-DD-YYYY / `today`/`yesterday`/`tomorrow`; optional nest-under section)
Parameters not published.
call_extension_toolInvoke an AI tool registered by a Roam extension or roam/js script (discover available tools via the `extensionTools` field of `get_graph_guidelines`)
Parameters not published.
create_blockCreate blocks (by parent UID, page title, or daily note date — MM-DD-YYYY or `today`/`yesterday`/`tomorrow`; with optional nest-under)
Parameters not published.
create_pageCreate page with markdown content
Parameters not published.
datalog_queryExecute a raw Datalog query against the graph's Datomic database
Parameters not published.
delete_blockDelete a block (errors with `NOT_FOUND` when nothing exists to delete; older Roam servers may instead report success without deleting)
Parameters not published.
delete_pageDelete a page (errors with `NOT_FOUND` when nothing exists to delete; older Roam servers may instead report success without deleting)
Parameters not published.
file_deleteDelete a file hosted on Roam
Parameters not published.
Show all 33 tools
file_getFetch a file hosted on Roam (handles decryption for encrypted graphs)
Parameters not published.
file_uploadUpload a file to Roam (from local path, URL, or base64)
Parameters not published.
get_backlinksGet references to a page/block
Parameters not published.
get_blockGet block content as markdown
Parameters not published.
get_commentsGet comments on a block with author/date context
Parameters not published.
get_graph_guidelinesReturns user-defined instructions and preferences for AI agents
Parameters not published.
get_open_windowsMain window view and all sidebar windows
Parameters not published.
get_pageGet page content as markdown
Parameters not published.
get_selectionCurrently focused block and multi-selected blocks
Parameters not published.
list_graphsList all configured graphs with their nicknames
Parameters not published.
move_blockMove a block to a new location
Parameters not published.
open_main_windowNavigate to page/block
Parameters not published.
open_sidebarOpen in right sidebar
Parameters not published.
reload_dev_extensionsReload all developer-mode extensions in Roam Desktop (apply code changes without restarting)
Parameters not published.
remove_shortcutRemove a page from the left sidebar Shortcuts / starred pages
Parameters not published.
roam_queryExecute a Roam query (`{{query:}}` blocks, not Datalog)
Parameters not published.
searchSearch pages/blocks (empty query returns recently edited/viewed content)
Parameters not published.
search_templatesSearch Roam templates by name
Parameters not published.
semantic_searchSemantic (embeddings) search by meaning; requires embeddings enabled and a signed-in user
Parameters not published.
setup_new_graphSet up a new graph connection, or list available graphs
Parameters not published.
suggest_linksSuggest existing pages worth linking to from a passage of text (does not create links)
Parameters not published.
update_blockUpdate block content/properties
Parameters not published.
update_pageUpdate page title or children view type
Parameters not published.
Ask AI
Ask AI about Roam
Powered by Claude · Grounded in docs
Security checks
- ✓README presentThe repository ships documentation.
5 checks have not been run yet.
README
Roam MCP
A Model Context Protocol (MCP) server and CLI for Roam Research.
Alpha Software: This project is in early development and subject to breaking changes.
[!CAUTION] Full Write Access: This MCP server gives Claude full read and write access to your Roam graph. Claude can create, modify, and delete pages and blocks. Changes may be difficult or impossible to undo. Roam does not have a traditional undo history that can reverse bulk operations or deletions made through the API.
Recommendations:
- Back up your graph before use
- Start with a test graph to understand Claude's behavior
- Review what Claude plans to do before confirming write operations
- Be specific in your instructions to avoid unintended changes
Prerequisites
- Node.js v18 or later
- Roam Research desktop app (the local API is not available in the web version)
How It Works
This MCP server connects to Roam's local HTTP API, which runs on your machine when the desktop app is open. If Roam isn't running when a tool is called, the server will automatically launch it via deep link and retry the connection.
Getting Started
1. Roam Desktop App
The local API requires the Roam desktop app (not the web version). Make sure it's installed and you can open your graph in it.
2. Connect a Graph
Interactive (recommended for first-time setup):
npx @roam-research/roam-mcp connect
This will walk you through selecting a graph, choosing permissions, and approving the token in Roam. You can also use the CLI: install globally with npm install -g @roam-research/roam-cli, then use roam connect.
Non-interactive (for scripts and LLM agents):
# example to connect to your graph called "my-graph-name" which you generally refer to as "My Team Graph"
npx @roam-research/roam-mcp connect --graph my-graph-name --nickname "My Team Graph" --access-level full
# example to connect to a public graph - our "help" graph
npx @roam-research/roam-mcp connect --graph help --public --nickname "Roam official help graph"
| Flag | Default | Description |
|---|---|---|
--graph <name> |
— | Graph name (enables non-interactive mode) |
--nickname <name> |
Required with --graph |
Short name you'll use to refer to this graph |
--access-level <level> |
full |
full, read-append, or read-only |
--public |
— | Public graph (read-only, hosted) |
--type <type> |
hosted |
hosted or offline |
Note: Both modes require a human to approve the token dialog in the Roam desktop app.
To remove a connection:
npx @roam-research/roam-mcp connect --remove --graph my-graph-name
npx @roam-research/roam-mcp connect --remove --nickname "My Team Graph"
Run connect again to add more graphs or update permissions.
3. Connect to an MCP Client
Claude Desktop
Add to your Claude Desktop config file:
{
"mcpServers": {
"roam": {
"command": "npx",
"args": ["-y", "@roam-research/roam-mcp"]
}
}
}
Config file location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Restart Claude Desktop after saving.
Claude Code
claude mcp add -s user roam-mcp -- npx -y @roam-research/roam-mcp
This makes Roam available in all your Claude Code sessions. To add it to a single project only, use -s local instead.
Multiple Graphs
Run connect multiple times to add additional graphs. Each graph gets a nickname (a short name like "work" or "team acme") for easy selection.
Graph Selection:
- Single graph configured: Auto-selected, no action needed
- Multiple graphs configured: Pass the
graphparameter on each tool call with the nickname
Manual Configuration (Advanced)
Instead of using connect, you can manually create ~/.roam-tools.json:
{
"version": 1,
"graphs": [
{
"name": "your-graph-name",
"type": "hosted",
"token": "roam-graph-local-token-...",
"nickname": "my-graph"
}
]
}
To create a token manually: Roam Desktop → Settings → Graph → Local API Tokens → New Token.
| Field | Required | Description |
|---|---|---|
name |
Yes | The actual graph name in Roam (as shown in the URL) |
type |
No | "hosted" (default) for cloud graphs, "offline" for local-only |
token |
Yes | Local API token from Roam settings |
nickname |
Yes | Slug identifier for this graph (lowercase, hyphens, no spaces) |
accessLevel |
No | "full" (default), "read-only", or "read-append" |
Available Tools
Graph Management:
list_graphs- List all configured graphs with their nicknamessetup_new_graph- Set up a new graph connection, or list available graphs
Graph Guidelines:
get_graph_guidelines- Returns user-defined instructions and preferences for AI agents
Graph guidelines let you store preferences and context directly in your Roam graph that AI agents will follow. Create a page called [[roam/agent guidelines]] with your instructions. These might include naming conventions, preferred page structures, topics to focus on, or any other context that should guide how the AI interacts with your graph.
Content:
create_page- Create page with markdown contentupdate_page- Update page title or children view typedelete_page- Delete a pagecreate_block- Create blocks (by parent UID, page title, or daily note date; with optional nest-under)update_block- Update block content/propertiesmove_block- Move a block to a new locationdelete_block- Delete a blockadd_comment- Add a comment to a block (comment thread, not child block)get_comments- Get comments on a block with author/date context
Read:
search- Search pages/blocks (empty query returns recently edited/viewed content)search_templates- Search Roam templates by nameroam_query- Execute a Roam query ({{query:}}blocks, not Datalog)datalog_query- Execute a raw Datalog query against the graph's Datomic databaseget_page- Get page content as markdownget_block- Get block content as markdownget_backlinks- Get references to a page/block
Navigation:
get_open_windows- Main window view and all sidebar windowsget_selection- Currently focused block and multi-selected blocksopen_main_window- Navigate to page/blockopen_sidebar- Open in right sidebar
Files:
file_get- Fetch a file hosted on Roam (handles decryption for encrypted graphs)file_upload- Upload a file to Roam (from local path, URL, or base64)file_delete- Delete a file hosted on Roam
CLI
Install globally for quick access:
npm install -g @roam-research/roam-cli
roam list-graphs
roam connect # Interactive setup
roam connect --graph <name> --nickname <name> # Non-interactive
roam search --query "my notes" --graph <name-or-nickname>
roam get-page --title "My Page" --graph <name-or-nickname>
If you only have one graph configured, the --graph flag is optional.
Run roam --help to see all available commands. You can also use npx @roam-research/roam-cli without installing globally.
Packages
This repository is a monorepo with three packages:
| Package | Description |
|---|---|
@roam-research/roam-tools-core |
Shared core library (client, tools, operations, config, types) |
@roam-research/roam-mcp |
MCP server — connect Claude/Cursor/etc. to Roam |
@roam-research/roam-cli |
CLI — setup and direct tool access |
Development
To work on this project from source:
git clone https://github.com/Roam-Research/roam-tools.git
cd roam-tools
npm install
npm run build
Development commands:
npm run mcp # Run MCP server in dev mode (tsx)
npm run cli -- connect # Run CLI in dev mode
npm run typecheck # Type-check (force rebuild, checks all packages)
npm run lint # Lint with ESLint
npm run format:check # Check formatting with Prettier
npm run version:check # Verify all package versions are consistent
npm run version:bump 0.5.0 # Bump all packages to a new version
See npm packaging design for why the packages are structured this way.
Contributing
This project is changing rapidly. At this time, we prefer suggestions and feedback over pull requests. Please open an issue or join the #ai-in-roam channel on slack to discuss ideas before submitting code.
README copy captured when this server was indexed; it may lag the repository. The original is authoritative.