Skip to main content
Glama
mickm3n

Roam Research MCP Server

by mickm3n

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

Related MCP server: MCP Memory Server

Installation

Prerequisites

  • Python 3.11+

  • uv package manager

  • Roam Research API token and graph access

Setup

  1. Clone the repository:

git clone <repository-url>
cd roam-research-mcp
  1. Install dependencies:

uv sync
  1. Set up environment variables:

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

{
  "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 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

Available Tools

4 tools
get_page_contentA

Get the complete content of a specific page in Roam Research with all nested child blocks.

Retrieves all blocks on the specified page with their hierarchical structure,
including nested children up to 5 levels deep. Returns content in markdown format
with proper indentation to reflect the block hierarchy.

Args:
    page_name: Exact name of the page to retrieve (case-sensitive)
    
Returns:
    JSON string containing:
    - result: Array of blocks with content and timestamps
    - Each block includes: content (markdown), timestamp (edit time)
    
Examples:
    get_page_content("Daily Notes")
    get_page_content("Project Planning")
    get_page_content("信用卡")
ParametersJSON Schema
NameRequiredDescriptionDefault
page_nameYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key traits: it's a read operation (implied by 'Get'), specifies depth limits ('up to 5 levels deep'), output format ('markdown format with proper indentation'), and includes examples. It lacks details on error handling or rate limits, but covers essential behavior for a retrieval tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose, followed by details on behavior, parameters, returns, and examples. Each sentence adds value without redundancy, making it efficient and easy for an agent to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (1 parameter, no annotations, but with output schema), the description is complete. It covers purpose, usage context, behavioral traits, parameter semantics, and includes examples. The output schema handles return values, so the description appropriately focuses on other aspects without redundancy.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, so the description must fully compensate. It adds significant meaning beyond the schema by explaining the parameter 'page_name' as 'Exact name of the page to retrieve (case-sensitive)', providing clarity on format and constraints that the schema alone does not include.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get the complete content'), resource ('a specific page in Roam Research'), and scope ('with all nested child blocks'). It distinguishes from siblings like 'get_page_references' (which likely gets references rather than content), 'write_to_page' (which modifies rather than retrieves), and 'write_to_today' (which writes to a specific page).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by specifying the tool retrieves content from a page, which contrasts with writing tools ('write_to_page', 'write_to_today') and a references tool ('get_page_references'). However, it does not explicitly state when to use this tool versus alternatives or provide exclusions, leaving some ambiguity for the agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_page_referencesA

Get all blocks that reference a specific page in Roam Research with pagination support.

Finds all blocks across your Roam database that contain links to the specified page.
Results are sorted by most recent edit time and include the full hierarchical context
of each referencing block.

Args:
    page_name: Exact name of the page to find references for (case-sensitive)
    limit: Maximum number of references to return per request (default: 10)
    cursor: Timestamp cursor for pagination - use next_cursor from previous response
           to get additional results
           
Returns:
    JSON string containing:
    - result: Array of referencing blocks with content and timestamps  
    - next_cursor: Timestamp for pagination (if more results available)
    - total_matches: Number of references found in this batch
    
Examples:
    get_page_references("GTD")
    get_page_references("Project Alpha", limit=20)
    get_page_references("Meeting Notes", limit=5, cursor=1640995200000)
ParametersJSON Schema
NameRequiredDescriptionDefault
page_nameYes
limitNo
cursorNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: pagination mechanism (cursor-based), sorting (by most recent edit time), inclusion of hierarchical context, and the JSON return structure. It doesn't mention rate limits, authentication needs, or error conditions, but covers the core operational behavior well.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose. Every sentence adds value: explains what it finds, how results are sorted, parameter details, return format, and examples. No wasted words while maintaining clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (pagination, hierarchical context), no annotations, and the presence of an output schema, the description provides excellent completeness. It explains the pagination mechanism, sorting behavior, return structure, and includes practical examples. The output schema handles return value details, so the description appropriately focuses on operational context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must fully compensate. It provides excellent parameter semantics: explains page_name is case-sensitive, limit is maximum per request with default, and cursor is for pagination with specific usage instructions. This adds substantial meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get all blocks that reference a specific page'), resource ('Roam Research'), and scope ('with pagination support'). It distinguishes this from siblings like get_page_content (which retrieves page content rather than references) and write tools by focusing on reference discovery.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool (finding blocks that link to a specific page) and implies usage through examples. However, it doesn't explicitly state when NOT to use it or name specific alternatives among siblings, though the purpose differentiation is strong enough to guide selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

write_to_pageA

Write hierarchical markdown content to a specific page in Roam Research.

