logseq-mcp-server

eborden/logseq-mcp-server

3.2

If you are the rightful owner of logseq-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The LogSeq MCP Server allows users to query LogSeq knowledge graphs via an HTTP API, providing a seamless integration with LogSeq's data.

LogSeq MCP Server

Turn your LogSeq knowledge graph into an AI-accessible database.

What This Does

Provides 12 MCP tools for Claude to traverse your LogSeq graph, track concepts over time, and build comprehensive context. Goes beyond basic search: understand relationships, discover connections, analyze temporal patterns.

Quick Start

  1. Enable LogSeq HTTP server (Settings → API → Enable HTTP server)
  2. Generate auth token in LogSeq
  3. Create ~/.logseq-mcp/config.json:
    {
      "apiUrl": "http://127.0.0.1:12315",
      "authToken": "your-token-here"
    }
    
  4. Install: npm install -g logseq-mcp-server
  5. Add to Claude Desktop MCP settings

12 Tools at a Glance

Basic Operations (5)

ToolPurpose
search_blocksFull-text search with optional semantic context
get_pageRetrieve page content with children
get_backlinksFind all references to a page
get_blockGet specific block by UUID
query_by_propertyFind blocks by property key/value

Graph Traversal (1)

ToolPurpose
get_concept_networkBuild network graph with nodes/edges

Semantic Search (1)

ToolPurpose
search_by_relationshipFind blocks based on topic relationships

Context Building (2)

ToolPurpose
build_contextGather comprehensive topic context in one call
get_context_for_queryParse natural language and build context

Temporal Queries (2)

ToolPurpose
query_by_date_rangeQuery journal entries by date
get_concept_evolutionTrack concept mentions over time (replaces get_entity_timeline)

Graph Information (1)

ToolPurpose
get_graph_infoGet current LogSeq graph information including filesystem path

Skills

Beyond individual tools, the logseq-skills provides structured workflows that combine multiple tools:

Available workflows:

  • Research Assistant - "What do I know about X?" - comprehensive topic research
  • Task Prioritization - "What should I work on?" - find and organize TODOs
  • Stale Task Detection - Find tasks with no recent activity
  • Weekly Summary - Generate structured summaries from journal entries
  • Graph Exploration - Discover connections between concepts
  • Temporal Analysis - Track how concepts evolved over time
  • Smart Context Building - Natural language queries with automatic context gathering

See .claude/skills/logseq-skills/ for complete workflow documentation.

Example Usage

"What do I know about React?"

Use: build_context("React")
Gets: Page + blocks + related pages + references + temporal context

"Show everything connected to Machine Learning"

Use: get_concept_network("Machine Learning", max_depth=2)
Gets: Network graph with nodes and edges

"How did my thinking on testing evolve this year?"

Use: get_concept_evolution("testing", 20250101, 20251231, group_by='month')
Gets: Timeline grouped by month showing pattern changes

"What was I working on last week?"

Use: query_by_date_range(20251114, 20251120)
Gets: All journal entries in date range

Development

npm install
npm run build
npm test
npm run test:integration  # Requires running LogSeq instance

Architecture

  • TypeScript MCP server using @modelcontextprotocol/sdk
  • LogSeq HTTP API client for graph queries
  • Vitest for unit and integration testing
  • TDD approach - all tools have comprehensive test coverage