The MCP server for LogSeq enables Claude to programmatically interact with LogSeq graphs via its API, providing comprehensive knowledge management and automation capabilities.
Core Functions:
Create Pages: Generate new pages by specifying title and content
List Pages: Retrieve all pages in your graph, with optional inclusion of journal/daily notes
Read Page Content: Access and read content from specific pages
Update Pages: Modify existing page content
Delete Pages: Remove unwanted pages from your graph
Search Content: Find specific content across your entire LogSeq graph
AI-Powered Workflows: Automate tasks like summarizing notes, organizing content, and generating new pages based on existing data for enhanced knowledge management.
Allows interaction with LogSeq via its API, including listing graphs and pages, getting, creating, updating, and deleting pages, and searching content across all pages
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP server for LogSeqcreate a new page for today's meeting notes and link it to the project overview"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
β¨ 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
Related MCP server: SQLite MCP Server
π Quick Start
Step 1: Enable LogSeq API
Settings β Features β Check "Enable HTTP APIs server"
Click the API button (π) in LogSeq β "Start server"
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-logseqClaude 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 14 tools with intelligent markdown parsing:
Tool | Purpose | Example Use |
| Browse your graph | "Show me all my pages" |
| Read page content | "Get my project notes" |
| Add new pages with structured blocks | "Create a meeting notes page with agenda items" |
| Modify pages (append/replace modes) | "Update my task list" |
| Remove pages | "Delete the old draft page" |
| Remove a block by UUID | "Delete this specific block" |
| Find content across graph | "Search for 'productivity tips'" |
| Execute Logseq DSL queries | "Find all TODO tasks tagged #project" |
| Search pages by property | "Find all pages with status = active" |
| List pages in a namespace | "Show all pages under Customer/" |
| Hierarchical namespace view | "Show Projects/ as a tree" |
| Rename with reference updates | "Rename 'Old Name' to 'New Name'" |
| Find pages linking to a page | "What links to this page?" |
| Insert child/sibling blocks | "Add a child block under this task" |
π¨ Smart Markdown Parsing (v1.1.0+)
The create_page and update_page tools now automatically convert markdown into Logseq's native block structure:
Markdown Input:
---
tags: [project, active]
priority: high
---
# Project Overview
Introduction paragraph here.
## Tasks
- Task 1
- Subtask A
- Subtask B
- Task 2
## Code Example
```python
def hello():
print("Hello Logseq!")
**Result:** Creates properly nested blocks with:
- β
Page properties from YAML frontmatter (`tags`, `priority`)
- β
Hierarchical sections from headings (`#`, `##`, `###`)
- β
Nested bullet lists with proper indentation
- β
Code blocks preserved as single blocks
- β
Checkbox support (`- [ ]` β TODO, `- [x]` β DONE)
**Update Modes:**
- **`append`** (default): Add new content after existing blocks
- **`replace`**: Clear page and replace with new content
---
## βοΈ 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](https://docs.astral.sh/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
```bash
# .env
LOGSEQ_API_TOKEN=your_token_here
LOGSEQ_API_URL=http://localhost:12315System 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-logseqDebug 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 locationUpdate 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/uvHomebrew:
/opt/homebrew/bin/uvPip 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.