The Logseq MCP Server enables programmatic interaction with Logseq graphs for knowledge management and organizational tasks.
Key capabilities include:
Page management: Create new pages (including journal pages) with custom properties, formats, and optional initial blocks
Block operations: Create, insert, edit, and manage blocks with custom UUIDs and positioning control
Content retrieval: Fetch page details, hierarchical block structures, and currently edited content
Navigation control: Enter/exit block editing mode with cursor position control
Graph exploration: List all pages in the graph, optionally filtering by repository
Active content access: Get information about the currently active page or block
This server serves as an API gateway for LLMs to directly interact with Logseq's knowledge base system.
Provides direct integration with Logseq's knowledge base, enabling interaction with Logseq graphs, creating pages, managing blocks, and organizing information programmatically.
Supports Markdown as a page format option when creating new pages in Logseq.
Supports Org format as a page format option when creating new pages in Logseq.
Logseq MCP Server
A Model Context Protocol server that provides direct integration with Logseq's knowledge base. This server enables LLMs to interact with Logseq graphs, create pages, manage blocks, and organize information programmatically.
Usage with Claude Desktop
If you have errors, use 0.0.1 version:
Available Tools
Block Operations
logseq_insert_block - Create new blocks in Logseq Parameters:
parent_block
(string): Parent block UUID or page namecontent
(string, required): Block contentis_page_block
(boolean): Create as page-level blockbefore
(boolean): Insert before parent blockcustom_uuid
(string): Custom UUIDv4 for block
logseq_edit_block - Enter block editing mode Parameters:
src_block
(string, required): Block UUIDpos
(number): Cursor position
logseq_exit_editing_mode - Exit editing mode Parameters:
select_block
(boolean): Keep block selected
Page Operations
logseq_create_page - Create new pages Parameters:
page_name
(string, required): Page nameproperties
(object): Page propertiesjournal
(boolean): Create as journal pageformat
(string): Page format (markdown/org)
logseq_get_page - Get page details Parameters:
src_page
(string, required): Page identifierinclude_children
(boolean): Include child blocks
logseq_get_all_pages - List all pages Parameters:
repo
(string): Repository name
Content Retrieval
logseq_get_current_page - Get active page/block Parameters: None
logseq_get_current_blocks_tree - Current page's block hierarchy Parameters: None
logseq_get_editing_block_content - Get content of active block Parameters: None
logseq_get_page_blocks_tree - Get page's block structure Parameters:
src_page
(string, required): Page identifier
Prompts
logseq_insert_block
Create a new block in Logseq Arguments:
parent_block
: Parent block reference (page name or UUID)content
: Block contentis_page_block
: Set true for page-level blocks
logseq_create_page
Create a new Logseq page Arguments:
page_name
: Name of the pageproperties
: Page properties as JSONjournal
: Set true for journal pages
Installation
Using pip
From source
Run the server:
Configuration
API Key
Generate API token in Logseq: API → Authorization tokens
Set environment variable:
Or pass via command line:
Graph Configuration
Default URL: http://localhost:12315 To customize:
Examples
Create meeting notes page
Add task block to existing page
Create journal entry with first block
Debugging
Contributing
We welcome contributions to enhance Logseq integration:
Add new API endpoints (page linking, query support)
Improve block manipulation capabilities
Add template support
Enhance error handling
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
A server that enables LLMs to programmatically interact with Logseq knowledge graphs, allowing creation and management of pages and blocks.
- Usage with Claude Desktop
- Available Tools
- Prompts
- Installation
- Configuration
- Examples
- Create meeting notes page
- Debugging
- Contributing
Related Resources
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server that provides AI assistants with structured access to your Logseq knowledge graph, enabling retrieval, searching, analysis, and creation of content within your personal knowledge base.Last updated -51
- -securityAlicense-qualityA Model Context Protocol server that enables LLMs to interact with GraphQL APIs by providing schema introspection and query execution capabilities.Last updated -3861MIT License
- -securityFlicense-qualityA Model Context Protocol server that enables LLMs to interact with GraphQL APIs by providing schema introspection and query execution capabilities.Last updated -0
- AsecurityAlicenseAqualityA Model Context Protocol server that enables AI agents to interact with local Logseq knowledge graphs, supporting operations like creating/editing pages and blocks, searching content, and managing journal entries.Last updated -1314MIT License