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://guide- Initial instructions on how to interact with this knowledge base
Tools
personal_notes(topics)- Retrieve personal notes from Logseq that are tagged with the specified topics
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_KEY": "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:
- Open Logseq and go to Settings (upper right corner)
- Navigate to Advanced
- Enable "Developer mode"
- Enable "HTTP API Server"
- Set your API token (this should match the
LOGSEQ_API_KEYvalue 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:
- Sync dependencies and update lockfile:
uv sync
- Build package distributions:
uv build
This will create source and wheel distributions in the dist/ directory.
- Publish to PyPI:
uv publish
Note: You'll need to set PyPI credentials via environment variables or command flags:
- Token:
--tokenorUV_PUBLISH_TOKEN - Or username/password:
--username/UV_PUBLISH_USERNAMEand--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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_pkm_logseq-0.2.1.tar.gz.
File metadata
- Download URL: mcp_pkm_logseq-0.2.1.tar.gz
- Upload date:
- Size: 27.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
987037e36afff4ab6cbc0853c5e904331c4b36184890a180a1356f87482a7d08
|
|
| MD5 |
ad780c6c73fe57f846f4fd6cbee47962
|
|
| BLAKE2b-256 |
f5339ce0908dc479a62ad13e5e488493e6b5a76cc16bdc97f74ddeeed76c00ae
|
File details
Details for the file mcp_pkm_logseq-0.2.1-py3-none-any.whl.
File metadata
- Download URL: mcp_pkm_logseq-0.2.1-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54dbfe088afb5a2bbb6f273ddc19b2d96e6036e6a7366ec0fdf67ec5b8d6e089
|
|
| MD5 |
a836ac8b22c36d2f4873011d78aab9dd
|
|
| BLAKE2b-256 |
e27fdaa251fdb4a61a06f1b82b4ac7ff5e88b8ab277a26627e8f3e8fef060bd4
|