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.
The MCP server provides several tools for LogSeq interaction:
Before using the MCP server for LogSeq, ensure:
You can configure the MCP server for LogSeq in two ways:
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"
}
}
}
Create a .env
file in your working directory with:
LOGSEQ_API_TOKEN=your_token_here
LOGSEQ_API_URL=http://localhost:12315
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:
To retrieve all available LogSeq graphs:
// The MCP server will handle this when requested
list_graphs
To search for specific content across pages:
// The MCP server will handle this when requested
search "project milestone"
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"
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"
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.
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"
]
}
}
}
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.
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.