Skip to main content

mcp-pkm-logseq MCP server

A MCP server for interacting with your Logseq Personal Knowledge Management system using custom instructions

Components

Resources

  • logseq://guide - Initial instructions on how to interact with this knowledge base

Tools

  • get_personal_notes_instructions() - Get instructions on how to use the personal notes tool
  • get_personal_notes(topics, from_date, to_date) - Retrieve personal notes from Logseq that are tagged with the specified topics
  • get_todo_list(done, from_date, to_date) - Retrieve the todo list from Logseq

Configuration

The following environment variables can be configured:

  • LOGSEQ_API_KEY: API key for authenticating with Logseq (default: "this-is-my-logseq-mcp-token")
  • LOGSEQ_URL: URL where the Logseq HTTP API is running (default: "http://localhost:12315")

Quickstart

Install

Claude Desktop and Cursor

On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

Published Servers Configuration
"mcpServers": {
  "mcp-pkm-logseq": {
    "command": "uvx",
    "args": [
      "mcp-pkm-logseq"
    ],
    "env": {
      "LOGSEQ_API_TOKEN": "your-logseq-api-token",
      "LOGSEQ_URL": "http://localhost:12315"
    }
  }
}

Claude Code

claude mcp add mcp-pkm-logseq uvx mcp-pkm-logseq

Start Logseq server

Logseq's HTTP API is an interface that runs within your desktop Logseq application. When enabled, it starts a local HTTP server (default port 12315) that allows programmatic access to your Logseq knowledge base. The API supports querying pages and blocks, searching content, and potentially modifying content through authenticated requests.

To enable the Logseq HTTP API server:

  1. Open Logseq and go to Settings (upper right corner)
  2. Navigate to Advanced
  3. Enable "Developer mode"
  4. Enable "HTTP API Server"
  5. Set your API token (this should match the LOGSEQ_API_KEY value in the MCP server configuration)

For more detailed instructions, see: https://logseq-copilot.eindex.me/doc/setup

Create MCP PKM Logseq Page

Create a page named "MCP PKM Logseq" in your Logseq graph to serve as the guide for AI assistants. Add the following content:

  • Description of your tagging system (e.g., which tags represent projects, areas, resources)
  • List of frequently used tags and what topics they cover
  • Common workflows you use to organize information
  • Naming conventions for pages and blocks
  • Instructions on how you prefer information to be retrieved
  • Examples of useful topic combinations for searching
  • Any context about your personal knowledge management approach

This page will be displayed whenever the AI thinks it needs to understand the user.

Development

Building and Publishing

To prepare the package for distribution:

  1. Sync dependencies and update lockfile:
uv sync
  1. Build package distributions:
uv build

This will create source and wheel distributions in the dist/ directory.

  1. Publish to PyPI:
uv publish

Note: You'll need to set PyPI credentials via environment variables or command flags:

  • Token: --token or UV_PUBLISH_TOKEN
  • Or username/password: --username/UV_PUBLISH_USERNAME and --password/UV_PUBLISH_PASSWORD

Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.

You can launch the MCP Inspector via npm with this command:

npx @modelcontextprotocol/inspector uv --directory /Users/ronie/MCP/mcp-pkm-logseq run mcp-pkm-logseq

Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

Add Development Servers Configuration to Claude Desktop

"mcpServers": {
  "mcp-pkm-logseq": {
    "command": "uv",
    "args": [
      "--directory",
      "/<parent-directories>/mcp-pkm-logseq",
      "run",
      "mcp-pkm-logseq"
    ],
    "env": {
      "LOGSEQ_API_TOKEN": "your-logseq-api-token",
      "LOGSEQ_URL": "http://localhost:12315"
    }
  }
}

Metadata

Release files for mcp-pkm-logseq 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-pkm-logseq 0.2.2
File Size Uploaded Provenance
mcp_pkm_logseq-0.2.2.tar.gz 28.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-pkm-logseq 0.2.2
File Interpreter ABI Platform
mcp_pkm_logseq-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 44.1 kB

Release files / mcp_pkm_logseq-0.2.2.tar.gz

Download URL mcp_pkm_logseq-0.2.2.tar.gz
Size 28.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3e701e9e7c0d754fe505371263a1f1b947be8eab426c4f65e89bc881b937c46c
BLAKE2b-256 checksum
How to use checksums
bdbb17ad598b63967cd2793bff7a7365205259adbfa47d1fdf4621405cbec8c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.12

Release files / mcp_pkm_logseq-0.2.2-py3-none-any.whl

Download URL mcp_pkm_logseq-0.2.2-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0be02bcd0025f67959640893455e55475a4e6884be7023d8a834d352e4b83b2
BLAKE2b-256 checksum
How to use checksums
d6193e4425319262d0ee8454cca17b9f2e2781d234aa5c1d61fb0ec89a6c2dde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.12

Security for mcp-pkm-logseq 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page