Skip to content

Commit b06a9bc

Browse files
authored
Merge pull request dvcrn#6 from deadmanoz/feature/improve-readme-documentation
2 parents 392ce08 + c2d0fc7 commit b06a9bc

6 files changed

Lines changed: 216 additions & 26 deletions

File tree

.claude/settings.local.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
node_modules
22
dist
3+
4+
.roo/
5+
6+
.claude/

.roo/mcp.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

README.md

Lines changed: 210 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Devonthink MCP Server
1+
# DEVONthink MCP Server
22

33
This MCP server provides access to DEVONthink functionality via the Model Context Protocol (MCP). It enables listing, searching, creating, modifying, and managing records and databases in DEVONthink Pro on macOS.
44

@@ -120,7 +120,34 @@ Returns:
120120
}
121121
```
122122

123-
## Usage with Claude
123+
## Getting Started
124+
125+
### Prerequisites
126+
127+
1. **DEVONthink Pro** - The DEVONthink application must be installed and running
128+
2. **Node.js** (v18 or later) - Required to run the MCP server
129+
130+
### Installation
131+
132+
#### Option 1: Install from npm (Recommended)
133+
134+
```bash
135+
npm install -g mcp-server-devonthink
136+
```
137+
138+
Then add to your Claude configuration:
139+
140+
```json
141+
{
142+
"mcpServers": {
143+
"devonthink": {
144+
"command": "mcp-server-devonthink"
145+
}
146+
}
147+
}
148+
```
149+
150+
#### Option 2: Use via npx
124151

125152
Add to your Claude configuration:
126153

@@ -135,6 +162,187 @@ Add to your Claude configuration:
135162
}
136163
```
137164

165+
#### Option 3: Local Development Setup
166+
167+
If you want to modify or contribute to this project:
168+
169+
1. **Clone the repository:**
170+
```bash
171+
git clone https://github.com/dvcrn/mcp-server-devonthink.git
172+
cd mcp-server-devonthink
173+
```
174+
175+
2. **Install dependencies:**
176+
```bash
177+
npm install
178+
```
179+
180+
*Note: The project specifies Yarn as the package manager, but npm works fine for installation.*
181+
182+
**Important**: You must run `npm install` before building, as it installs TypeScript (`tsc`) and other build tools.
183+
184+
3. **Build the project:**
185+
```bash
186+
npm run build
187+
# or use the justfile if you have just installed
188+
just build
189+
```
190+
191+
4. **Test the server:**
192+
```bash
193+
node dist/index.js
194+
```
195+
196+
The server should start without errors. Press Ctrl+C to stop.
197+
198+
5. **Add to Claude configuration:**
199+
```json
200+
{
201+
"mcpServers": {
202+
"devonthink": {
203+
"command": "node",
204+
"args": ["/path/to/mcp-server-devonthink/dist/index.js"]
205+
}
206+
}
207+
}
208+
```
209+
210+
### Claude Configuration
211+
212+
Your Claude Desktop configuration file is located at:
213+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
214+
215+
Create or update this file with the MCP server configuration. Choose the configuration that matches your installation method:
216+
217+
**Option 1: Global npm installation**
218+
```json
219+
{
220+
"mcpServers": {
221+
"devonthink": {
222+
"command": "mcp-server-devonthink"
223+
}
224+
}
225+
}
226+
```
227+
228+
**Option 2: Using npx**
229+
```json
230+
{
231+
"mcpServers": {
232+
"devonthink": {
233+
"command": "npx",
234+
"args": ["-y", "mcp-server-devonthink"]
235+
}
236+
}
237+
}
238+
```
239+
240+
**Option 3: Local development setup**
241+
```json
242+
{
243+
"mcpServers": {
244+
"devonthink": {
245+
"command": "node",
246+
"args": ["/path/to/mcp-server-devonthink/dist/index.js"]
247+
}
248+
}
249+
}
250+
```
251+
*Replace `/path/to/mcp-server-devonthink` with your actual project directory path.*
252+
253+
## Usage with Claude Desktop
254+
255+
1. **Start DEVONthink** - Ensure DEVONthink Pro is running
256+
2. **Restart Claude Desktop** - After updating the configuration
257+
3. **Test the connection** - In Claude, try asking: "Is DEVONthink running?"
258+
259+
If everything is set up correctly, Claude should be able to use the `is_running` tool and confirm that DEVONthink is active.
260+
261+
## Usage with Claude Code
262+
263+
Claude Code users can install this MCP server using the command-line interface. Based on testing experience, here's the complete setup process:
264+
265+
### Prerequisites
266+
267+
- Ensure Claude Code CLI is installed and working (`claude --version`)
268+
- DEVONthink Pro must be running
269+
270+
### Installation
271+
272+
Choose the installation method that matches your setup:
273+
274+
**Option 1: Global npm installation**
275+
```bash
276+
npm install -g mcp-server-devonthink
277+
claude mcp add devonthink -- mcp-server-devonthink
278+
```
279+
280+
**Option 2: Using npx (no installation required)**
281+
```bash
282+
claude mcp add devonthink -- npx -y mcp-server-devonthink
283+
```
284+
285+
**Option 3: Local development setup**
286+
```bash
287+
# After cloning and building the project locally
288+
claude mcp add devonthink -- node /path/to/mcp-server-devonthink/dist/index.js
289+
```
290+
291+
### Scope Configuration
292+
293+
By default, MCP servers are added with **local scope** (only available in the current project directory). For global availability:
294+
295+
```bash
296+
claude mcp add devonthink --scope user -- node /path/to/mcp-server-devonthink/dist/index.js
297+
```
298+
299+
### Verification & Testing
300+
301+
1. **Check server status:**
302+
```bash
303+
claude mcp list
304+
```
305+
You should see: `devonthink: ✓ Connected`
306+
307+
2. **Test in Claude Code:**
308+
- Use `/mcp` command to verify server connection
309+
- Try asking: "Is DEVONthink running?"
310+
- Test with: "List my open databases"
311+
312+
### Management Commands
313+
314+
- **List servers:** `claude mcp list`
315+
- **Get server details:** `claude mcp get devonthink`
316+
- **Remove server:** `claude mcp remove devonthink`
317+
318+
### Important Notes
319+
320+
- **Restart Required**: If `/mcp` shows "No MCP servers configured" after adding the server, you may need to completely quit and restart Claude Code
321+
- **Scope Matters**: Local scope servers only work in the directory where they were configured
322+
- **User Scope**: Use `--scope user` to make the server available in all your projects
323+
324+
### Troubleshooting
325+
326+
#### Build Errors
327+
- **"tsc: command not found"** - Run `npm install` to install TypeScript and other dependencies
328+
- **Permission errors** - The build process makes the dist/index.js file executable automatically
329+
330+
#### Claude Desktop Connection Issues
331+
- **Server not found** - Verify the path in your Claude Desktop configuration
332+
- **DEVONthink not responding** - Ensure DEVONthink Pro (not DEVONthink Personal) is installed and running
333+
- **Permission errors** - macOS may require granting accessibility permissions to Claude Desktop
334+
335+
#### Claude Code Connection Issues
336+
- **"/mcp shows no servers"** - Try completely quitting and restarting Claude Code
337+
- **"Server not connected"** - Run `claude mcp list` to verify CLI shows server as connected
338+
- **Local vs User scope** - If server only works in specific directories, reconfigure with `--scope user`
339+
- **CLI vs IDE mismatch** - The CLI and running Claude Code process may use different configurations
340+
341+
#### Optional Tools
342+
343+
- **just** - Task runner for convenient build commands (install with `brew install just`)
344+
- **Yarn** - Alternative package manager (the project was originally developed with Yarn)
345+
138346
## Implementation Details
139347

