Skip to main content

An MCP server for LogSeq API

Project description

Logseq MCP Server

A Model Context Protocol server that provides direct integration with Logseq's knowledge base. This server enables LLMs to interact with Logseq graphs, create pages, manage blocks, and organize information programmatically.

Available Tools

logseq_insert_block - Creates new blocks in Logseq

Parameters:

  • parent_block (string, optional): UUID or content of parent block/page
  • content (string, required): Block content in Markdown/Org format
  • is_page_block (boolean, optional): Create as page-level block (default: false)
  • before (boolean, optional): Insert before parent block (default: false)
  • custom_uuid (string, optional): Custom UUIDv4 for the block

logseq_create_page - Creates new pages with properties

Parameters:

  • page_name (string, required): Name of the page to create
  • properties (object, optional): Page properties as key-value pairs
  • journal (boolean, optional): Create as journal page (default: false)
  • format (string, optional): Page format - "markdown" or "org" (default: "markdown")
  • create_first_block (boolean, optional): Create initial empty block (default: true)

Prompts

logseq_insert_block

Create a new block in Logseq Arguments:

  • parent_block: Parent block reference (page name or UUID)
  • content: Block content
  • is_page_block: Set true for page-level blocks

logseq_create_page

Create a new Logseq page Arguments:

  • page_name: Name of the page
  • properties: Page properties as JSON
  • journal: Set true for journal pages

Installation

Using pip

todo: add to pypi

From source

git clone https://github.com/dailydaniel/logseq-mcp.git
cd logseq-mcp
cp .env.example .env
uv sync

Run the server:

python -m mcp_server_logseq

Configuration

API Key

  1. Generate API token in Logseq: API → Authorization tokens
  2. Set environment variable:
export LOGSEQ_API_TOKEN=your_token_here

Or pass via command line:

python -m mcp_server_logseq --api-key=your_token_here

Graph Configuration

Default URL: http://localhost:12315 To customize:

python -m mcp_server_logseq --url=http://your-logseq-instance:port

Examples

Create meeting notes page

Create new page "Team Meeting 2024-03-15" with properties:
- Tags: #meeting #engineering
- Participants: Alice, Bob, Charlie
- Status: pending

Add task block to existing page

Add task to [[Project Roadmap]]:
- [ ] Finalize API documentation
- Due: 2024-03-20
- Priority: high

Create journal entry with first block

Create journal entry for today with initial content:
- Morning standup completed
- Started work on new authentication system

Debugging

npx @modelcontextprotocol/inspector uv --directory . run mcp-server-logseq

Contributing

We welcome contributions to enhance Logseq integration:

  • Add new API endpoints (page linking, query support)
  • Improve block manipulation capabilities
  • Add template support
  • Enhance error handling

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_server_logseq-0.0.1.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_server_logseq-0.0.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_logseq-0.0.1.tar.gz.

File metadata

  • Download URL: mcp_server_logseq-0.0.1.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for mcp_server_logseq-0.0.1.tar.gz
Algorithm Hash digest
SHA256 57fb597f39c93eb0f05c7b1b9308ad960257ded2c645fa86495158eca03372cc
MD5 720d8920950c4278c8d3ff90154b2cc6
BLAKE2b-256 ac392c902bbbf031fc2d4b2a8d0d0b5a0932e904c9f5154d9d45d1e7490160cf

See more details on using hashes here.

File details

Details for the file mcp_server_logseq-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_server_logseq-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a2981b8267e7683d8add3b14f054580950192acd1735493797e7165f26123a6f
MD5 06e8c6471a55dc691c5710cf0295dee6
BLAKE2b-256 de3a909e14863b9f1cccab943aa93003726efe93fb2d68c69e138afec9eea6c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page