Skip to main content

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

Project description

mcp-pkm-logseq MCP server

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

Components

Resources

  • logseq://start - Initial instructions on how to interact with this knowledge base
  • logseq://page/{name} - Get a page from Logseq by name

Tools

  • get_tagged_blocks(*tags) - Get all blocks with specified tags or page references

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

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_KEY": "your-logseq-api-token",
      "LOGSEQ_URL": "http://localhost:12315"
    }
  }
}

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

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_KEY": "your-logseq-api-token",
      "LOGSEQ_URL": "http://localhost:12315"
    }
  }
}

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_pkm_logseq-0.1.0.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

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

mcp_pkm_logseq-0.1.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file mcp_pkm_logseq-0.1.0.tar.gz.

File metadata

  • Download URL: mcp_pkm_logseq-0.1.0.tar.gz
  • Upload date:
  • Size: 26.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.29

File hashes

Hashes for mcp_pkm_logseq-0.1.0.tar.gz
Algorithm Hash digest
SHA256 723591534efbf77b084613ab4ff636e83a9be9daab7f353669924426722988c3
MD5 5c3e2ca6f6da649d3cda654139847810
BLAKE2b-256 e671b96eae80d6d9ece1758ff625a08e1440de574dbd04a90286c3084c3756d8

See more details on using hashes here.

File details

Details for the file mcp_pkm_logseq-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_pkm_logseq-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 657e81c187846094506e96e64efd1b6f87751385cee6ece6e955895d68160e1b
MD5 f85bb0d99d88d9aadd517e9739cb7045
BLAKE2b-256 23ba3e4755a689a47eb2ad29c4957ae6f73e47c635fbe31ab46f6983664ed994

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