logseq-mcp 0.0.0-development
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +210 -0
- package/dist/index.js +294 -0
- package/package.json +79 -0
package/README.md
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# Logseq MCP Agent
|
|
2
|
+
|
|
3
|
+
A powerful AI assistant that connects Logseq with Claude and other LLMs using the Model Context Protocol (MCP).
|
|
4
|
+
|
|
5
|
+
## What is it?
|
|
6
|
+
|
|
7
|
+
Logseq MCP Agent lets AI assistants like Claude directly interact with your Logseq knowledge graph - search your notes, create content, organize information, and manage tasks.
|
|
8
|
+
|
|
9
|
+
MCP (Model Context Protocol) works like a "USB-C port for AI" - providing a standardized way for AI models to connect with your applications and data. This agent implements MCP to give Claude and other LLMs a direct, structured interface to your Logseq knowledge base.
|
|
10
|
+
|
|
11
|
+
Think of it as giving Claude direct access to your second brain.
|
|
12
|
+
|
|
13
|
+
## Key Features
|
|
14
|
+
|
|
15
|
+
### 📝 Knowledge Management
|
|
16
|
+
- Search your entire graph for information
|
|
17
|
+
- Generate summaries of pages and content
|
|
18
|
+
- Create daily notes with custom sections
|
|
19
|
+
- Organize flat pages into nested structures
|
|
20
|
+
|
|
21
|
+
### ✅ Task Management
|
|
22
|
+
- Find all tasks with specific statuses (TODO, DOING, etc.)
|
|
23
|
+
- Extract tasks from meeting notes
|
|
24
|
+
- Create and organize task lists
|
|
25
|
+
- Track task progress
|
|
26
|
+
|
|
27
|
+
### 🔍 Search & Query
|
|
28
|
+
- Natural language search across your graph
|
|
29
|
+
- Find blocks by content
|
|
30
|
+
- Run advanced Datalog queries
|
|
31
|
+
|
|
32
|
+
### 📊 Content Organization
|
|
33
|
+
- Restructure content hierarchically
|
|
34
|
+
- Organize blocks by any criteria
|
|
35
|
+
- Transform flat content into nested structures
|
|
36
|
+
|
|
37
|
+
## Quick Setup
|
|
38
|
+
|
|
39
|
+
### Prerequisites
|
|
40
|
+
- [Logseq](https://logseq.com/) with HTTP API enabled
|
|
41
|
+
- A Logseq API token
|
|
42
|
+
- Claude Desktop or other MCP-compatible AI assistant
|
|
43
|
+
|
|
44
|
+
### Enabling Logseq HTTP API
|
|
45
|
+
1. In Logseq → Settings → Advanced: Enable "Developer mode"
|
|
46
|
+
2. Restart Logseq
|
|
47
|
+
3. In Settings: Enable "HTTP API server"
|
|
48
|
+
4. Copy your API token
|
|
49
|
+
|
|
50
|
+
### Setup with Claude Desktop
|
|
51
|
+
1. Open Claude Desktop settings
|
|
52
|
+
2. Navigate to MCP Servers
|
|
53
|
+
3. Add a new server:
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"mcpServers": {
|
|
57
|
+
"logseq": {
|
|
58
|
+
"command": "npx",
|
|
59
|
+
"args": [
|
|
60
|
+
"logseq-mcp"
|
|
61
|
+
],
|
|
62
|
+
"env": {
|
|
63
|
+
"LOGSEQ_TOKEN": "your_logseq_token"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
4. Replace `your_logseq_token` with your actual token
|
|
70
|
+
5. Save and restart Claude
|
|
71
|
+
|
|
72
|
+
### Using Claude with Logseq
|
|
73
|
+
Try asking:
|
|
74
|
+
- "Find all my TODO tasks in Logseq"
|
|
75
|
+
- "Create a daily note with sections for Tasks, Notes, and Journal"
|
|
76
|
+
- "Summarize my 'Research' page"
|
|
77
|
+
- "Search my notes for information about machine learning"
|
|
78
|
+
|
|
79
|
+
## Alternative Installation
|
|
80
|
+
|
|
81
|
+
Install via npm:
|
|
82
|
+
```bash
|
|
83
|
+
npx logseq-mcp
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Or install globally:
|
|
87
|
+
```bash
|
|
88
|
+
npm install -g logseq-mcp
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Configure with a `.env` file:
|
|
92
|
+
```
|
|
93
|
+
LOGSEQ_PORT=12315
|
|
94
|
+
LOGSEQ_HOST=127.0.0.1
|
|
95
|
+
LOGSEQ_TOKEN=your_logseq_token
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Run with:
|
|
99
|
+
```bash
|
|
100
|
+
logseq-mcp
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Troubleshooting
|
|
104
|
+
|
|
105
|
+
- Ensure Logseq is running before starting the agent
|
|
106
|
+
- Verify your API token is correct
|
|
107
|
+
- Check that the Logseq HTTP API is enabled
|
|
108
|
+
- Try debug mode: `DEBUG=true logseq-mcp`
|
|
109
|
+
|
|
110
|
+
### Debugging
|
|
111
|
+
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we recommend using the MCP Inspector.
|
|
112
|
+
|
|
113
|
+
You can launch the MCP Inspector via npm with:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
npx @modelcontextprotocol/inspector uv --directory /path/to/mcp-logseq run mcp-logseq
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Technical Details
|
|
120
|
+
|
|
121
|
+
Built using the Model Context Protocol (MCP), an open standard for connecting AI models with external tools and data sources. The agent acts as an MCP server that provides structured access to your Logseq graph via the Logseq HTTP API.
|
|
122
|
+
|
|
123
|
+
## Development
|
|
124
|
+
|
|
125
|
+
### Setup Development Environment
|
|
126
|
+
|
|
127
|
+
1. Clone the repository:
|
|
128
|
+
```bash
|
|
129
|
+
git clone https://github.com/briansunter/logseq-mcp.git
|
|
130
|
+
cd logseq-mcp
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
2. Install dependencies:
|
|
134
|
+
```bash
|
|
135
|
+
# Using npm
|
|
136
|
+
npm install
|
|
137
|
+
|
|
138
|
+
# Using Bun (recommended)
|
|
139
|
+
bun install
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Running Tests
|
|
143
|
+
|
|
144
|
+
The project includes unit and end-to-end tests:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# Run all tests
|
|
148
|
+
bun test tests/
|
|
149
|
+
|
|
150
|
+
# Run unit tests only
|
|
151
|
+
bun test:unit
|
|
152
|
+
|
|
153
|
+
# Run e2e tests only
|
|
154
|
+
bun test:e2e
|
|
155
|
+
|
|
156
|
+
# Run tests in watch mode
|
|
157
|
+
bun test:watch
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Building
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# Standard build
|
|
164
|
+
bun run build
|
|
165
|
+
|
|
166
|
+
# Build for Node.js
|
|
167
|
+
bun run build:node
|
|
168
|
+
|
|
169
|
+
# Build for Bun
|
|
170
|
+
bun run build:bun
|
|
171
|
+
|
|
172
|
+
# Build binaries for various platforms
|
|
173
|
+
bun run build:binary # Current platform
|
|
174
|
+
bun run build:macos-arm # macOS ARM
|
|
175
|
+
bun run build:macos-intel # macOS Intel
|
|
176
|
+
bun run build:linux-x64 # Linux x64
|
|
177
|
+
bun run build:linux-arm64 # Linux ARM64
|
|
178
|
+
bun run build:windows # Windows
|
|
179
|
+
bun run build:all-binaries # All platforms
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Contributing Guidelines
|
|
183
|
+
|
|
184
|
+
1. Fork the repository
|
|
185
|
+
2. Create a feature branch: `git checkout -b feature/your-feature-name`
|
|
186
|
+
3. Commit your changes: `git commit -m 'Add some feature'`
|
|
187
|
+
4. Push to the branch: `git push origin feature/your-feature-name`
|
|
188
|
+
5. Submit a pull request
|
|
189
|
+
|
|
190
|
+
Please make sure your code passes all tests and follows the existing code style. Add tests for new features.
|
|
191
|
+
|
|
192
|
+
## Contributing & License
|
|
193
|
+
|
|
194
|
+
Contributions welcome! MIT License.
|
|
195
|
+
|
|
196
|
+
## Contributing
|
|
197
|
+
|
|
198
|
+
### Semantic Versioning
|
|
199
|
+
|
|
200
|
+
This project uses semantic-release to automatically manage version numbers and create GitHub releases. Version numbers are determined by PR titles using the following conventions:
|
|
201
|
+
|
|
202
|
+
| PR Title Format | Example | Result |
|
|
203
|
+
|-----------------|---------|--------|
|
|
204
|
+
| `feat: ...` | `feat: add new search feature` | Minor version increase (0.X.0) |
|
|
205
|
+
| `fix: ...` | `fix: resolve search bug` | Patch version increase (0.0.X) |
|
|
206
|
+
| `feat(breaking): ...` | `feat(breaking): change API format` | Major version increase (X.0.0) |
|
|
207
|
+
|
|
208
|
+
Other valid prefixes: `docs:`, `style:`, `refactor:`, `perf:`, `test:`, `chore:`, `ci:`, `build:` (all result in patch versions).
|
|
209
|
+
|
|
210
|
+
When merging PRs to master, please follow these conventions in your PR titles to ensure proper versioning.
|