Logseq MCP Server

Logseq MCP Server

Enables AI assistants like Claude to directly read, write, search, and navigate your local Logseq knowledge graph, including managing journals, pages, backlinks, and page relationships without manual copy-pasting.

Category
访问服务器

README

Logseq MCP Server

License: Polyform Noncommercial Node.js MCP

Let AI read and write your Logseq graph directly via MCP

한국어 README

Talk to Claude and say "add this to today's journal", "find what I did last week", "show me all pages linked to this one" - and it just works.


Why This?

Problem: Logseq is a great PKM tool, but integrating with AI assistants requires constant copy-pasting.

Solution: With this MCP server:

  • Claude directly writes to your journal (no copy-paste)
  • Search and summarize past entries (maintain context)
  • Navigate connections between pages (backlinks, graph)
  • Auto-generate daily journals with templates
You: "Summarize today's meeting notes and add them to my journal"
Claude: [writes directly to Logseq via logseq-mcp]
        "Done! Added to today's journal. Anything else?"

Is This For You?

Good fit if you...

  • Use Logseq as your primary PKM
  • Use Claude Code or Claude Desktop regularly
  • Want to delegate note management to AI
  • Use local file-based Logseq (not Logseq Sync)

Not for you if...

  • Using Logseq Sync (requires local file access)
  • Obsidian user (different MCP server needed)
  • Have sensitive info in notes and uncomfortable with AI access
  • Use org-mode instead of Markdown (not yet supported)

Features

Feature Description
Page CRUD Create, read, update, delete pages + property support
Search Full-text search + tag/folder filtering
Graph Navigation Links, backlinks, page relationship traversal
Journal Access today's/specific date journals + templates
Content Logging Log articles, books, movies, exhibitions to journal
Resources Expose graph pages as MCP resources

Quick Start

1. Install

git clone https://github.com/dearcloud09/logseq-mcp.git
cd logseq-mcp
npm install
npm run build

2. Configure

Claude Code (~/.claude/settings.json):

{
  "mcpServers": {
    "logseq": {
      "command": "node",
      "args": ["/path/to/logseq-mcp/dist/index.js"],
      "env": {
        "LOGSEQ_GRAPH_PATH": "/path/to/your/logseq/graph"
      }
    }
  }
}

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "logseq": {
      "command": "node",
      "args": ["/path/to/logseq-mcp/dist/index.js"],
      "env": {
        "LOGSEQ_GRAPH_PATH": "/path/to/your/logseq/graph"
      }
    }
  }
}

3. Verify

Ask Claude: "Show me my Logseq page list"


Available Tools

Tool Description
list_pages List all pages with metadata (tags, links, backlinks)
read_page Read page content and metadata
create_page Create new page (with property support)
update_page Update page content
delete_page Delete a page
append_to_page Append content to existing page
search_pages Search by content/title + tag/folder filters
get_backlinks Get pages that reference a specific page
get_graph Get page connection graph data
get_journal Get today's or specific date's journal
create_journal Create journal with optional template
add_article Add article to journal (title, summary, tags, URL, highlights)
add_book Add book to journal (title, author, tags, memo)
add_movie Add movie to journal (title, director, memo)
add_exhibition Add exhibition to journal (title, venue, artist, memo)

Usage Examples

"Show me today's journal"
"Add this content to 'Project A' page: ..."
"Find all pages with #meeting tag"
"What pages are connected to my Goals page?"
"Search for TODO items in last week's journals"
"Create a new page called 'Reading List'"
"Summarize our conversation and save it as an article in my journal"

Logseq Graph Structure

your-graph/
  journals/     # Daily journals (2024_01_15.md format)
  pages/        # Regular pages
  logseq/       # Logseq settings
  whiteboards/  # Whiteboards

Security

  • Path traversal protection (graph-only access)
  • Symlink/hardlink attack prevention
  • Input validation and sanitization
  • DoS protection (content size limits)
  • Error message sanitization

Troubleshooting

"LOGSEQ_GRAPH_PATH environment variable is required"

Set LOGSEQ_GRAPH_PATH in your configuration file.

MCP server not recognized by Claude

  1. Restart Claude Code/Desktop
  2. Verify path is absolute (/Users/... format)
  3. Ensure npm run build was executed

Pages not showing up

  • Check if .md files exist in journals/ or pages/
  • Verify you're using local graph (not Logseq Sync)

org-mode files not reading

Currently Markdown only. org-mode support planned for future.


Korean-Specific Features

This project includes features optimized for Korean users:

Daily Automation (Optional)

Auto-generate daily journal with weather (Korea only - uses Naver Weather) and diary template:

LOGSEQ_GRAPH_PATH=/path/to/logseq WEATHER_LOCATION=서울 node add-today-dairy.js

See Korean README for detailed setup with launchd automation.

Cultural Content Structure

add_book, add_movie, add_exhibition tools use Korean wikilink structure ([[문화]]). Customize the templates in src/index.ts for your language.


Development

# Development mode (watch)
npm run dev

# TypeScript build
npm run build

# Production run
npm start

Project Structure

src/
  index.ts    # MCP server entry point, tool handlers
  types.ts    # TypeScript type definitions
  graph.ts    # Graph filesystem operations

Contributing

Issues and PRs welcome!

  1. Fork this repo
  2. Create feature branch (git checkout -b feature/amazing)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing)
  5. Open a Pull Request

Ideas for contribution

  • [ ] org-mode support
  • [ ] Logseq property search
  • [ ] Whiteboard support
  • [ ] Better graph visualization data
  • [ ] i18n for templates

License

Polyform Noncommercial 1.0.0 - Free for personal and noncommercial use.


Related

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选