Creates a new block structure on the specified page with automatic indentation
detection. Supports nested bullet points and maintains proper parent-child
relationships between blocks. Content is appended to the end of the page.

Args:
    page_name: Exact name of the target page (case-sensitive, must exist)
    content: Hierarchical markdown content using '- ' prefix and indentation
            Format: "- Main topic
- Subtopic
    - Details"
            Supports any indentation level with automatic detection
            
Returns:
    JSON string containing:
    - result: "success" if completed
    - blocks_created: Total number of blocks created (including children)
    - details: Array of individual block creation results
    
Examples:
    write_to_page("Project Notes", "- New milestone
- Task 1
- Task 2")
    write_to_page("信用卡", "- [[銀行/國泰]]
- 現金回饋 2%")
ParametersJSON Schema
NameRequiredDescriptionDefault
page_nameYes
contentYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure and does so effectively. It explains that content is appended to the end of the page, describes automatic indentation detection, maintains parent-child relationships, and specifies that the page must already exist (case-sensitive). It also provides return format details, though an output schema exists.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, args, returns, examples) and front-loads the core functionality. While comprehensive, some sentences could be more concise, and the formatting example within the content parameter description is slightly verbose but still informative.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (hierarchical content creation), no annotations, and 0% schema coverage, the description provides complete context. It covers purpose, usage, parameters, return values (even with output schema), and includes practical examples. The description fully compensates for the lack of structured metadata.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description fully compensates by providing detailed parameter semantics. It explains that page_name must be exact and case-sensitive, that content uses hierarchical markdown with '- ' prefix and indentation, provides specific formatting examples, and describes automatic indentation detection. This adds substantial value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('write hierarchical markdown content'), target resource ('specific page in Roam Research'), and distinguishes from siblings by focusing on content creation rather than retrieval (get_page_content, get_page_references) or date-specific writing (write_to_today). It provides a complete verb+resource+scope statement in the first sentence.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool (writing hierarchical content to existing pages) and implicitly distinguishes from siblings through its focus on content creation. However, it doesn't explicitly state when NOT to use it or name specific alternatives for different scenarios beyond the sibling tool names provided separately.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

write_to_todayA

Write hierarchical markdown content to today's daily page in Roam Research.

Automatically creates today's daily page if it doesn't exist, then adds the
provided content as a hierarchical block structure. Uses Roam's standard
date format (e.g., "July 28, 2025") and maintains proper block relationships.

Args:
    content: Hierarchical markdown content using '- ' prefix and indentation
            Format: "- Main topic
- Subtopic
    - Details"
            Supports any indentation level with automatic detection
            
Returns:
    JSON string containing:
    - result: "success" if completed
    - blocks_created: Total number of blocks created (including children) 
    - details: Array of individual block creation results
    
Examples:
    write_to_today("- Daily standup
- Completed: Bug fixes
- Next: Feature review")
    write_to_today("- [[會議/週會]]
- 參與者: @John, @Mary
- 議題: Q4 規劃")
ParametersJSON Schema
NameRequiredDescriptionDefault
contentYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: it automatically creates the page if missing, uses Roam's standard date format, maintains block relationships, and describes the return structure. It doesn't mention error conditions, rate limits, or authentication requirements, but provides substantial operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, behavior, args, returns, examples) and every sentence adds value. It's appropriately sized for a tool with one parameter but complex behavior, with no redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (automatic page creation, hierarchical content processing) and the presence of an output schema, the description provides excellent context. It explains the tool's behavior, parameter requirements, return structure, and includes practical examples, making it complete enough for effective use despite having no annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage for its single parameter, but the description comprehensively explains the 'content' parameter with format details, examples, and hierarchical structure requirements. It adds significant value beyond the bare schema by specifying the markdown format, indentation rules, and providing concrete examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('write hierarchical markdown content', 'automatically creates today's daily page') and identifies the target resource ('today's daily page in Roam Research'). It distinguishes from sibling tools like 'write_to_page' by specifying the date-specific nature of this operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool (for writing to today's daily page in Roam Research) and implicitly distinguishes it from 'write_to_page' which likely writes to arbitrary pages. However, it doesn't explicitly state when NOT to use this tool or mention alternatives like 'get_page_content' for reading operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updates
    • First observedget_page_content
    • First observedget_page_references
    • First observedwrite_to_page
    • First observedwrite_to_today

TDQS

A4.5/5.0
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
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server for Claude Desktop that provides structured memory management across chat sessions, allowing Claude to maintain context and build a knowledge base within project directories.
    22
    6
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that provides comprehensive access to Obsidian vaults with Claude.ai remote integration, Tailscale support, and advanced query capabilities.
    5,784
    35
    Apache 2.0

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mickm3n/roam-research-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server