joplin-mcp-server 1.2.0 → 1.3.0
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 +104 -106
- package/dist/bin.d.ts +1 -1
- package/dist/bin.js +14 -2141
- package/dist/bin.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1582 -1884
- package/dist/index.js.map +1 -0
- package/package.json +60 -61
package/README.md
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
This is a Node.js implementation of an MCP (Model Context Protocol) server for Joplin.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
Install via npx (no installation required):
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
|
-
|
|
10
|
+
npx joplin-mcp-server --help
|
|
9
11
|
```
|
|
10
12
|
|
|
11
13
|
## Configuration
|
|
@@ -117,54 +119,44 @@ curl http://10.255.255.254:41184/ping
|
|
|
117
119
|
- **Wrong IP**: Make sure you're using your actual Windows IP address
|
|
118
120
|
- Check with `ipconfig` on Windows (look for IPv4 Address on your active network adapter)
|
|
119
121
|
|
|
120
|
-
##
|
|
121
|
-
|
|
122
|
-
### Local Development
|
|
122
|
+
## Command Line Options
|
|
123
123
|
|
|
124
|
-
Start the server:
|
|
125
|
-
|
|
126
|
-
```bash
|
|
127
|
-
npm start
|
|
128
124
|
```
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
125
|
+
OPTIONS:
|
|
126
|
+
--env-file <file> Load environment variables from file
|
|
127
|
+
--host <hostname> Joplin hostname or IP (default: 127.0.0.1)
|
|
128
|
+
--port <port> Joplin port (default: 41184)
|
|
129
|
+
--token <token> Joplin API token
|
|
130
|
+
--transport <type> Transport type: stdio (default) or http
|
|
131
|
+
--http-port <port> HTTP server port (default: 3000, only used with --transport http)
|
|
132
|
+
--help, -h Show help message
|
|
134
133
|
```
|
|
135
134
|
|
|
136
|
-
###
|
|
137
|
-
|
|
138
|
-
After publishing to npm, you can use npx to run the server without installation:
|
|
135
|
+
### Command Line Usage Examples
|
|
139
136
|
|
|
140
137
|
```bash
|
|
141
138
|
# Using command line arguments
|
|
142
|
-
npx joplin-mcp-server --
|
|
139
|
+
npx joplin-mcp-server --token your_joplin_token
|
|
143
140
|
|
|
144
141
|
# Using environment file
|
|
145
142
|
npx joplin-mcp-server --env-file /path/to/your/.env
|
|
146
143
|
|
|
147
|
-
#
|
|
148
|
-
npx joplin-mcp-server --
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Command Line Options
|
|
144
|
+
# WSL: Connect to Windows host
|
|
145
|
+
npx joplin-mcp-server --host 192.168.0.40 --token your_token
|
|
152
146
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
--env-file <file> Load environment variables from file
|
|
156
|
-
--port <port> Joplin port (default: 41184)
|
|
157
|
-
--token <token> Joplin API token
|
|
158
|
-
--transport <type> Transport type: stdio (default) or http
|
|
159
|
-
--http-port <port> HTTP server port (default: 3000, only used with --transport http)
|
|
160
|
-
--help, -h Show help message
|
|
147
|
+
# HTTP mode (for testing with MCP Inspector)
|
|
148
|
+
npx joplin-mcp-server --transport http --token your_token
|
|
161
149
|
```
|
|
162
150
|
|
|
163
151
|
### MCP Client Configuration
|
|
164
152
|
|
|
165
153
|
#### Claude Desktop Configuration
|
|
166
154
|
|
|
167
|
-
|
|
155
|
+
**Important**: Claude Desktop does NOT support environment variable expansion (`${VAR}` syntax). You must provide values directly.
|
|
156
|
+
|
|
157
|
+
**Option 1: Using env Section (Recommended)**
|
|
158
|
+
|
|
159
|
+
Add to your `claude_desktop_config.json`:
|
|
168
160
|
|
|
169
161
|
```json
|
|
170
162
|
{
|
|
@@ -173,85 +165,111 @@ Add to your `claude_desktop_config.json` file using environment variable expansi
|
|
|
173
165
|
"command": "npx",
|
|
174
166
|
"args": ["joplin-mcp-server"],
|
|
175
167
|
"env": {
|
|
168
|
+
"JOPLIN_TOKEN": "your_actual_token_here",
|
|
176
169
|
"JOPLIN_PORT": "41184",
|
|
177
|
-
"
|
|
170
|
+
"JOPLIN_HOST": "127.0.0.1"
|
|
178
171
|
}
|
|
179
172
|
}
|
|
180
173
|
}
|
|
181
174
|
}
|
|
182
175
|
```
|
|
183
176
|
|
|
184
|
-
|
|
177
|
+
**Option 2: Using Command-Line Arguments**
|
|
185
178
|
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
|
|
179
|
+
```json
|
|
180
|
+
{
|
|
181
|
+
"mcpServers": {
|
|
182
|
+
"joplin": {
|
|
183
|
+
"command": "npx",
|
|
184
|
+
"args": ["joplin-mcp-server", "--token", "your_actual_token_here", "--port", "41184", "--host", "127.0.0.1"]
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Restart Claude Desktop after updating the configuration.
|
|
189
191
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
+
#### Claude Code Configuration
|
|
193
|
+
|
|
194
|
+
Claude Code supports environment variable expansion in `.mcp.json`.
|
|
195
|
+
|
|
196
|
+
**1. Set environment variables in your shell** (add to `~/.bashrc` or `~/.zshrc`):
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
export JOPLIN_TOKEN="your_actual_token_here"
|
|
200
|
+
export JOPLIN_PORT="41184" # Optional, defaults to 41184
|
|
201
|
+
export JOPLIN_HOST="127.0.0.1" # Optional, defaults to 127.0.0.1
|
|
192
202
|
```
|
|
193
203
|
|
|
194
|
-
|
|
204
|
+
**2. Use the included `.mcp.json` configuration**:
|
|
205
|
+
|
|
206
|
+
The repository includes a working `.mcp.json` file that uses environment variable expansion:
|
|
195
207
|
|
|
196
208
|
```json
|
|
197
209
|
{
|
|
198
210
|
"mcpServers": {
|
|
199
211
|
"joplin": {
|
|
200
212
|
"command": "npx",
|
|
201
|
-
"args": ["joplin-mcp-server"
|
|
213
|
+
"args": ["joplin-mcp-server"],
|
|
202
214
|
"env": {
|
|
203
|
-
"
|
|
204
|
-
"JOPLIN_TOKEN": "your_actual_token_here"
|
|
215
|
+
"JOPLIN_TOKEN": "${JOPLIN_TOKEN}"
|
|
205
216
|
}
|
|
206
217
|
}
|
|
207
218
|
}
|
|
208
219
|
}
|
|
209
220
|
```
|
|
210
221
|
|
|
211
|
-
|
|
222
|
+
The server will automatically use `JOPLIN_PORT` and `JOPLIN_HOST` from your shell environment, or use the defaults (127.0.0.1:41184).
|
|
212
223
|
|
|
213
|
-
|
|
224
|
+
#### Other MCP Clients (Cursor, etc.)
|
|
225
|
+
|
|
226
|
+
Most MCP clients support environment variable expansion (`${VAR}` syntax).
|
|
227
|
+
|
|
228
|
+
**With environment variables:**
|
|
214
229
|
|
|
215
230
|
```json
|
|
216
231
|
{
|
|
217
|
-
"
|
|
218
|
-
"
|
|
219
|
-
|
|
232
|
+
"mcpServers": {
|
|
233
|
+
"joplin": {
|
|
234
|
+
"command": "npx",
|
|
235
|
+
"args": ["joplin-mcp-server"],
|
|
236
|
+
"env": {
|
|
237
|
+
"JOPLIN_TOKEN": "${JOPLIN_TOKEN}",
|
|
238
|
+
"JOPLIN_PORT": "${JOPLIN_PORT}",
|
|
239
|
+
"JOPLIN_HOST": "${JOPLIN_HOST}"
|
|
240
|
+
}
|
|
241
|
+
}
|
|
220
242
|
}
|
|
221
243
|
}
|
|
222
244
|
```
|
|
223
245
|
|
|
224
|
-
|
|
246
|
+
**With direct values:**
|
|
225
247
|
|
|
226
248
|
```json
|
|
227
249
|
{
|
|
228
|
-
"
|
|
229
|
-
"
|
|
230
|
-
|
|
250
|
+
"mcpServers": {
|
|
251
|
+
"joplin": {
|
|
252
|
+
"command": "npx",
|
|
253
|
+
"args": ["joplin-mcp-server", "--token", "your_joplin_token", "--port", "41184", "--host", "127.0.0.1"]
|
|
254
|
+
}
|
|
231
255
|
}
|
|
232
256
|
}
|
|
233
257
|
```
|
|
234
258
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
Usage in Augment Code:
|
|
238
|
-
name: `joplin`
|
|
239
|
-
command: `node /path/to/your/mcp-joplin/index.js --env-file /path/to/your/mcp-joplin/.env`
|
|
240
|
-
|
|
241
|
-
Usage in mcp.json (cursor other tools)
|
|
259
|
+
**Using environment file:**
|
|
242
260
|
|
|
243
261
|
```json
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
]
|
|
262
|
+
{
|
|
263
|
+
"mcpServers": {
|
|
264
|
+
"joplin": {
|
|
265
|
+
"command": "npx",
|
|
266
|
+
"args": ["joplin-mcp-server", "--env-file", "/path/to/your/.env"]
|
|
267
|
+
}
|
|
251
268
|
}
|
|
269
|
+
}
|
|
252
270
|
```
|
|
253
271
|
|
|
254
|
-
|
|
272
|
+
## Logging
|
|
255
273
|
|
|
256
274
|
The server logs all incoming commands and outgoing responses. Logs are stored in two places:
|
|
257
275
|
|
|
@@ -466,56 +484,36 @@ Successfully retrieved: 3
|
|
|
466
484
|
|
|
467
485
|
### Local Development Setup
|
|
468
486
|
|
|
469
|
-
To test the npx command locally during development:
|
|
470
|
-
|
|
471
487
|
```bash
|
|
472
|
-
#
|
|
473
|
-
|
|
474
|
-
npm install
|
|
475
|
-
npm link
|
|
476
|
-
```
|
|
477
|
-
|
|
478
|
-
After linking, you can test your local changes immediately:
|
|
479
|
-
|
|
480
|
-
```bash
|
|
481
|
-
# Test the CLI
|
|
482
|
-
npx joplin-mcp-server --help
|
|
483
|
-
npx joplin-mcp-server --port 41184 --token your_token
|
|
484
|
-
|
|
485
|
-
# Make code changes, then test again (no rebuild needed)
|
|
486
|
-
npx joplin-mcp-server --help
|
|
487
|
-
```
|
|
488
|
-
|
|
489
|
-
### Making Changes
|
|
488
|
+
# Install dependencies
|
|
489
|
+
pnpm install
|
|
490
490
|
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
3. Test the CLI: `npx joplin-mcp-server --help`
|
|
491
|
+
# Build the project
|
|
492
|
+
pnpm build
|
|
494
493
|
|
|
495
|
-
|
|
494
|
+
# Run tests
|
|
495
|
+
pnpm test
|
|
496
496
|
|
|
497
|
-
|
|
497
|
+
# Format code
|
|
498
|
+
pnpm format
|
|
498
499
|
|
|
499
|
-
|
|
500
|
+
# Run linter
|
|
501
|
+
pnpm lint
|
|
500
502
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
+
# Run validation (format + lint + test + build)
|
|
504
|
+
pnpm validate
|
|
503
505
|
```
|
|
504
506
|
|
|
505
|
-
###
|
|
506
|
-
|
|
507
|
-
To make this package available via npx:
|
|
508
|
-
|
|
509
|
-
1. Update the version in `package.json`
|
|
510
|
-
2. Run `npm publish`
|
|
511
|
-
|
|
512
|
-
Users can then run it with `npx joplin-mcp-server`
|
|
507
|
+
### Testing Local Changes
|
|
513
508
|
|
|
514
|
-
|
|
509
|
+
```bash
|
|
510
|
+
# Link for local development
|
|
511
|
+
npm link
|
|
515
512
|
|
|
516
|
-
|
|
513
|
+
# Test the CLI
|
|
514
|
+
npx joplin-mcp-server --help
|
|
517
515
|
|
|
518
|
-
|
|
516
|
+
# Unlink when done
|
|
519
517
|
npm unlink -g joplin-mcp-server
|
|
520
518
|
```
|
|
521
519
|
|
package/dist/bin.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { };
|