remnote-mcp-server 0.1.3 → 0.2.1
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/CHANGELOG.md +48 -0
- package/README.md +198 -166
- package/dist/http-server.d.ts +21 -0
- package/dist/http-server.js +186 -0
- package/dist/http-server.js.map +1 -0
- package/dist/index.js +10 -20
- package/dist/index.js.map +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/index.js.map +1 -1
- package/package.json +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,54 @@ Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.1] - 2026-02-11
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `publish-to-npm.sh` script to automate npm publishing workflow with proper error checking
|
|
15
|
+
- Pre-flight checks: git clean, npm authentication, package.json validation
|
|
16
|
+
- Automatic code quality verification via `./code-quality.sh`
|
|
17
|
+
- Package contents verification with `npm pack --dry-run`
|
|
18
|
+
- User confirmation required before actual publish
|
|
19
|
+
- Post-publication git tag creation and push
|
|
20
|
+
- Success summary with next-step reminders (GitHub release, CHANGELOG update)
|
|
21
|
+
|
|
22
|
+
## [0.2.0] - 2026-02-11
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- **BREAKING**: Transport refactored from stdio to Streamable HTTP (SSE)
|
|
27
|
+
- Users must start server independently with `npm start` or `npm run dev`
|
|
28
|
+
- Server runs as long-running process on port 3001 (HTTP) and 3002 (WebSocket)
|
|
29
|
+
- Claude Code configuration must use `http` transport type instead of `stdio`
|
|
30
|
+
- Multiple Claude Code sessions can now connect to a single server instance
|
|
31
|
+
- TypeScript module resolution changed from "node" to "Node16" for SDK deep imports compatibility
|
|
32
|
+
- README.md "Claude Code CLI" section now includes complete `claude mcp` command examples
|
|
33
|
+
- Shows `claude mcp add` command with expected output
|
|
34
|
+
- Shows `claude mcp list` for verifying connection health
|
|
35
|
+
- Shows `claude mcp remove` for unregistering the server
|
|
36
|
+
- Positioned before manual configuration section as recommended approach
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- Multi-agent support: Multiple AI agents can now connect to the same RemNote knowledge base simultaneously
|
|
41
|
+
- HTTP MCP server with Streamable HTTP (SSE) transport for session management
|
|
42
|
+
- New `REMNOTE_HTTP_PORT` environment variable (default: 3001)
|
|
43
|
+
- Express-based HTTP server with JSON parsing middleware
|
|
44
|
+
- Session lifecycle management: multiple concurrent MCP sessions with independent state
|
|
45
|
+
- Comprehensive HTTP server test suite (15 tests covering initialization, session management, SSE streams, and error
|
|
46
|
+
cases)
|
|
47
|
+
- "Two-Component Architecture" section in README.md for consistency with RemNote MCP Bridge documentation
|
|
48
|
+
|
|
49
|
+
### Dependencies
|
|
50
|
+
|
|
51
|
+
- Added `express` ^5.2.0 for HTTP server
|
|
52
|
+
- Added `@types/express` ^5.0.0 for TypeScript support
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
|
|
56
|
+
- Fixed `remnote_status` tool action name mismatch (server sent 'status', plugin expected 'get_status')
|
|
57
|
+
|
|
10
58
|
## [0.1.3] - 2026-02-07
|
|
11
59
|
|
|
12
60
|
### Added
|
package/README.md
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
# RemNote MCP Server
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
 
|
|
4
|
+

