Logseq Mcp — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Logseq Mcp (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
An MCP (Model Context Protocol) server for interacting with Logseq graphs, enabling AI assistants to read, create, and manipulate Logseq content.
We provide a setup wizard that will guide you through the installation:
# Clone the repository
git clone https://github.com/yourusername/logseq-mcp.git
cd logseq-mcp
# Run the setup wizard
./deploy.shThe setup wizard will:
If you prefer to set up manually instead of using the setup wizard:
#### Using uv (recommended)
# Clone the repository
git clone https://github.com/yourusername/logseq-mcp.git
cd logseq-mcp
# Install dependencies
uv pip install --system -e .
# Install development dependencies (optional)
uv pip install --system -e ".[dev]"#### Using pip
# Clone the repository
git clone https://github.com/yourusername/logseq-mcp.git
cd logseq-mcp
# Install dependencies
pip install -e .
# Install development dependencies (optional)
pip install -e ".[dev]" cp env/.env.example env/.envenv/.env: LOGSEQ_API_HOST=localhost
LOGSEQ_API_PORT=12315The setup wizard (./deploy.sh) will generate the configuration for you. If you need to configure manually, add the following to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"logseq": {
"command": "uv",
"args": [
"--directory",
"/path/to/logseq-mcp",
"run",
"--with",
".",
"--refresh",
"--python",
"3.13",
"python",
"-m",
"logseq_mcp_server"
],
"env": {
"LOGSEQ_API_HOST": "localhost",
"LOGSEQ_API_PORT": "12315",
"LOGSEQ_MCP_LOG_LEVEL": "INFO",
"LOGSEQ_MCP_PROJECT_ROOT": "/path/to/logseq-mcp"
}
}
}
}Security note: Delete operations are disabled by default to prevent accidental or AI-initiated data loss. Add"LOGSEQ_DELETE_ENABLED": "true"to theenvblock only when you explicitly want the AI assistant to be able to delete blocks.
Important Notes:
/path/to/logseq-mcp with the actual absolute path to your cloned repository (in args AND env)--directory argument sets UV's working directory--with . argument tells UV to install the local package before running--refresh flag ensures UV uses the latest code (important during development)LOGSEQ_MCP_PROJECT_ROOT environment variable ensures logs are saved in the project directoryTo enable the delete_block tool, add LOGSEQ_DELETE_ENABLED to the env block:
"env": {
"LOGSEQ_API_HOST": "localhost",
"LOGSEQ_API_PORT": "12315",
"LOGSEQ_DELETE_ENABLED": "true"
}Troubleshooting:
uv cache clean to clear UV's cachelogs/ directory of the project for detailed error informationAfter updating the configuration, restart Claude Desktop to connect to the Logseq MCP server.
For Cline users, the setup wizard will provide the configuration. You can also manually add the server to your Cline settings in VS Code:
The server includes privacy-focused logging that protects your personal data by default:
#### Privacy Features
#### Logging Modes
"My Private Notes" → "My P***otes" (preserves partial visibility)[content_123_chars][datalog_query_45_chars]/Users/john/Documents → /Users/***/Documentsblock_a1b2c3 (consistent hashing)LOGSEQ_MCP_LOG_MODE=debugLOGSEQ_MCP_LOG_MODE=minimal#### Configuration
# Environment variables
LOGSEQ_MCP_LOG_MODE=privacy # privacy, debug, or minimal (default: privacy)
LOGSEQ_MCP_LOG_LEVEL=INFO # DEBUG, INFO, WARNING, ERROR (default: INFO)
LOGSEQ_MCP_LOG_RETENTION_DAYS=7 # Days to keep logs (default: none)
LOGSEQ_MCP_LOG_MAX_SIZE=10MB # Max file size before rotation (default: 10MB)
LOGSEQ_MCP_DEBUG=true # Enable console output (default: false)
LOGSEQ_MCP_LOG_FILE=/custom/path.log # Custom log location (optional)#### Example Privacy Mode Log Entry
{
"timestamp": "2025-01-15T10:30:45Z",
"level": "INFO",
"logger": "logseq_mcp_server.logging_config",
"message": "Tool get_page completed successfully",
"tool_name": "get_page",
"arguments": {
"name": "My P***nal"
},
"result": {
"success": true,
"page": {
"originalName": "My P***nal",
"uuid": "block_7d4e8c"
}
},
"duration_ms": 45
}#### Viewing Logs
# View logs in real-time
tail -f logs/logseq-mcp.log
# Search logs while respecting privacy
grep '"level": "ERROR"' logs/logseq-mcp.log#### Temporary Debug Mode
When troubleshooting issues:
# Run with debug logging temporarily
LOGSEQ_MCP_LOG_MODE=debug python -m logseq_mcp_server
# Or in Claude Desktop config (temporarily):
"env": {
"LOGSEQ_MCP_LOG_MODE": "debug",
"LOGSEQ_MCP_LOG_RETENTION_DAYS": "1"
}Important: Remember to switch back to privacy mode after debugging to protect your personal data.
# Run with default stdio transport
python -m logseq_mcp_server
# Run with SSE transport
LOGSEQ_MCP_TRANSPORT=sse python -m logseq_mcp_server
# Run with MCP CLI
mcp run src/logseq_mcp_server/server.py#### Block Operations
create_block: Create a new block in a pageupdate_block: Update an existing block's content or propertiesdelete_block: Delete a block (disabled by default; requires `LOGSEQ_DELETE_ENABLED=true`)#### Page Operations
create_page: Create a new pageget_all_pages: Get all pages in the current graphget_page: Retrieve a page and its contentget_journal_page: Get a journal page by date (supports various date formats)search_pages: Search for pages by query#### Query Operations
execute_query: Execute Datalog queries (supports optional input parameters for parameterized queries)The get_journal_page tool provides a convenient way to retrieve journal pages by date, automatically converting various date formats to Logseq's journal page naming convention.
#### Supported Date Formats
The tool accepts dates in multiple formats:
"2023-12-25""12/25/2023""25/12/2023""Dec 25th, 2023"#### Example Usage
// Get today's journal page
{
"tool": "get_journal_page",
"arguments": {
"date": "2024-01-15"
}
}
// Get journal with blocks
{
"tool": "get_journal_page",
"arguments": {
"date": "01/15/2024",
"include_children": true
}
}The tool converts the provided date to Logseq's abbreviated journal format (e.g., "Dec 25th, 2023") before fetching the page.
The execute_query tool runs Datalog queries against the graph. It also accepts an optional inputs array for parameterized queries.
// Simple query
{
"tool": "execute_query",
"arguments": {
"query": "[:find ?name :where [?p :block/name ?name]]"
}
}
// Parameterized query
{
"tool": "execute_query",
"arguments": {
"query": "[:find ?b :in $ ?tag :where [?b :block/refs ?r] [?r :block/name ?tag]]",
"inputs": ["meeting"]
}
}If you encounter issues during setup:
python3 --version cd logseq-mcp
python tests/tools/test_logseq.py get-all-pages --limit 5 tail -f logs/logseq-mcp.log # Remove existing installation
rm -rf .venv build dist *.egg-info
# Run setup wizard again
./deploy.shA standalone test harness (tests/tools/test_logseq.py) is provided for rapid testing and debugging of Logseq API calls without going through the MCP protocol. This tool is useful for:
Usage examples:
# Test specific methods
python tests/tools/test_logseq.py get-page "MCP Server"
python tests/tools/test_logseq.py get-page "Test Page" --show-raw
python tests/tools/test_logseq.py get-all-pages --limit 5
python tests/tools/test_logseq.py search "test"
# Test journal pages
python tests/tools/test_logseq.py get-page "December 25th, 2023" # Get journal by formatted name
# Raw API calls
python tests/tools/test_logseq.py raw logseq.Editor.getCurrentGraph
python tests/tools/test_logseq.py raw logseq.Editor.getPage "My Page"
# Interactive REPL mode
python tests/tools/test_logseq.py interactive
# Verbose mode for debugging
python tests/tools/test_logseq.py get-page "MCP Server" --verboseThe test harness provides:
#### Important Note on Logseq API Arguments
Most Logseq API methods expect arguments to be wrapped in arrays, even for single values:
logseq.Editor.getPage ["MCP Server"]logseq.Editor.getPage "MCP Server"Methods that require array format: getPage, getPageBlocksTree, getBlock, removeBlock, createPage, insertBlock, updateBlock. Methods that use string format: search, q (queries).
# Run all tests
pytest
# Run with coverage
pytest --cov=src/logseq_mcp_server tests/
# Run specific test
pytest tests/unit/test_tools.py -v# Run linter
ruff check src/ tests/
# Format code
ruff format src/ tests/git checkout -b feat/amazing-feature)git push origin feat/amazing-feature)This project uses conventional commits. Examples:
feat(tools): add block creation toolfix(api): handle empty query resultsdocs(readme): update installation instructionsSee CLAUDE.md for detailed development guidelines.
This project is private and proprietary. All rights reserved.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.