LogSeq MCP server

Integrates with LogSeq API to enable automated note-taking, content searching, and knowledge management tasks.
Back to servers
Provider
Salih Ergüt
Release date
Dec 20, 2024
Language
Python
Stats
73 stars

The MCP server for LogSeq enables interaction with LogSeq through a standardized interface, allowing you to manage graphs, pages, and content programmatically. This implementation provides various tools for interacting with LogSeq's API in a structured way.

Available Tools

The MCP server provides several tools for LogSeq interaction:

  • list_graphs: Displays all available graphs
  • list_pages: Shows all pages in the current graph
  • get_page_content: Retrieves the content of a specific page
  • search: Performs content searches across all pages
  • create_page: Creates a new page
  • update_page: Modifies existing page content
  • delete_page: Removes a page

Installation and Setup

Prerequisites

Before using the MCP server for LogSeq, ensure:

  1. LogSeq is installed and running
  2. LogSeq API plugin is enabled and configured
  3. You have your LogSeq API token

Configuration

You can configure the MCP server for LogSeq in two ways:

Method 1: Server Configuration (Recommended)

Add LogSeq API settings to your server config:

{
  "mcp-logseq": {
    "command": "uvx",
    "args": [
      "mcp-logseq"
    ],
    "env": {
      "LOGSEQ_API_TOKEN": "<your_api_token_here>",
      "LOGSEQ_API_URL": "http://localhost:12315"
    }
  }
}

Method 2: Environment File

Create a .env file in your working directory with:

LOGSEQ_API_TOKEN=your_token_here
LOGSEQ_API_URL=http://localhost:12315

Usage Examples

Working with LogSeq via the MCP Server

When using an AI assistant like Claude with this MCP server, you'll want to instruct it to use LogSeq. Here are some example prompts:

  • "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"

Common Operations

Listing Graphs

To retrieve all available LogSeq graphs:

// The MCP server will handle this when requested
list_graphs

Searching for Content

To search for specific content across pages:

// The MCP server will handle this when requested
search "project milestone"

Creating Pages

To create a new page:

// The MCP server will handle this when requested
create_page "Meeting Notes 2023-10-12" "# Meeting with Team\n\n- Discussed project timeline\n- Action items assigned"

Updating Pages

To update an existing page:

// The MCP server will handle this when requested
update_page "Project Status" "# Project Status\n\n## Current Sprint\n- Task 1: Completed\n- Task 2: In progress"

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later