# Logseq Knowledge MCP

> Logseq Knowledge Management MCP connects your personal outliner graph to any AI client. It lets you treat your notes like a database, using natural conversation to read, write, and organize structured content across pages and blocks while keeping everything local and private.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Tags:** bi-directional-linking, markdown, knowledge-graph, privacy-first, outliner

## Description

This connector gives your agent direct access to the internal structure of your Logseq instance. You can manage your personal knowledge graph by simply talking to it. Forget copy-pasting huge chunks of notes into a prompt just to get an overview; your AI client now sees the entire hierarchy, down to the individual block level.

Need to track research threads or technical documentation? Your agent doesn't just read text; it understands that 'Project Alpha' is a page and that 'Verify API endpoints' is a specific sub-task (a block) within it. You can ask it to list all pages, find deeply nested project structures, or even delete old metadata loops securely.

Whether you’re an engineer managing tech specs or a researcher tracking academic ideas, this MCP lets your agent perform complex operations like updating properties on specific blocks or running deep text searches across the entire vault. Vinkius makes connecting to this powerful local system easy; just connect once from any compatible client and get full control of your graph structure through conversation.

## Tools

### list_pages
Retrieves a list of all existing pages in your Logseq vault.

### get_page
Pulls the detailed metadata for one specific page using its name or unique ID.

### create_page
Creates a brand new, organized page within your local Logseq graph.

### delete_page
Irreversibly removes an entire active Logseq page and all its content.

### get_page_blocks
Extracts the complete, nested outliner tree structure from a selected page.

### insert_block
Appends a new, managed block of text to any specific location within your graph.

### update_block
Modifies the raw properties and content of an existing tracked block while preserving its links.

### delete_block
Permanently removes a specific outliner block, including any child dependencies.

### search_content
Runs local queries to pull out all text matches across your entire knowledge base.

### get_current_graph
Validates the current environment by identifying active graph paths and database directories.

## Prompt Examples

**Prompt:** 
```
Search my Logseq graph for 'smart building research'
```

**Response:** 
```
I've scanned your graph and found 3 relevant matches: 1) Page 'Smart-Buildings-Project', 2) Block in 'Journal 2026-03-27' mentioning sensor setups, 3) Tag '#research' in multiple blocks. Would you like to see the blocks from the project page?
```

**Prompt:** 
```
Create a new page called 'Meeting Notes' with content '# Meetings 2026'
```

**Response:** 
```
Page 'Meeting Notes' created successfully in your graph. I've added the initial markdown header. You can now use the `insert_block` tool to add specific meeting items or agenda points.
```

**Prompt:** 
```
Add a block to the 'Project Alpha' page: 'Verify API endpoints for production'
```

**Response:** 
```
Block added successfully to 'Project Alpha'. It is now part of the outliner tree for that page. Would you like me to add any specific child blocks or sub-tasks under this point?
```

## Capabilities

### List all pages
It gives you an immediate list of every page in your Logseq vault.

### Retrieve specific page details
You can pull the metadata for any single page using its name or UUID, giving you targeted information.

### Create and manage pages
The agent can deploy new organized pages into your graph or delete them completely.

### Inspect hierarchical blocks
It extracts the complete, nested structure of an outliner tree from a specific page.

### Modify individual content blocks
The agent can append new thoughts to existing blocks, update their properties, or remove them safely.

### Search the entire knowledge base
You run local queries that find specific text targets across every page and block in your graph.

## Use Cases

### Synthesizing meeting notes across multiple days
A project manager needs to find all instances of 'Q3 budget' mentioned in the last month’s worth of notes. Instead of opening 15 different pages, they ask their agent to `search_content` for that phrase and get a list of every relevant block across the entire vault.

### Refining a specific technical concept
A developer wants to add a new API endpoint reference to an existing project plan page. They ask their agent to `insert_block` with the details, ensuring the new info is perfectly nested under the right section without messing up the formatting.

### Archiving old research projects
A student has completed a thesis and needs to clean up related pages. They ask their agent to `delete_page` for the entire 'Draft 2023' section, permanently removing all associated metadata loops.

### Mapping complex ideas
A writer is trying to understand how three separate concepts (e.g., quantum physics, medieval history, and supply chain logistics) are connected in their vault. They use `get_page_blocks` on a key page to map the exact structural relationships between these different topics.

## Benefits

- You never have to manually copy-paste context again. Instead, you simply ask your agent to search the entire graph using `search_content`, and it delivers precisely what you need, instantly.
- Maintain privacy while working with complex data. Because this MCP connects locally, all your notes stay within your private Logseq environment, giving you full control over your knowledge structure.
- Keep your project files organized by automating page creation or deletion. You can use `create_page` to start a new topic or `delete_page` when the work is done.
- Manage granular details using block tools. If you need to refine a specific point, you don't have to rewrite the whole thing; just ask your agent to `update_block` on that single item.
- Understand complex relationships by viewing outliner trees. The `get_page_blocks` tool lets you see exactly how deeply nested your ideas are structured without manual inspection.

## How It Works

The bottom line is, you get to manage your complex knowledge base using simple natural language prompts instead of navigating menus and copy-pasting data.

1. Subscribe to this MCP on Vinkius, then enable the HTTP API within your Logseq settings.
2. Enter your unique Logseq API Token and the Host URL into your agent client's configuration.
3. Start asking questions or giving commands. Your AI client communicates directly with the local graph structure for results.

## Frequently Asked Questions

**How does Logseq Knowledge MCP maintain my data's privacy?**
The connection is local. Your agent client talks directly to your private Logseq instance via an API token, meaning your notes never leave your controlled environment.

**Can the Logseq Knowledge MCP handle large vaults?**
Yes, because it queries the internal graph structure rather than relying on external indexing. It's designed to manage complex, large-scale outliner data efficiently.

**What is the difference between `search_content` and `get_page`?**
`get_page` retrieves all metadata for one specific page by name or ID. `search_content` runs a query across your whole vault to find mentions of certain text targets, regardless of which page they live on.

**Does the Logseq Knowledge MCP let me add images?**
The focus is on structured data and outliner blocks. While it manages markdown content well, its primary function isn't handling multimedia files.

**If I delete a block using `delete_block`, does it affect other things?**
No. The MCP is designed to safely remove explicit nodes while retaining the integrity of surrounding links and indices, ensuring nothing else breaks because of the deletion.