ergut

MCP server for LogSeq

Community ergut
Updated

MCP server to interact with LogSeq via its Local HTTP API - enabling AI assistants like Claude to seamlessly read, write, and manage your LogSeq graph.

MCP server for LogSeq

MCP server to interact with LogSeq via its API. Enables Claude to read, create, and manage LogSeq pages through a comprehensive set of tools.

โœจ What You Can Do

Transform your LogSeq knowledge base into an AI-powered workspace! This MCP server enables Claude to seamlessly interact with your LogSeq graphs.

๐ŸŽฏ Real-World Examples

๐Ÿ“Š Intelligent Knowledge Management

"Analyze all my project notes from the past month and create a status summary"
"Find pages mentioning 'machine learning' and create a study roadmap"
"Search for incomplete tasks across all my pages"

๐Ÿ“ Automated Content Creation

"Create a new page called 'Today's Standup' with my meeting notes"
"Add today's progress update to my existing project timeline page"  
"Create a weekly review page from my recent notes"

๐Ÿ” Smart Research & Analysis

"Compare my notes on React vs Vue and highlight key differences"
"Find all references to 'customer feedback' and summarize themes"
"Create a knowledge map connecting related topics across pages"

๐Ÿค Meeting & Documentation Workflow

"Read my meeting notes and create individual task pages for each action item"
"Get my journal entries from this week and create a summary page"
"Search for 'Q4 planning' and organize all related content into a new overview page"

๐Ÿ’ก Key Benefits

  • Zero Context Switching: Claude works directly with your LogSeq data
  • Preserve Your Workflow: No need to export or copy content manually
  • Intelligent Organization: AI-powered page creation, linking, and search
  • Enhanced Productivity: Automate repetitive knowledge work

๐Ÿš€ Quick Start

Step 1: Enable LogSeq API

  1. Settings โ†’ Features โ†’ Check "Enable HTTP APIs server"
  2. Click the API button (๐Ÿ”Œ) in LogSeq โ†’ "Start server"
  3. Generate API token: API panel โ†’ "Authorization tokens" โ†’ Create new

Step 2: Add to Claude (No Installation Required!)

Claude Code
claude mcp add mcp-logseq \
  --env LOGSEQ_API_TOKEN=your_token_here \
  --env LOGSEQ_API_URL=http://localhost:12315 \
  -- uv run --with mcp-logseq mcp-logseq
Claude Desktop

Add to your config file (Settings โ†’ Developer โ†’ Edit Config):

{
  "mcpServers": {
    "mcp-logseq": {
      "command": "uv",
      "args": ["run", "--with", "mcp-logseq", "mcp-logseq"],
      "env": {
        "LOGSEQ_API_TOKEN": "your_token_here",
        "LOGSEQ_API_URL": "http://localhost:12315"
      }
    }
  }
}

Step 3: Start Using!

"Please help me organize my LogSeq notes. Show me what pages I have."

๐Ÿ› ๏ธ Available Tools

The server provides 6 comprehensive tools:

Tool Purpose Example Use
list_pages Browse your graph "Show me all my pages"
get_page_content Read page content "Get my project notes"
create_page Add new pages "Create a meeting notes page"
update_page Modify existing pages "Update my task list"
delete_page Remove pages "Delete the old draft page"
search Find content across graph "Search for 'productivity tips'"

โš™๏ธ Prerequisites

LogSeq Setup

  • LogSeq installed and running
  • HTTP APIs server enabled (Settings โ†’ Features)
  • API server started (๐Ÿ”Œ button โ†’ "Start server")
  • API token generated (API panel โ†’ Authorization tokens)

System Requirements

  • uv Python package manager
  • MCP-compatible client (Claude Code, Claude Desktop, etc.)

๐Ÿ”ง Configuration

Environment Variables

  • LOGSEQ_API_TOKEN (required): Your LogSeq API token
  • LOGSEQ_API_URL (optional): Server URL (default: http://localhost:12315)

Alternative Setup Methods

Using .env file
# .env
LOGSEQ_API_TOKEN=your_token_here
LOGSEQ_API_URL=http://localhost:12315
System environment variables
export LOGSEQ_API_TOKEN=your_token_here
export LOGSEQ_API_URL=http://localhost:12315

๐Ÿ” Verification & Testing

Test LogSeq Connection

uv run --with mcp-logseq python -c "
from mcp_logseq.logseq import LogSeq
api = LogSeq(api_key='your_token')
print(f'Connected! Found {len(api.list_pages())} pages')
"

Verify MCP Registration

claude mcp list  # Should show mcp-logseq

Debug with MCP Inspector

npx @modelcontextprotocol/inspector uv run --with mcp-logseq mcp-logseq

๐Ÿ› Troubleshooting

Common Issues

"LOGSEQ_API_TOKEN environment variable required"
  • โœ… Enable HTTP APIs in Settings โ†’ Features
  • โœ… Click ๐Ÿ”Œ button โ†’ "Start server" in LogSeq
  • โœ… Generate token in API panel โ†’ Authorization tokens
  • โœ… Verify token in your configuration
"spawn uv ENOENT" (Claude Desktop)

Claude Desktop can't find uv. Use the full path:

which uv  # Find your uv location

Update config with full path:

{
  "mcpServers": {
    "mcp-logseq": {
      "command": "/Users/username/.local/bin/uv",
      "args": ["run", "--with", "mcp-logseq", "mcp-logseq"],
      "env": { "LOGSEQ_API_TOKEN": "your_token_here" }
    }
  }
}

Common uv locations:

  • Curl install: ~/.local/bin/uv
  • Homebrew: /opt/homebrew/bin/uv
  • Pip install: Check with which uv
Connection Issues
  • โœ… Confirm LogSeq is running
  • โœ… Verify API server is started (not just enabled)
  • โœ… Check port 12315 is accessible
  • โœ… Test with verification command above

๐Ÿ‘ฉโ€๐Ÿ’ป Development

For local development, testing, and contributing, see DEVELOPMENT.md.

Ready to supercharge your LogSeq workflow with AI?

โญ Star this repo if you find it helpful!

MCP Server ยท Populars

MCP Server ยท New

    apify

    mcp.apify.com

    Apify MCP server (tools for web scraping, data extraction, and automation)

    Community apify
    ergut

    MCP server for LogSeq

    MCP server to interact with LogSeq via its Local HTTP API - enabling AI assistants like Claude to seamlessly read, write, and manage your LogSeq graph.

    Community ergut
    call518

    MCP PostgreSQL Operations Server

    Professional, read-only MCP server for PostgreSQL ops/monitoring: performance insights using pg_stat_statements & pg_stat_monitor, plus structure/size/config visibility.

    Community call518
    pulsemcp

    Hatchbox MCP Server

    MCP (Model Context Protocol) Servers authored and maintained by the PulseMCP team. We build reliable servers thoughtfully designed specifically for MCP Client-powered workflows.

    Community pulsemcp
    snyk

    Getting started with the Snyk CLI

    Snyk CLI scans and monitors your projects for security vulnerabilities.

    Community snyk