by ergut
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.
# Add to your Claude Code skills
git clone https://github.com/ergut/mcp-logseqTransform your LogSeq knowledge base into an AI-powered workspace! This MCP server enables Claude to seamlessly interact with your LogSeq graphs.
๐ 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"
๐ง Semantic Search (optional, requires vector setup)
"Find everything I wrote about burnout, even if I didn't use that word"
"What notes relate to my thoughts on deep work?"
"Search across my Dutch and English notes for ideas about productivity"
๐ค 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"
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
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"
}
}
}
}
"Please help me organize my LogSeq notes. Show me what pages I have."
Semantic search over your Logseq graph using local AI embeddings โ find notes by meaning, not just keywords. Searches across all your pages using vector similarity and full-text search combined, with cross-language support.
Powered by Ollama (local embeddings) and LanceDB (embedded vector DB). No data leaves your machine.
โ Full setup guide: VECTOR_SEARCH.md
The server provides 16 tools with intelligent markdown parsing, plus 3 optional vector search 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 with structured blocks | "Create a meeting notes page with agenda items" |
| update_page | Modify pages (append/replace modes) | "Update my task list" |
| delete_page | Remove pages | "Delete the old draft page" |
| delete_block | Remove a block by UUID | "Delete this specific block" |
| update_block | Edit block content by UUID | "Update this specific block text" |
| search | Find content across graph | "Search for 'productivity tips'" |
| query | Execute Logseq DSL queries | "Find all TODO tasks tagged #project" |
| find_pages_by_property | Search pages by property | "Find all pages with status = active" |
| get_pages_from_namespace | List pages in a namespace | "Show all pages under Customer/" |
| get_pages_tree_from_namespace | Hierarchical namespace view | "Show Projects/ as a tree" |
| rename_page | Rename with reference updates | "Rename 'Old Name' to 'New Name'" |
| get_page_backlinks | Find pages linking to a page | "What links to this page?" |
| insert_nested_block | Insert child/sibling blocks | "Add a child block under this task" |
| set_block_properties | Set DB-mode class properties on a block | "Set the status of this block to active" (DB-mode only) |
| vector_search โ๏ธ | Semantic search by meaning | "Find notes about shadow work or Jung" |
| sync_vector_db โ๏ธ | Sync vector DB with graph files | "Update the search index" |
| vector_db_status โ๏ธ | Show vector DB health and staleness | "Is my search index up to date?" |
โ๏ธ Requires vector search setup โ see VECTOR_SEARCH.md
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`)
- **`LOGSEQ_DB_MODE`** (optional): Set to `true` to enable DB-mode property support. Only for Logseq DB-mode graphs (beta). Markdown/file-based graph users should leave this unset.
- **`LOGSEQ_EXCLUDE_TAGS`** (optional): Comma-separated tags โ pages with these tags are hidden from all tools. See [Privacy & Access Control](#-privacy--access-control) below.
### Privacy & Access Control
Pages tagged with excluded tags are completely hidden from AI โ they won't appear in listings, searches, or queries, and attempting to read them directly returns an access-denied error.
**Quick setup via env var:**
```bash
LOGSEQ_EXCLUDE_TAGS=private,secret
Via config file (also used for vector search):
{
"logseq_graph_path": "/path/to/your/logseq/pages",
"exclude_tags": ["private", "secret"]
}
Point to it with LOGSEQ_CONFIG_FILE=/path/to/config.json.
In your Logseq pages, tag any page you want to protect:
tags:: private
The exclusion applies to all tools: list_pages, get_page_content, search, query, and the optional vector search. If you also use vector search, exclude_tags at the root is automatically merged into the vector index exclusion list โ private pages are never embedded.
# .env
LOGSEQ_API_TOKEN=your_token_here
LOGSEQ_API_URL=http://localhost:12315
export LOGSEQ_API_TOKEN=your_token_here
export LOGSEQ_API_URL=http://localhost:12315
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')
"
claude mcp list # Should show mcp-logseq
npx @modelcontextprotocol/inspector uv run --with mcp-logseq mcp-logseq
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:
~/.local/bin/uv/opt/homebrew/bin/uvwhich uvNo comments yet. Be the first to share your thoughts!