mcp-logseq-server
by: ergut
MCP server to interact with LogSeq via its Local HTTP API - enabling AI assistants like Claude to seamlessly read, write, and manage your LogSeq graph.
📌Overview
Purpose: The MCP server facilitates interaction with LogSeq through its API, enabling various functionalities for managing and accessing notes and pages.
Overview: The MCP server is designed to enhance user interaction with LogSeq by providing a set of tools to manage graphs and pages efficiently. By integrating with the LogSeq API, users can streamline their note-taking and information retrieval activities.
Key Features:
-
Graph Management: Tools like
list_graphs
andlist_pages
allow users to easily navigate through all available graphs and access specific pages within the current graph. -
Content Manipulation: Functions such as
create_page
,update_page
, anddelete_page
enable users to manipulate content directly, making it simple to organize and maintain their notes. -
Information Retrieval: With the
search
andget_page_content
functionalities, users can quickly find relevant information across all pages or retrieve specific page contents when needed.
MCP Server for LogSeq
The MCP server allows interaction with LogSeq via its API.
Components
Tools
The server implements the following tools:
- list_graphs: Lists all available graphs.
- list_pages: Lists all pages in the current graph.
- get_page_content: Returns the content of a single page.
- search: Searches for content across all pages.
- create_page: Creates a new page.
- update_page: Updates content of an existing page.
- delete_page: Deletes a page.
Example Prompts
Here are some example prompts to instruct Claude to use LogSeq effectively:
- Get the contents of my latest meeting notes and summarize them.
- Search for all pages where Project X is mentioned and explain the context.
- Create a new page with today's meeting notes.
- Update the project status page with the latest updates.
Configuration
LogSeq API Configuration
Configure the environment with LogSeq API settings in one of two ways:
-
Add to server config (preferred):
{ "mcp-logseq": { "command": "uvx", "args": [ "mcp-logseq" ], "env": { "LOGSEQ_API_TOKEN": "<your_api_token_here>", "LOGSEQ_API_URL": "http://localhost:12315" } } }
-
Create a
.env
file in the working directory with the required variables:LOGSEQ_API_TOKEN=your_token_here LOGSEQ_API_URL=http://localhost:12315
Development
Building
To prepare the package for distribution, sync dependencies and update the lockfile:
uv sync
Debugging
Debugging MCP servers can be challenging due to the use of stdio. For a better debugging experience, using the MCP Inspector is recommended. Launch the MCP Inspector with:
npx @modelcontextprotocol/inspector uv --directory /path/to/mcp-logseq run mcp-logseq