140348
- Uses JXA (JavaScript for Automation) to control DEVONthink via AppleScript APIs

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# MicroFn MCP Server - Just Commands
1+
# DEVONthink MCP Server - Just Commands
22

33
# Default recipe to show available commands
44
default:

src/tools/getOpenDatabases.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const getOpenDatabases = async (): Promise<GetOpenDatabasesResult> => {
8888
export const getOpenDatabasesTool: Tool = {
8989
name: "get_open_databases",
9090
description:
91-
"Get a list of all currently open databases in DEVONthink. This tool is useful for discovering available databases and their properties, such as name, path, and encryption status. The returned database names can be used in other tools.\n\nIMPORTANT - Database UUIDs for Claude Codet Operations:\nThe UUID field in the results is ESSENTIAL for database root operations:\n- Use the database UUID as parentGroupUuid in create_record to create at database root\n- Use the database UUID as destinationGroupUuid in move_record to move to database root\n- Use the database UUID as parentGroupUuid in create_from_url to create at database root\n\nExample: Database UUID '5E47D6F2-5E0C-4E30-A6ED-2AC92116C3E1' represents the true root level of that database.",
91+
"Get a list of all currently open databases in DEVONthink. This tool is useful for discovering available databases and their properties, such as name, path, and encryption status. The returned database names can be used in other tools.\n\nIMPORTANT - Database UUIDs for Claude Code Operations:\nThe UUID field in the results is ESSENTIAL for database root operations:\n- Use the database UUID as parentGroupUuid in create_record to create at database root\n- Use the database UUID as destinationGroupUuid in move_record to move to database root\n- Use the database UUID as parentGroupUuid in create_from_url to create at database root\n\nExample: Database UUID '5E47D6F2-5E0C-4E30-A6ED-2AC92116C3E1' represents the true root level of that database.",
9292
inputSchema: zodToJsonSchema(GetOpenDatabasesSchema) as ToolInput,
9393
run: getOpenDatabases,
9494
};

0 commit comments

Comments
 (0)