Skip to main content
Glama
Logseq MCP Server

Logseq MCP Server

by dailydaniel

Logseq MCP サーバー

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 (boolean): ページレベルのブロックとして作成する

    • before (boolean): 親ブロックの前に挿入

    • custom_uuid (文字列): ブロックのカスタムUUIDv4

  • logseq_edit_block - ブロック編集モードに入るパラメータ:

    • src_block (文字列、必須): ブロックUUID

    • pos (数値): カーソル位置

  • logseq_exit_editing_mode - 編集モードを終了するパラメータ:

    • select_block (boolean): ブロックを選択したままにする

ページ操作

  • logseq_create_page - 新しいページを作成するパラメータ:

    • page_name (文字列、必須): ページ名

    • properties (オブジェクト):ページのプロパティ

    • journal (ブール値): ジャーナルページとして作成

    • format (文字列):ページフォーマット(markdown/org)

  • logseq_get_page - ページの詳細を取得するパラメータ:

    • src_page (文字列、必須): ページ識別子

    • include_children (boolean): 子ブロックを含める

  • 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 Arguments に新しいブロックを作成します。

  • parent_block : 親ブロック参照(ページ名またはUUID)

  • content : ブロックコンテンツ

  • is_page_block : ページレベルのブロックの場合はtrueに設定する

ログシーケンス作成ページ

新しい Logseq ページを作成する引数:

  • page_name : ページの名前

  • properties : JSON としてのページプロパティ

  • journal : ジャーナルページの場合は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キー

  1. LogseqでAPIトークンを生成する: API → 認証トークン

  2. 環境変数を設定します:

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 tools
logseq_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

    B3.3/5.0

    Scored across 10 tools

    Disambiguation3/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A 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.
      69
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A 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.
      13
      15
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A 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.
      13
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables 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 npm
      7
      MIT