
MCP 磁共振 用于与 LogSeq 图表交互的服务器
概览
这个项目提供了一套模型背景协议(MCP)工具,使AI代理能够与您本地的Logseq实例互动. 1. 确保 Python 3.11+ 安装 2. Clone 此寄存器 3. 安装依赖性: 1. 确定您的日志已启用 API 。 - 在日志中,请访问设置 > 高级 > 开发者模式 > 启用开发者模式 - 然后,转到插件 > 打开 Logseq 开发者插件 - 另在高级设置中设置 API 令牌 - 重新启动 Logseq 2. 在您的 Cursor MCP 配置文件中配置 MCP 服务器( 通常为 ~/. cursor/ mcp.json): OR 3. 配置 Claude 代码以使用 MCP 服务器: - 选择范围 - 选择 Stdio - LOGSE- API URL= [[T0] LOGSE- TOKEN=您在这里的托肯/opt/homebrew/bin/uvx logseq-mcp 1. 配置上所显示的 MCP 服务器 2. 打开光标并进入 MCP 面板(侧边栏)
概述(AI 翻译)
这个项目提供了一套模型背景协议(MCP)工具,使AI代理能够与您本地的Logseq实例互动.
□ 安装
- 确保安装 Python 3.11+
- 克隆此存储器
- 安装依赖:
□ 设置
- 确定您的日志已启用 API 。
- 在日志中,请访问设置 > 高级 > 开发者模式 > 启用开发者模式
- 然后,转到插件 > 打开日志开发者插件
- 在高级设置中设置 API 令牌
- 重新启动日志
- 在您的 Cursor MCP 配置文件中配置 MCP 服务器( 通常在 [[T0] ) :
或
- 配置 Claude 代码以使用 MCP 服务器:
- 选择范围
- 选择斯特迪奥
- [[T1]
□ 用克苏和克劳德
QQ 添加到光标的 MCP 工具
-
配置上所显示的 MCP 服务器
-
打开光标并进入 MCP 面板(侧边栏)
-
Logseq 工具应出现在您可用的工具列表中
使用克劳德
在 Cursor 中使用 Claude 时,您需要告知它您有类似 :
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Logseq MCP Tools
This project provides a set of Model Context Protocol (MCP) tools that enable AI agents to interact with your local Logseq instance.
Installation
- Ensure you have Python 3.11+ installed
- Clone this repository
- Install dependencies:
pip install -e .
Setup
-
Make sure your Logseq has the API enabled.
- In Logseq, go to Settings > Advanced > Developer mode > Enable Developer mode
- Then, go to Plugins > Turn on Logseq Developer Plugin
- Also set an API token in the Advanced settings
- Restart Logseq
-
Configure the MCP server in your Cursor MCP configuration file (typically at
~/.cursor/mcp.json):{ "mcpServers": { "logseq": { "command": "/opt/homebrew/bin/uvx", "args": ["logseq-mcp"], "env": { "LOGSEQ_API_URL": "http://localhost:12315", "LOGSEQ_TOKEN": "your-token-here" } } } }
OR
- Configure Claude Code to use the MCP server with:
claude mcp add
- Select scope
- Select Stdio
LOGSEQ_API_URL=http://localhost:12315 LOGSEQ_TOKEN=your-token-here /opt/homebrew/bin/uvx logseq-mcp
Using with Cursor and Claude
Adding to Cursor’s MCP Tools
-
Configure the MCP server as shown above in the Setup section
-
Open Cursor and go to the MCP panel (sidebar)
-
The Logseq tool should appear in your list of available tools
Using with Claude
When using Claude in Cursor, you’ll need to inform it that you have Logseq tools available with a prompt similar to:
“You have access to Logseq tools that can help you interact with my Logseq graph. You can use functions like logseq.get_all_pages(), logseq.get_page(name), logseq.create_page(name), etc.”
Available Tools
All tools are available under the logseq namespace:
Pages
logseq.get_all_pages: Get a list of all pages in the Logseq graphlogseq.get_page: Get a specific page by namelogseq.create_page: Create a new pagelogseq.delete_page: Delete a page and all its blocks
Blocks
logseq.get_page_blocks: Get all blocks from a specific pagelogseq.get_block: Get a specific block by IDlogseq.create_block: Create a new block on a pagelogseq.insert_block: Insert a block as a child of another blocklogseq.update_block: Update an existing blocklogseq.move_block: Move a block to a different locationlogseq.remove_block: Remove a block and all its childrenlogseq.search_blocks: Search for blocks matching a query
Working with Logseq
Journal Pages
Journal pages in Logseq have a specific format and attributes:
- Use the format “mmm dth, yyyy” (e.g., “Apr 4th, 2025”) when creating or accessing journal pages
- Journal pages are automatically formatted by Logseq with proper dating
- Journal pages have special attributes that are automatically set by Logseq:
journal?: true - Indicates this is a journal page
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"logseq": {
"command": "/opt/homebrew/bin/uvx",
"args": ["logseq-mcp"],
"env": {
"LOGSEQ_API_URL": "http://localhost:12315",
"LOGSEQ_TOKEN": "your-token-here"
}
}
}
}