Logseq MCP Server
Logseq MCP 服务器
模型上下文协议 (MLM) 服务器,可与 Logseq 知识库直接集成。该服务器支持 LLM 与 Logseq 图表交互、创建页面、管理区块,并以编程方式组织信息。
与 Claude Desktop 一起使用
{
"mcpServers": {
"logseq": {
"command": "uvx",
"args": ["mcp-server-logseq"],
"env": {
"LOGSEQ_API_TOKEN": "<YOUR_KEY>",
"LOGSEQ_API_URL": "http://127.0.0.1:12315"
}
}
}
}如果出现错误,请使用0.0.1版本:
{
"mcpServers": {
"logseq": {
"command": "uvx",
"args": ["mcp-server-logseq==0.0.1"],
"env": {
"LOGSEQ_API_TOKEN": "<YOUR_KEY>",
"LOGSEQ_API_URL": "http://127.0.0.1:12315"
}
}
}
}Related MCP server: Logseq MCP Tools
可用工具
块操作
logseq_insert_block - 在 Logseq 中创建新块参数:
parent_block(字符串):父块 UUID 或页面名称content(字符串,必需):阻止内容is_page_block(布尔值):创建为页面级块before(布尔值):在父块之前插入custom_uuid(字符串):块的自定义 UUIDv4
logseq_edit_block - 进入块编辑模式参数:
src_block(字符串,必需):块 UUIDpos(数字):光标位置
logseq_exit_editing_mode - 退出编辑模式参数:
select_block(布尔值):保持块被选中
页面操作
logseq_create_page - 创建新页面参数:
page_name(字符串,必需):页面名称properties(对象):页面属性journal(布尔值):创建为日志页面format(字符串):页面格式(markdown/org)
logseq_get_page - 获取页面详细信息参数:
src_page(字符串,必需):页面标识符include_children(布尔值):包含子块
logseq_get_all_pages - 列出所有页面参数:
repo(字符串):存储库名称
内容检索
logseq_get_current_page - 获取活动页面/块参数:无
logseq_get_current_blocks_tree - 当前页面的块层次结构参数:无
logseq_get_editing_block_content - 获取活动块的内容参数:无
logseq_get_page_blocks_tree - 获取页面的块结构参数:
src_page(字符串,必需):页面标识符
提示
logseq_insert_block
在 Logseq参数中创建一个新块:
parent_block:父块引用(页面名称或 UUID)content:块内容is_page_block:对于页面级块设置为 true
logseq_create_page
创建一个新的 Logseq 页面参数:
page_name:页面名称properties:页面属性为 JSONjournal:对于日记页面,设置为 true
安装
使用 pip
pip install mcp-server-logseq从源头
git clone https://github.com/dailydaniel/logseq-mcp.git
cd logseq-mcp
cp .env.example .env
uv sync运行服务器:
python -m mcp_server_logseq配置
API 密钥
在 Logseq 中生成 API 令牌:API → 授权令牌
设置环境变量:
export LOGSEQ_API_TOKEN=your_token_here或者通过命令行传递:
python -m mcp_server_logseq --api-key=your_token_here图形配置
默认 URL: http://localhost:12315自定义:
python -m mcp_server_logseq --url=http://your-logseq-instance:port示例
创建会议记录页面
Create new page "Team Meeting 2024-03-15" with properties:
- Tags: #meeting #engineering
- Participants: Alice, Bob, Charlie
- Status: pending将任务块添加到现有页面
Add task to [[Project Roadmap]]:
- [ ] Finalize API documentation
- Due: 2024-03-20
- Priority: high使用第一个块创建日记帐分录
Create journal entry for today with initial content:
- Morning standup completed
- Started work on new authentication system调试
npx @modelcontextprotocol/inspector uv --directory . run mcp-server-logseq贡献
我们欢迎为增强 Logseq 集成做出贡献:
添加新的 API 端点(页面链接、查询支持)
提高区块操作能力
添加模板支持
增强错误处理
Available Tools
10 toolslogseq_create_pageB
Create a new page in Logseq with optional properties. Features: - Journal page creation with date formatting - Custom page properties (tags, status, etc.) - Format selection (Markdown/Org-mode) - Automatic first block creation Perfect for template-based page creation and knowledge management.
Inputs: page_name (required), create_first_block, format, journal, +1 more.
logseq_edit_blockC
Enter editing mode for a specific block
Inputs: src_block (required), pos.
logseq_exit_editing_modeC
Exit current editing mode
Inputs: select_block.
logseq_get_all_pagesC
List all pages in the graph with basic metadata
Inputs: repo.
logseq_get_current_pageB
Retrieves the currently active page or block in the user's workspace
Inputs: no named parameters.
logseq_get_current_page_contentB
Get hierarchical block structure of current page
Inputs: no named parameters.
logseq_get_editing_block_contentB
Get content of currently edited block
Inputs: no named parameters.
logseq_get_pageC
Retrieve detailed information about a specific page including metadata and content
Inputs: src_page (required), include_children.
logseq_get_page_contentC
Get block hierarchy for specific page
Inputs: src_page (required).
logseq_insert_blockA
Insert a new block into Logseq. Can create: - Page-level blocks (use is_page_block=true with page name as parent_block) - Nested blocks under existing blocks - Blocks with custom UUIDs for precise reference Supports before/after positioning and property management.
Inputs: content (required), before, custom_uuid, is_page_block, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
The tools have clear distinct purposes for core operations like creating pages, editing blocks, and retrieving content, but there is notable overlap between retrieval tools. Specifically, logseq_get_page and logseq_get_page_content both retrieve page details, and logseq_get_current_page_content and logseq_get_editing_block_content focus on current workspace content, which could cause confusion in selection. Descriptions help differentiate, but the boundaries are not perfectly distinct.
All tool names follow a consistent snake_case pattern with a 'logseq_' prefix, using clear verb_noun combinations such as create_page, edit_block, and get_all_pages. This uniformity makes the tools predictable and easy to parse, with no deviations in style or structure across the set.
With 10 tools, the count is well-scoped for a Logseq server, covering essential operations like page creation, editing, and content retrieval. Each tool serves a specific function without redundancy, fitting within the typical 3-15 range for such a domain, and no tools feel unnecessary or missing for basic interactions.
The tool set provides good coverage for core Logseq workflows, including CRUD-like operations for pages and blocks (create, get, edit, insert). However, there are minor gaps, such as no explicit tools for deleting pages or blocks, updating block content beyond editing mode, or managing properties post-creation, which agents might need to work around using existing tools.
Maintenance
Related MCP Connectors
Personal wiki and memory layer for AI assistants. Persistent, structured memory across sessions.
Shared long-term memory for AI agents: save and recall context as a searchable knowledge graph.
past.dev is a long-term memory API for AI agents. Send it timestamped text such as emails, meeting transcripts and support tickets. Ask a question and get the current fact, the value it replaced and the source behind it. With this server, your assistant can recall and save memory and manage your past.dev account.
Shared memory for AI agents, as a graph in your own Postgres. Writes never call an LLM.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA 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.69MIT
- AlicenseAqualityDmaintenanceA 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.1315MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables AI agents to interact with a local Logseq instance, allowing operations like creating pages, managing blocks, and searching across a knowledge graph.131MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with your local Logseq knowledge base through advanced search, content creation, template management, and knowledge organization with privacy-first, local-only operations.39 npm7MIT