|
|
5
|
+
[](https://codecov.io/gh/robert7/remnote-mcp-server)
|
|
5
6
|
|
|
6
|
-
MCP server that bridges
|
|
7
|
-
|
|
7
|
+
MCP server that bridges AI agents (e.g. Claude Code) to [RemNote](https://remnote.com/) via the [RemNote MCP Bridge
|
|
8
|
+
plugin](https://github.com/robert7/remnote-mcp-bridge).
|
|
8
9
|
|
|
9
10
|
## Demo
|
|
10
11
|
|
|
11
12
|
See Claude Code in action with RemNote: **[View Demo →](docs/demo.md)**
|
|
12
13
|
|
|
14
|
+
## Two-Component Architecture
|
|
15
|
+
|
|
16
|
+
This system consists of **two separate components** that work together:
|
|
17
|
+
|
|
18
|
+
1. **[RemNote MCP Bridge](https://github.com/robert7/remnote-mcp-bridge)** - A RemNote plugin that runs in your browser
|
|
19
|
+
or RemNote desktop app and exposes RemNote API functionality via WebSocket
|
|
20
|
+
2. **RemNote MCP Server** (this repository) - A standalone server that connects your AI assistant to the bridge using
|
|
21
|
+
MCP protocol
|
|
22
|
+
|
|
23
|
+
**Both components are required** for AI integration with RemNote.
|
|
24
|
+
|
|
13
25
|
## What is This?
|
|
14
26
|
|
|
15
27
|
The RemNote MCP Server enables AI assistants like Claude Code to interact directly with your RemNote knowledge base
|
|
@@ -19,13 +31,14 @@ notes, and maintain your daily journal—all through conversational commands.
|
|
|
19
31
|
**Architecture:**
|
|
20
32
|
|
|
21
33
|
```text
|
|
22
|
-
AI
|
|
34
|
+
AI agents (HTTP) ↔ MCP HTTP Server :3001 ↔ WebSocket Server :3002 ↔ RemNote Plugin ↔ RemNote
|
|
23
35
|
```
|
|
24
36
|
|
|
25
37
|
The server acts as a bridge:
|
|
26
38
|
|
|
27
|
-
- Communicates with
|
|
28
|
-
-
|
|
39
|
+
- Communicates with AI agents via Streamable HTTP transport (MCP protocol)
|
|
40
|
+
- HTTP server (port 3001) manages MCP sessions for multiple concurrent agents
|
|
41
|
+
- WebSocket server (port 3002) connects to the RemNote browser plugin
|
|
29
42
|
- Translates MCP tool calls into RemNote API actions
|
|
30
43
|
|
|
31
44
|
## Features
|
|
@@ -37,41 +50,25 @@ The server acts as a bridge:
|
|
|
37
50
|
- **Journal Entries** - Append timestamped entries to daily documents
|
|
38
51
|
- **Connection Status** - Check server and plugin connection health
|
|
39
52
|
|
|
40
|
-
##
|
|
41
|
-
|
|
42
|
-
**This MCP server enforces a strict 1:1:1 relationship:** one AI agent ↔ one MCP server instance ↔ one RemNote plugin
|
|
43
|
-
connection.
|
|
44
|
-
|
|
45
|
-
### Multi-Agent Constraints
|
|
46
|
-
|
|
47
|
-
You **cannot** use multiple AI agents (e.g., two Claude Code sessions) with the same RemNote knowledge base
|
|
48
|
-
simultaneously. Three architectural constraints prevent this:
|
|
53
|
+
## Multi-Agent Support
|
|
49
54
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
2. **WebSocket enforces single-client** - The server explicitly rejects multiple RemNote plugin connections. Only one
|
|
53
|
-
plugin instance can connect to port 3002 at a time (connection code: 1008).
|
|
54
|
-
3. **Port binding conflict** - Multiple server instances attempting to use the default port 3002 will fail with
|
|
55
|
-
`EADDRINUSE`.
|
|
55
|
+
**Multiple AI agents can now connect simultaneously!** The server uses Streamable HTTP transport, allowing multiple
|
|
56
|
+
Claude Code sessions (or other MCP clients) to access the same RemNote knowledge base concurrently.
|
|
56
57
|
|
|
57
|
-
###
|
|
58
|
+
### How It Works
|
|
58
59
|
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
|
|
60
|
+
- One long-running server process on ports 3001 (HTTP) and 3002 (WebSocket)
|
|
61
|
+
- Multiple AI agents connect via HTTP and get independent MCP sessions
|
|
62
|
+
- All sessions share the same WebSocket bridge to RemNote
|
|
63
|
+
- Concurrent requests are handled via UUID-based correlation
|
|
63
64
|
|
|
64
|
-
###
|
|
65
|
+
### Limitations
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
each with its own MCP server instance on different ports.
|
|
67
|
+
The WebSocket bridge still enforces a **single RemNote plugin connection**. This means:
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
version will migrate from stdio transport to HTTP transport (SSE), which would allow multiple AI agents to connect
|
|
73
|
-
to the same MCP server instance simultaneously. This would remove constraint #1 above while maintaining the existing
|
|
74
|
-
WebSocket bridge to RemNote.
|
|
69
|
+
- Multiple AI agents can connect to the server
|
|
70
|
+
- But only one RemNote app instance can be connected at a time
|
|
71
|
+
- This is a RemNote plugin limitation, not an MCP server limitation
|
|
75
72
|
|
|
76
73
|
## Prerequisites
|
|
77
74
|
|
|
@@ -139,23 +136,23 @@ which remnote-mcp-server
|
|
|
139
136
|
|
|
140
137
|
After unlinking, you can install the published npm package globally with `npm install -g remnote-mcp-server` if needed.
|
|
141
138
|
|
|
142
|
-
**About
|
|
139
|
+
**About Streamable HTTP Transport**
|
|
143
140
|
|
|
144
|
-
This MCP server uses [
|
|
145
|
-
|
|
146
|
-
|
|
141
|
+
This MCP server uses [Streamable HTTP
|
|
142
|
+
transport](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#http-with-sse), a communication
|
|
143
|
+
mechanism for MCP that supports multiple concurrent clients.
|
|
147
144
|
|
|
148
145
|
**Key characteristics:**
|
|
149
146
|
|
|
150
|
-
- **Lifecycle management**:
|
|
151
|
-
|
|
152
|
-
- **Message protocol**: Communication uses
|
|
153
|
-
|
|
154
|
-
- **
|
|
155
|
-
|
|
147
|
+
- **Lifecycle management**: You must start the server independently (`npm start` or `npm run dev`). Claude Code connects
|
|
148
|
+
to the running server via HTTP.
|
|
149
|
+
- **Message protocol**: Communication uses JSON-RPC over HTTP POST for requests and Server-Sent Events (SSE) for
|
|
150
|
+
notifications.
|
|
151
|
+
- **Multi-client support**: Multiple AI agents can connect simultaneously, each with their own MCP session.
|
|
152
|
+
- **Session management**: Server tracks sessions via `mcp-session-id` headers and UUID-based request correlation.
|
|
156
153
|
|
|
157
|
-
This architecture
|
|
158
|
-
boundaries. For technical details, see the [MCP
|
|
154
|
+
This architecture enables multiple Claude Code windows to access RemNote concurrently while maintaining process
|
|
155
|
+
isolation and security boundaries. For technical details, see the [MCP
|
|
159
156
|
specification](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports).
|
|
160
157
|
|
|
161
158
|
### 2. Install RemNote MCP Bridge Plugin
|
|
@@ -167,91 +164,139 @@ Install the [RemNote MCP Bridge plugin](https://github.com/robert7/remnote-mcp-b
|
|
|
167
164
|
3. Configure WebSocket URL: `ws://127.0.0.1:3002`
|
|
168
165
|
4. Enable auto-reconnect
|
|
169
166
|
|
|
170
|
-
### 3.
|
|
167
|
+
### 3. Start the Server
|
|
171
168
|
|
|
172
|
-
|
|
169
|
+
**IMPORTANT:** You must start the server before using it with Claude Code.
|
|
173
170
|
|
|
174
|
-
|
|
171
|
+
```bash
|
|
172
|
+
# Production mode
|
|
173
|
+
npm start
|
|
175
174
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
175
|
+
# OR development mode (with hot reload)
|
|
176
|
+
npm run dev
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Expected output:
|
|
180
|
+
```
|
|
181
|
+
[WebSocket Server] Listening on port 3002
|
|
182
|
+
[HTTP Server] Listening on port 3001
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Keep this terminal running. The server must be running for Claude Code to connect.
|
|
186
|
+
|
|
187
|
+
## Configuration of AI Agents
|
|
188
|
+
|
|
189
|
+
### Claude Code CLI
|
|
190
|
+
|
|
191
|
+
Use the `claude mcp` CLI commands to add, test, and remove the MCP server.
|
|
192
|
+
|
|
193
|
+
**Add the server:**
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
# goto your project directory
|
|
197
|
+
cd /Users/username/Projects/sample-project
|
|
198
|
+
claude mcp add remnote --transport http http://localhost:3001/mcp
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Example output:
|
|
202
|
+
|
|
203
|
+
```text
|
|
204
|
+
Added HTTP MCP server remnote with URL: http://localhost:3001/mcp to local config
|
|
205
|
+
File modified: /Users/username/.claude.json [project: /Users/username/Projects/sample-project]
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Verify connection:**
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
claude mcp list
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Example output:
|
|
215
|
+
|
|
216
|
+
```text
|
|
217
|
+
remnote: http://localhost:3001/mcp (HTTP) - ✓ Connected
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
As alternative you can use `/mcp` command in any Claude Code session to check the connection health.
|
|
221
|
+
|
|
222
|
+
**Using the server:**
|
|
223
|
+
|
|
224
|
+
Once configured, Claude Code automatically loads RemNote tools in your sessions. See the [Example Usage](#example-usage)
|
|
225
|
+
section below for conversational commands.
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# In any Claude Code session
|
|
229
|
+
claude
|
|
230
|
+
|
|
231
|
+
prompt:
|
|
232
|
+
show remnote note titles related do AI assisted coding
|
|
233
|
+
...
|
|
234
|
+
remnote - remnote_search (MCP)(query: "AI assisted coding", limit: 20, includeContent: false)
|
|
235
|
+
...
|
|
236
|
+
Found 20 notes related to "AI assisted coding". The main results include:
|
|
237
|
+
|
|
238
|
+
Primary note:
|
|
239
|
+
- AI assisted coding (remId: qtVwh5XBQbJM2HfSp)
|
|
240
|
+
|
|
241
|
+
Related tools/platforms:
|
|
242
|
+
- Claude Code
|
|
243
|
+
- Gemini CLI
|
|
244
|
+
...
|
|
193
245
|
```
|
|
194
246
|
|
|
195
|
-
**
|
|
247
|
+
**Remove the server:**
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
claude mcp remove remnote
|
|
251
|
+
```
|
|
196
252
|
|
|
197
|
-
|
|
198
|
-
projects
|
|
199
|
-
- **Project-specific:** Use a specific project path to limit availability to that project
|
|
200
|
-
- **Multiple projects:** Add `mcpServers` configuration under each project path as needed
|
|
253
|
+
Example output:
|
|
201
254
|
|
|
202
|
-
|
|
255
|
+
```text
|
|
256
|
+
✓ Removed MCP server "remnote"
|
|
257
|
+
Config: /Users/username/.claude.json
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Claude Code CLI (manual configuration)
|
|
261
|
+
|
|
262
|
+
If you prefer to manually configure the MCP server in Claude Code CLI instead of using `claude mcp add`, you can
|
|
263
|
+
directly edit your `~/.claude.json` file.
|
|
264
|
+
|
|
265
|
+
MCP servers are configured in `~/.claude.json` under the `mcpServers` key within project-specific sections.
|
|
266
|
+
|
|
267
|
+
**Add to your `~/.claude.json`:**
|
|
203
268
|
|
|
204
269
|
```json
|
|
205
270
|
{
|
|
206
271
|
"projects": {
|
|
207
272
|
"/Users/username": {
|
|
273
|
+
...
|
|
208
274
|
"mcpServers": {
|
|
209
275
|
"remnote": {
|
|
210
|
-
"type": "
|
|
211
|
-
"
|
|
212
|
-
"args": [],
|
|
213
|
-
"env": {
|
|
214
|
-
"REMNOTE_WS_PORT": "3002"
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
"/Users/username/Projects/my-project": {
|
|
220
|
-
"mcpServers": {
|
|
221
|
-
"remnote": {
|
|
222
|
-
"type": "stdio",
|
|
223
|
-
"command": "remnote-mcp-server",
|
|
224
|
-
"args": [],
|
|
225
|
-
"env": {
|
|
226
|
-
"REMNOTE_WS_PORT": "3002"
|
|
227
|
-
}
|
|
276
|
+
"type": "http",
|
|
277
|
+
"url": "http://localhost:3001/mcp"
|
|
228
278
|
}
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
}
|
|
279
|
+
...
|
|
232
280
|
}
|
|
233
281
|
```
|
|
234
282
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
Restart Claude Code completely to load the MCP server configuration. The server will start automatically when Claude
|
|
238
|
-
Code launches.
|
|
283
|
+
Restart Claude Code completely to load the MCP server configuration. Claude Code will connect to the running server.
|
|
239
284
|
|
|
240
285
|
## Verification
|
|
241
286
|
|
|
242
287
|
### Check Server is Running
|
|
243
288
|
|
|
244
|
-
|
|
289
|
+
Verify both ports are listening:
|
|
245
290
|
|
|
246
291
|
```bash
|
|
247
|
-
# Check
|
|
248
|
-
|
|
292
|
+
# Check HTTP port (MCP)
|
|
293
|
+
lsof -i :3001
|
|
249
294
|
|
|
250
|
-
# Check WebSocket port
|
|
295
|
+
# Check WebSocket port (RemNote bridge)
|
|
251
296
|
lsof -i :3002
|
|
252
297
|
```
|
|
253
298
|
|
|
254
|
-
You should see the `
|
|
299
|
+
You should see the `node` process listening on both ports.
|
|
255
300
|
|
|
256
301
|
### Check RemNote Plugin Connection
|
|
257
302
|
|
|
@@ -343,30 +388,22 @@ Check if RemNote is connected
|
|
|
343
388
|
|
|
344
389
|
### Environment Variables
|
|
345
390
|
|
|
391
|
+
- `REMNOTE_HTTP_PORT` - HTTP MCP server port (default: 3001)
|
|
346
392
|
- `REMNOTE_WS_PORT` - WebSocket server port (default: 3002)
|
|
347
393
|
|
|
348
|
-
**Example with custom
|
|
394
|
+
**Example with custom ports:**
|
|
349
395
|
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
"remnote": {
|
|
356
|
-
"type": "stdio",
|
|
357
|
-
"command": "remnote-mcp-server",
|
|
358
|
-
"args": [],
|
|
359
|
-
"env": {
|
|
360
|
-
"REMNOTE_WS_PORT": "3003"
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
}
|
|
396
|
+
```bash
|
|
397
|
+
# Set environment variables before starting
|
|
398
|
+
export REMNOTE_HTTP_PORT=3003
|
|
399
|
+
export REMNOTE_WS_PORT=3004
|
|
400
|
+
npm start
|
|
367
401
|
```
|
|
368
402
|
|
|
369
|
-
|
|
403
|
+
Then update your `~/.claude.json` and RemNote plugin settings to use the new ports.
|
|
404
|
+
|
|
405
|
+
**Note:** If you change the WebSocket port, you must also update the WebSocket URL in the RemNote MCP Bridge plugin
|
|
406
|
+
settings.
|
|
370
407
|
|
|
371
408
|
### RemNote Plugin Settings
|
|
372
409
|
|
|
@@ -379,43 +416,35 @@ Configure in the plugin control panel:
|
|
|
379
416
|
|
|
380
417
|
### Server Not Starting
|
|
381
418
|
|
|
382
|
-
1. **
|
|
419
|
+
1. **Verify the server is running:**
|
|
383
420
|
```bash
|
|
384
|
-
|
|
421
|
+
lsof -i :3001
|
|
422
|
+
lsof -i :3002
|
|
385
423
|
```
|
|
386
|
-
|
|
424
|
+
Both ports should show active listeners.
|
|
387
425
|
|
|
388
|
-
2. **
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
426
|
+
2. **Check server output:**
|
|
427
|
+
- You should see: `[HTTP Server] Listening on port 3001`
|
|
428
|
+
- And: `[WebSocket Server] Listening on port 3002`
|
|
429
|
+
3. **If server fails to start:**
|
|
430
|
+
- Check if ports are already in use (see "Port Already in Use" below)
|
|
431
|
+
- Verify installation: `which remnote-mcp-server`
|
|
432
|
+
- Check server logs for errors
|
|
394
433
|
|
|
395
|
-
|
|
396
|
-
```bash
|
|
397
|
-
cd ~/Projects/_private/remnote-mcp-server
|
|
398
|
-
npm link
|
|
399
|
-
```
|
|
400
|
-
|
|
401
|
-
3. **Check Claude Code logs:**
|
|
402
|
-
```bash
|
|
403
|
-
tail -f ~/.claude/debug/mcp-*.log
|
|
404
|
-
```
|
|
434
|
+
### Port Already in Use
|
|
405
435
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
If you see "EADDRINUSE" error:
|
|
436
|
+
If you see "EADDRINUSE" error for port 3001 or 3002:
|
|
409
437
|
|
|
410
438
|
```bash
|
|
411
|
-
# Find what's using the
|
|
439
|
+
# Find what's using the ports
|
|
440
|
+
lsof -i :3001
|
|
412
441
|
lsof -i :3002
|
|
413
442
|
|
|
414
443
|
# Kill the process if needed
|
|
415
444
|
kill -9 <PID>
|
|
416
445
|
```
|
|
417
446
|
|
|
418
|
-
Alternatively, configure
|
|
447
|
+
Alternatively, configure different ports using environment variables (see Configuration section).
|
|
419
448
|
|
|
420
449
|
### Plugin Won't Connect
|
|
421
450
|
|
|
@@ -447,32 +476,34 @@ Alternatively, configure a different port in both `~/.claude.json` and the RemNo
|
|
|
447
476
|
|
|
448
477
|
### Configuration Not Working
|
|
449
478
|
|
|
450
|
-
**Common
|
|
479
|
+
**Common issues:**
|
|
480
|
+
|
|
481
|
+
❌ **Wrong transport type:**
|
|
482
|
+
```json
|
|
483
|
+
"type": "stdio" // OLD - doesn't work anymore
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
✅ **Correct transport type:**
|
|
487
|
+
```json
|
|
488
|
+
"type": "http" // NEW - required
|
|
489
|
+
```
|
|
451
490
|
|
|
452
|
-
❌ **
|
|
491
|
+
❌ **Using command instead of URL:**
|
|
453
492
|
```json
|
|
454
|
-
// File: ~/.claude/.mcp.json
|
|
455
493
|
{
|
|
456
|
-
"
|
|
494
|
+
"type": "stdio",
|
|
495
|
+
"command": "remnote-mcp-server" // OLD
|
|
457
496
|
}
|
|
458
497
|
```
|
|
459
498
|
|
|
460
|
-
✅ **Correct
|
|
499
|
+
✅ **Correct configuration:**
|
|
461
500
|
```json
|
|
462
|
-
// File: ~/.claude.json
|
|
463
501
|
{
|
|
464
|
-
"
|
|
465
|
-
|
|
466
|
-
"mcpServers": {
|
|
467
|
-
"remnote": { ... }
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
}
|
|
502
|
+
"type": "http",
|
|
503
|
+
"url": "http://127.0.0.1:3001/mcp" // NEW
|
|
471
504
|
}
|
|
472
505
|
```
|
|
473
506
|
|
|
474
|
-
The `enabledMcpjsonServers` setting in `~/.claude/settings.json` is also deprecated and no longer needed.
|
|
475
|
-
|
|
476
507
|
## Development
|
|
477
508
|
|
|
478
509
|
### Setup
|
|
@@ -513,10 +544,9 @@ Run `./code-quality.sh` to ensure all checks pass.
|
|
|
513
544
|
|
|
514
545
|
### Manual Testing
|
|
515
546
|
|
|
516
|
-
To test the server
|
|
547
|
+
To test the server:
|
|
517
548
|
|
|
518
549
|
```bash
|
|
519
|
-
# Stop Claude Code first to free port 3002
|
|
520
550
|
cd ~/Projects/_private/remnote-mcp-server
|
|
521
551
|
npm run dev
|
|
522
552
|
```
|
|
@@ -524,7 +554,7 @@ npm run dev
|
|
|
524
554
|
Expected output:
|
|
525
555
|
```
|
|
526
556
|
[WebSocket Server] Listening on port 3002
|
|
527
|
-
[
|
|
557
|
+
[HTTP Server] Listening on port 3001
|
|
528
558
|
```
|
|
529
559
|
|
|
530
560
|
When the RemNote plugin connects:
|
|
@@ -533,11 +563,13 @@ When the RemNote plugin connects:
|
|
|
533
563
|
[RemNote Bridge] RemNote plugin connected
|
|
534
564
|
```
|
|
535
565
|
|
|
566
|
+
When Claude Code connects, you'll see HTTP requests in the logs.
|
|
567
|
+
|
|
536
568
|
Press Ctrl+C to stop.
|
|
537
569
|
|
|
538
570
|
### Development Documentation
|
|
539
571
|
|
|
540
|
-
- **[
|
|
572
|
+
- **[docs/architecture.md](./docs/architecture.md)** - Architecture and design rationale
|
|
541
573
|
- **[AGENTS.md](./AGENTS.md)** - AI agent and developer guidance
|
|
542
574
|
- **[CHANGELOG.md](./CHANGELOG.md)** - Version history
|
|
543
575
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { WebSocketServer } from './websocket-server.js';
|
|
2
|
+
interface ServerInfo {
|
|
3
|
+
name: string;
|
|
4
|
+
version: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class HttpMcpServer {
|
|
7
|
+
private app;
|
|
8
|
+
private server;
|
|
9
|
+
private port;
|
|
10
|
+
private wsServer;
|
|
11
|
+
private serverInfo;
|
|
12
|
+
private transports;
|
|
13
|
+
constructor(port: number, wsServer: WebSocketServer, serverInfo: ServerInfo);
|
|
14
|
+
private setupRoutes;
|
|
15
|
+
private initializeNewSession;
|
|
16
|
+
private handleSessionRequest;
|
|
17
|
+
start(): Promise<void>;
|
|
18
|
+
stop(): Promise<void>;
|
|
19
|
+
getActiveSessionCount(): number;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
|
+
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
3
|
+
import express from 'express';
|
|
4
|
+
import { randomUUID } from 'crypto';
|
|
5
|
+
import { registerAllTools } from './tools/index.js';
|
|
6
|
+
export class HttpMcpServer {
|
|
7
|
+
app;
|
|
8
|
+
server = null;
|
|
9
|
+
port;
|
|
10
|
+
wsServer;
|
|
11
|
+
serverInfo;
|
|
12
|
+
transports = new Map();
|
|
13
|
+
constructor(port, wsServer, serverInfo) {
|
|
14
|
+
this.port = port;
|
|
15
|
+
this.wsServer = wsServer;
|
|
16
|
+
this.serverInfo = serverInfo;
|
|
17
|
+
// Create Express app with JSON parsing
|
|
18
|
+
this.app = express();
|
|
19
|
+
this.app.use(express.json());
|
|
20
|
+
// Route handlers
|
|
21
|
+
this.setupRoutes();
|
|
22
|
+
}
|
|
23
|
+
setupRoutes() {
|
|
24
|
+
// POST: Handle session initialization and requests
|
|
25
|
+
this.app.post('/mcp', async (req, res) => {
|
|
26
|
+
try {
|
|
27
|
+
const sessionId = req.headers['mcp-session-id'];
|
|
28
|
+
const body = req.body;
|
|
29
|
+
// Check if this is an initialize request
|
|
30
|
+
const isInitializeRequest = body && body.method === 'initialize' && body.jsonrpc === '2.0';
|
|
31
|
+
if (!sessionId && isInitializeRequest) {
|
|
32
|
+
// New session initialization
|
|
33
|
+
await this.initializeNewSession(req, res, body);
|
|
34
|
+
}
|
|
35
|
+
else if (sessionId) {
|
|
36
|
+
// Existing session request
|
|
37
|
+
await this.handleSessionRequest(sessionId, req, res, body);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// Missing session ID for non-initialize request
|
|
41
|
+
res.status(400).json({
|
|
42
|
+
jsonrpc: '2.0',
|
|
43
|
+
error: {
|
|
44
|
+
code: -32600,
|
|
45
|
+
message: 'Missing mcp-session-id header for non-initialize request',
|
|
46
|
+
},
|
|
47
|
+
id: body?.id ?? null,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
console.error('[HTTP Server] Error handling POST request:', error);
|
|
53
|
+
res.status(500).json({
|
|
54
|
+
jsonrpc: '2.0',
|
|
55
|
+
error: {
|
|
56
|
+
code: -32603,
|
|
57
|
+
message: error instanceof Error ? error.message : String(error),
|
|
58
|
+
},
|
|
59
|
+
id: null,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
// GET: SSE stream for session notifications
|
|
64
|
+
this.app.get('/mcp', async (req, res) => {
|
|
65
|
+
const sessionId = req.headers['mcp-session-id'];
|
|
66
|
+
if (!sessionId) {
|
|
67
|
+
res.status(400).json({ error: 'Missing mcp-session-id header' });
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const transport = this.transports.get(sessionId);
|
|
71
|
+
if (!transport) {
|
|
72
|
+
res.status(404).json({ error: `Session not found: ${sessionId}` });
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
// Let transport handle SSE stream setup
|
|
76
|
+
await transport.handleRequest(req, res);
|
|
77
|
+
});
|
|
78
|
+
// DELETE: Terminate session
|
|
79
|
+
this.app.delete('/mcp', async (req, res) => {
|
|
80
|
+
const sessionId = req.headers['mcp-session-id'];
|
|
81
|
+
if (!sessionId) {
|
|
82
|
+
res.status(400).json({ error: 'Missing mcp-session-id header' });
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const transport = this.transports.get(sessionId);
|
|
86
|
+
if (!transport) {
|
|
87
|
+
res.status(404).json({ error: `Session not found: ${sessionId}` });
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
// Let transport handle session termination
|
|
91
|
+
await transport.handleRequest(req, res);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
async initializeNewSession(req, res, body) {
|
|
95
|
+
// Create new transport with session ID generator
|
|
96
|
+
const transport = new StreamableHTTPServerTransport({
|
|
97
|
+
sessionIdGenerator: () => randomUUID(),
|
|
98
|
+
onsessioninitialized: (sessionId) => {
|
|
99
|
+
this.transports.set(sessionId, transport);
|
|
100
|
+
console.error(`[HTTP Server] New session initialized: ${sessionId}`);
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
// Set up onclose handler to clean up transport when closed
|
|
104
|
+
transport.onclose = () => {
|
|
105
|
+
const sessionId = transport.sessionId;
|
|
106
|
+
if (sessionId && this.transports.has(sessionId)) {
|
|
107
|
+
console.error(`[HTTP Server] Session closed: ${sessionId}`);
|
|
108
|
+
this.transports.delete(sessionId);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
// Create new MCP server instance for this session
|
|
112
|
+
const server = new Server(this.serverInfo, {
|
|
113
|
+
capabilities: {
|
|
114
|
+
tools: {},
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
// Register all tools with the shared WebSocket server
|
|
118
|
+
registerAllTools(server, this.wsServer);
|
|
119
|
+
// Connect server to transport
|
|
120
|
+
await server.connect(transport);
|
|
121
|
+
// Handle the initialize request
|
|
122
|
+
await transport.handleRequest(req, res, body);
|
|
123
|
+
}
|
|
124
|
+
async handleSessionRequest(sessionId, req, res, body) {
|
|
125
|
+
const transport = this.transports.get(sessionId);
|
|
126
|
+
if (!transport) {
|
|
127
|
+
res.status(400).json({
|
|
128
|
+
jsonrpc: '2.0',
|
|
129
|
+
error: {
|
|
130
|
+
code: -32600,
|
|
131
|
+
message: `Invalid session ID: ${sessionId}`,
|
|
132
|
+
},
|
|
133
|
+
id: body?.id ?? null,
|
|
134
|
+
});
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
await transport.handleRequest(req, res, body);
|
|
138
|
+
}
|
|
139
|
+
async start() {
|
|
140
|
+
return new Promise((resolve, reject) => {
|
|
141
|
+
try {
|
|
142
|
+
this.server = this.app.listen(this.port, () => {
|
|
143
|
+
console.error(`[HTTP Server] Listening on port ${this.port}`);
|
|
144
|
+
resolve();
|
|
145
|
+
});
|
|
146
|
+
this.server.on('error', (error) => {
|
|
147
|
+
console.error('[HTTP Server] Server error:', error);
|
|
148
|
+
reject(error);
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
reject(error);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
async stop() {
|
|
157
|
+
// Close all active transports
|
|
158
|
+
for (const [sessionId, transport] of this.transports.entries()) {
|
|
159
|
+
try {
|
|
160
|
+
console.error(`[HTTP Server] Closing session: ${sessionId}`);
|
|
161
|
+
await transport.close();
|
|
162
|
+
this.transports.delete(sessionId);
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
console.error(`[HTTP Server] Error closing session ${sessionId}:`, error);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// Close HTTP server
|
|
169
|
+
return new Promise((resolve) => {
|
|
170
|
+
if (this.server) {
|
|
171
|
+
this.server.close(() => {
|
|
172
|
+
console.error('[HTTP Server] Server stopped');
|
|
173
|
+
this.server = null;
|
|
174
|
+
resolve();
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
resolve();
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
getActiveSessionCount() {
|
|
183
|
+
return this.transports.size;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=http-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-server.js","sourceRoot":"","sources":["../src/http-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,OAAsD,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,E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gBACf,OAAO,CAAC,KAAK,CAAC,uCAAuC,SAAS,GAAG,EAAE,KAAK,CAAC,CAAC;YAC5E,CAAC;QACH,CAAC;QAED,oBAAoB;QACpB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7B,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE;oBACrB,OAAO,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;oBAC9C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;oBACnB,OAAO,EAAE,CAAC;gBACZ,CAAC,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,qBAAqB;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF"}
|
package/dist/index.js
CHANGED
|
@@ -1,25 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
-
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
2
|
import { createRequire } from 'module';
|
|
5
3
|
import { WebSocketServer } from './websocket-server.js';
|
|
6
|
-
import {
|
|
4
|
+
import { HttpMcpServer } from './http-server.js';
|
|
7
5
|
const require = createRequire(import.meta.url);
|
|
8
6
|
const packageJson = require('../package.json');
|
|
9
7
|
const WS_PORT = parseInt(process.env.REMNOTE_WS_PORT || '3002', 10);
|
|
8
|
+
const HTTP_PORT = parseInt(process.env.REMNOTE_HTTP_PORT || '3001', 10);
|
|
10
9
|
async function main() {
|
|
11
|
-
// Initialize MCP server
|
|
12
|
-
const mcpServer = new Server({
|
|
13
|
-
name: 'remnote-mcp-server',
|
|
14
|
-
version: packageJson.version,
|
|
15
|
-
}, {
|
|
16
|
-
capabilities: {
|
|
17
|
-
tools: {},
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
10
|
// Initialize WebSocket server for RemNote plugin
|
|
21
11
|
const wsServer = new WebSocketServer(WS_PORT);
|
|
22
|
-
// Log connection status
|
|
12
|
+
// Log connection status
|
|
23
13
|
wsServer.onClientConnect(() => {
|
|
24
14
|
console.error('[RemNote Bridge] RemNote plugin connected');
|
|
25
15
|
});
|
|
@@ -29,17 +19,17 @@ async function main() {
|
|
|
29
19
|
// Start WebSocket server
|
|
30
20
|
await wsServer.start();
|
|
31
21
|
console.error(`[WebSocket Server] Listening on port ${WS_PORT}`);
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
// Initialize HTTP MCP server
|
|
23
|
+
const httpServer = new HttpMcpServer(HTTP_PORT, wsServer, {
|
|
24
|
+
name: 'remnote-mcp-server',
|
|
25
|
+
version: packageJson.version,
|
|
26
|
+
});
|
|
27
|
+
await httpServer.start();
|
|
38
28
|
// Graceful shutdown
|
|
39
29
|
const shutdown = async () => {
|
|
40
30
|
console.error('[MCP Server] Shutting down...');
|
|
31
|
+
await httpServer.stop();
|
|
41
32
|
await wsServer.stop();
|
|
42
|
-
await mcpServer.close();
|
|
43
33
|
process.exit(0);
|
|
44
34
|
};
|
|
45
35
|
process.on('SIGINT', shutdown);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,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AAC;IAClB,CAAC,CAAC;IAEF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/tools/index.js
CHANGED
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAEnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,sEAAsE;IACnF,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE;YAC/D,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8CAA8C,EAAE;YACxF,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE;YAC1D,IAAI,EAAE,EAAE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E;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,8BAA8B;IAC9B,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QAC5D,KAAK,EAAE;YACL,gBAAgB;YAChB,WAAW;YACX,cAAc;YACd,gBAAgB;YAChB,mBAAmB;YACnB,WAAW;SACZ;KACF,CAAC,CAAC,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "remnote-mcp-server",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "MCP server bridge for RemNote knowledge base",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -53,10 +53,12 @@
|
|
|
53
53
|
"homepage": "https://github.com/robert7/remnote-mcp-server#readme",
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
56
|
+
"express": "^5.2.0",
|
|
56
57
|
"ws": "^8.19.0",
|
|
57
58
|
"zod": "^4.3.6"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
61
|
+
"@types/express": "^5.0.0",
|
|
60
62
|
"@types/node": "^25.2.1",
|
|
61
63
|
"@types/ws": "^8.18.1",
|
|
62
64
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|