Skip to main content
Glama
mickm3n

Roam Research MCP Server

by mickm3n
README.md
# Roam Research MCP Server

A Model Context Protocol (MCP) server that provides tools to interact with Roam Research API, enabling Claude Desktop to read from and write to your Roam Research graph.

## Features

- **Get Page Content**: Retrieve content from any page with nested child blocks in markdown format
- **Get Page References**: Find all references to a specific page with pagination support and time-based sorting
- **Write to Page**: Add new blocks to existing pages
- **Write to Today**: Add content to today's daily page (auto-creates if needed)
- **Markdown Conversion**: Automatically converts Roam-style `[[links]]` to markdown format
- **Nested Block Support**: Handles hierarchical block structures with proper indentation

## Installation

### Prerequisites
- Python 3.11+
- [uv](https://docs.astral.sh/uv/) package manager
- Roam Research API token and graph access

### Setup

1. Clone the repository:
```bash
git clone <repository-url>
cd roam-research-mcp
```

2. Install dependencies:
```bash
uv sync
```

3. Set up environment variables:
```bash
export ROAM_TOKEN="your_roam_research_api_token"
export ROAM_GRAPH_NAME="your_graph_name"
```

## Claude Desktop Integration

Add this configuration to your Claude Desktop config file:

**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows**: `%APPDATA%/Claude/claude_desktop_config.json`

```json
{
  "mcpServers": {
    "roam-research": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/roam-research-mcp",
        "run",
        "python",
        "main.py"
      ],
      "env": {
        "ROAM_TOKEN": "your_actual_roam_token",
        "ROAM_GRAPH_NAME": "your_graph_name"
      }
    }
  }
}
```

## Usage

Once configured with Claude Desktop, you can:

- Ask Claude to read content from your Roam pages
- Have Claude write notes and thoughts to your daily pages
- Query page references and connections
- Add structured content to specific pages

## Development

See [CLAUDE.md](./CLAUDE.md) for development guidelines and git commit conventions.

## API Requirements

- Valid Roam Research API token
- Graph name with API access enabled
- Network access to `api.roamresearch.com`

## License

MIT License

TDQS

A4.5/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose with no overlap: get_page_content retrieves page content, get_page_references finds references to pages, write_to_page writes to a specific page, and write_to_today writes to today's daily page. The separation between general page operations and the specialized daily page operation is well-defined, preventing confusion.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with snake_case: get_page_content, get_page_references, write_to_page, and write_to_today. The naming is predictable and readable, making it easy for agents to understand the action and target at a glance.

Tool Count4/5

Four tools are reasonable for a Roam Research server, covering core read and write operations. However, the scope feels slightly thin as it lacks update or delete capabilities for existing blocks, which are common in note-taking workflows. The count is appropriate but could be more comprehensive.

Completeness3/5

The tools cover basic retrieval and creation for pages and daily notes, but there are notable gaps. Missing operations include updating or deleting existing blocks, searching across pages, and managing page metadata. This limits agents to read and append-only workflows, which may cause failures in more complex tasks.

Maintenance

ActivityInactive
ResponsivenessNo issues