- Home
- MCP servers
- Logseq
Logseq
- python
15
GitHub Stars
python
Language
4 months ago
First Indexed
3 weeks ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"apw124-logseq-mcp": {
"command": "/opt/homebrew/bin/uvx",
"args": [
"logseq-mcp"
],
"env": {
"LOGSEQ_TOKEN": "your-token-here",
"LOGSEQ_API_URL": "http://localhost:12315"
}
}
}
}This MCP server lets AI agents interact with your local Logseq instance by running a lightweight, local process that speaks a defined MCP interface. It enables you to issue commands to create, read, update, and organize pages and blocks within your Logseq graph from AI-powered tools or agents.
How to use
You will run a local MCP server that exposes Logseq operations under the logseq namespace. Connect your MCP client (for example, Cursor or Claude) to this server so the agent can perform tasks like listing pages, reading blocks, creating pages, and editing journal entries. Give the agent prompts that reference the available functions, such as logseq.get_all_pages(), logseq.get_page(name), logseq.create_page(name), logseq.delete_page, and similar block-oriented operations.
How to install
# Prerequisites
python3.11+
# Install the MCP server package in editable mode
pip install -e .
# Logseq setup steps you perform locally inside Logseq
# 1) Enable Developer mode
# 2) Turn on Logseq Developer Plugin
# 3) Set an API token in Advanced settings
# 4) Restart Logseq
{
"mcpServers": {
"logseq": {
"command": "/opt/homebrew/bin/uvx",
"args": ["logseq-mcp"],
"env": {
"LOGSEQ_API_URL": "http://localhost:12315",
"LOGSEQ_TOKEN": "your-token-here"
}
}
}
}
If you also want to connect Claude Code to the MCP server, run this command to add the MCP integration and configure the environment values shown above. Use the exact command and environment variables as shown below.
claude mcp add
- Select scope
- Select Stdio
- `LOGSEQ_API_URL=http://localhost:12315 LOGSEQ_TOKEN=your-token-here /opt/homebrew/bin/uvx logseq-mcp
## Additional setup notes
The server is designed to run locally in stdio mode, invoking the `uvx` runtime with the `logseq-mcp` subcommand. It reads connection details from the provided environment variables so your client can authenticate and reach the local API at the specified URL.
## Notes on working with Logseq
Journal pages and blocks follow Logseq conventions. You can create pages or blocks through the MCP tools and the agent will handle journal page formatting and special attributes automatically as you manipulate content.
## Examples of common tasks
- Create a new page called `Meeting Notes` and add a bullet list for today’s agenda. - Retrieve all blocks from a page and then insert a new block under a specific parent. - Update a block’s content or move it to a different location within the page’s hierarchy.
## Available tools
### logseq.get\_all\_pages
Return a list of all pages in the Logseq graph.
### logseq.get\_page
Return the content and metadata of a specific page by name.
### logseq.create\_page
Create a new page with the given name.
### logseq.delete\_page
Delete a page and all its blocks.
### logseq.get\_page\_blocks
Fetch all blocks from a specified page.
### logseq.get\_block
Retrieve a single block by its ID.
### logseq.create\_block
Create a new block on a given page.
### logseq.insert\_block
Insert a block as a child of another block.
### logseq.update\_block
Update the content of an existing block.
### logseq.move\_block
Move a block to a different location within the page.
### logseq.remove\_block
Remove a block and all of its children.
### logseq.search\_blocks
Search for blocks matching a query across the graph.