Get the FREE Ultimate OpenClaw Setup Guide →

logseq

Model Context Protocol server for Logseq knowledge base integration with AI assistants

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio eugeneyvt-logseq-mcp-server npx logseq-mcp-server \
  --env LOGSEQ_API_URL="http://127.0.0.1:12315" \
  --env LOGSEQ_API_TOKEN="your-api-token-here"

How to use

The Logseq MCP server exposes an AI-friendly interface to your Logseq graph, enabling AI assistants to search, retrieve, create, and manage content locally. It implements the MCP 4-tool pattern (Get, Search, Edit, Delete) so clients can perform structured knowledge operations against your Logseq data with consistent, predictable commands. By running the server with npx logseq-mcp-server, you start a local MCP endpoint that tools like Claude Desktop, Claude Code, VS Code, Cursor, and other MCP clients can connect to via the specified API URL and token. The typical workflow is to configure an MCP client to point at http://127.0.0.1:12315 and provide the API token, then use the available tools to query your graph, fetch notes, or generate new content linked to your Logseq knowledge base. The integration emphasizes local-operations privacy, since data stays on your machine.

How to install

Prerequisites:

  • Node.js v18.0.0 or newer
  • npm (comes with Node.js) or pnpm
  • Logseq with HTTP API enabled (for integration with MCP clients)

Install steps:

  1. Install the MCP server globally via npm:
npm install -g logseq-mcp-server
  1. Start the MCP server (the command is exposed by the npm package):
npx logseq-mcp-server
  1. Verify the server is reachable at the configured MCP endpoint (default example uses http://127.0.0.1:12315).
  2. On your MCP client, add a new MCP server with:
  • Command: npx
  • Args: ["logseq-mcp-server"]
  • Environment variables: LOGSEQ_API_URL=http://127.0.0.1:12315, LOGSEQ_API_TOKEN=your-api-token-here

Optional: customize the URL/token to match your environment and security preferences.

If using your editor/IDE, copy the example configuration from the README and adjust the API URL and token accordingly.

Additional notes

Tips and notes:

  • Ensure Logseq HTTP API is enabled and accessible from the machine running the MCP server.
  • Use a strong, unique API token for LOGSEQ_API_TOKEN and store it securely.
  • The server is designed for local-first operation; if you move to a different port or URL, update your MCP client configuration accordingly.
  • Some clients may cache configuration; restart the client after updating the MCP server configuration.
  • If you encounter connectivity issues, verify that the MCP server process is running and that there are no firewalls blocking http://127.0.0.1:12315.

Related MCP Servers

Sponsor this space

Reach thousands of developers