remnote-mcp-server 0.3.0 → 0.4.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/CHANGELOG.md +45 -1
- package/README.md +104 -411
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +21 -0
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +2 -0
- package/dist/config.js +6 -0
- package/dist/config.js.map +1 -1
- package/dist/http-server.d.ts +2 -1
- package/dist/http-server.js +5 -3
- package/dist/http-server.js.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/logger.js +40 -7
- package/dist/logger.js.map +1 -1
- package/dist/websocket-server.d.ts +2 -1
- package/dist/websocket-server.js +5 -3
- package/dist/websocket-server.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,51 @@ Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.4.0] - 2026-02-14
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Host binding configuration for HTTP and WebSocket servers
|
|
15
|
+
- `--http-host` CLI option to control HTTP server binding address
|
|
16
|
+
- `REMNOTE_HTTP_HOST` environment variable for HTTP server binding
|
|
17
|
+
- Support for binding HTTP server to `0.0.0.0` for remote access (Docker, VPS deployments)
|
|
18
|
+
- Host validation in CLI with support for localhost, 127.0.0.1, 0.0.0.0, and valid IPv4 addresses
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- HTTP server can now bind to configurable host address (default: 127.0.0.1)
|
|
23
|
+
- Improved logging to show bound host addresses on startup
|
|
24
|
+
- Updated all tests to pass host parameters to server constructors
|
|
25
|
+
|
|
26
|
+
### Security
|
|
27
|
+
|
|
28
|
+
- WebSocket server host binding enforced to localhost (127.0.0.1) only - cannot be overridden
|
|
29
|
+
- Ensures RemNote plugin connection is never exposed remotely
|
|
30
|
+
|
|
31
|
+
### Documentation
|
|
32
|
+
|
|
33
|
+
- Streamlined README.md, created `docs/guides/` with focused guides
|
|
34
|
+
- Created dedicated configuration guides for each AI client (Claude Code, Accomplish, Claude Cowork)
|
|
35
|
+
- Fixed curl examples to include required `Accept: application/json, text/event-stream` header
|
|
36
|
+
- Corrected ngrok documentation: clarified 0.0.0.0 is for Docker/VPS, not needed for ngrok
|
|
37
|
+
- Enhanced demo documentation with multi-client examples (Claude Code, Accomplish, Claude Cowork)
|
|
38
|
+
|
|
39
|
+
### Internal
|
|
40
|
+
|
|
41
|
+
- Fixed intermittent test failures on GitHub Actions caused by race condition between HTTP server start and connection
|
|
42
|
+
readiness
|
|
43
|
+
- Fixed intermittent logger test failures on GitHub Actions caused by missing directory creation before file logger
|
|
44
|
+
instantiation
|
|
45
|
+
|
|
46
|
+
## [0.3.1] - 2026-02-12
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
|
|
50
|
+
- Fixed crash on global installation when `pino-pretty` (devDependency) is unavailable
|
|
51
|
+
- Added graceful fallback to JSON logging when pretty transport initialization fails
|
|
52
|
+
- Logs warning to console when pretty logging unavailable but requested
|
|
53
|
+
- Maintains development experience while ensuring production robustness
|
|
54
|
+
|
|
10
55
|
## [0.3.0] - 2026-02-12
|
|
11
56
|
|
|
12
57
|
### Added
|
|
@@ -141,7 +186,6 @@ Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
141
186
|
- Files field in package.json to explicitly control published files
|
|
142
187
|
- prepublishOnly script to ensure build before publishing
|
|
143
188
|
- Additional keywords for improved npm discoverability
|
|
144
|
-
- Coauthorship policy documented in CLAUDE.md
|
|
145
189
|
- Publishing documentation in docs/publishing.md for maintainers
|
|
146
190
|
|
|
147
191
|
### Fixed
|
package/README.md
CHANGED
|
@@ -7,28 +7,31 @@
|
|
|
7
7
|
MCP server that bridges AI agents (e.g. Claude Code) to [RemNote](https://remnote.com/) via the [RemNote MCP Bridge
|
|
8
8
|
plugin](https://github.com/robert7/remnote-mcp-bridge).
|
|
9
9
|
|
|
10
|
+
> This is a working **proof-of-concept/experimental solution**. It "works on my machine" — you're invited to test
|
|
11
|
+
> it and [report any bugs or issues](https://github.com/robert7/remnote-mcp-server/issues).
|
|
12
|
+
|
|
13
|
+
## What is This?
|
|
14
|
+
|
|
15
|
+
The RemNote MCP Server enables AI assistants like Claude Code to interact directly with your RemNote knowledge base
|
|
16
|
+
through the Model Context Protocol (MCP). Create notes, search your knowledge base, update existing notes, and maintain
|
|
17
|
+
your daily journal—all through conversational commands.
|
|
18
|
+
|
|
10
19
|
## Demo
|
|
11
20
|
|
|
12
|
-
See
|
|
21
|
+
See AI agent examples in action with RemNote: **[View Demo →](docs/demo.md)**
|
|
13
22
|
|
|
14
|
-
|
|
23
|
+
### Two-Component Architecture
|
|
15
24
|
|
|
16
25
|
This system consists of **two separate components** that work together:
|
|
17
26
|
|
|
18
27
|
1. **[RemNote MCP Bridge](https://github.com/robert7/remnote-mcp-bridge)** - A RemNote plugin that runs in your browser
|
|
19
28
|
or RemNote desktop app and exposes RemNote API functionality via WebSocket
|
|
20
|
-
2. **RemNote MCP Server** (this
|
|
21
|
-
|
|
29
|
+
2. **RemNote MCP Server** (this project) - A standalone server that connects your AI assistant to the bridge using MCP
|
|
30
|
+
protocol
|
|
22
31
|
|
|
23
32
|
**Both components are required** for AI integration with RemNote.
|
|
24
33
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
The RemNote MCP Server enables AI assistants like Claude Code to interact directly with your RemNote knowledge base
|
|
28
|
-
through the Model Context Protocol (MCP). This allows you to create notes, search your knowledge base, update existing
|
|
29
|
-
notes, and maintain your daily journal—all through conversational commands.
|
|
30
|
-
|
|
31
|
-
**Architecture:**
|
|
34
|
+
### How It Works
|
|
32
35
|
|
|
33
36
|
```text
|
|
34
37
|
AI agents (HTTP) ↔ MCP HTTP Server :3001 ↔ WebSocket Server :3002 ↔ RemNote Plugin ↔ RemNote
|
|
@@ -36,29 +39,17 @@ AI agents (HTTP) ↔ MCP HTTP Server :3001 ↔ WebSocket Server :3002 ↔ RemNot
|
|
|
36
39
|
|
|
37
40
|
The server acts as a bridge:
|
|
38
41
|
|
|
39
|
-
- Communicates with AI agents via Streamable HTTP transport (MCP protocol)
|
|
42
|
+
- Communicates with AI agents via Streamable HTTP transport (MCP protocol) - supports both local and remote access
|
|
40
43
|
- HTTP server (port 3001) manages MCP sessions for multiple concurrent agents
|
|
41
44
|
- WebSocket server (port 3002) connects to the RemNote browser plugin
|
|
42
45
|
- Translates MCP tool calls into RemNote API actions
|
|
43
46
|
|
|
44
|
-
**
|
|
47
|
+
**Multi-Agent Support:** Multiple AI agents can connect simultaneously to the same RemNote knowledge base. Each agent
|
|
48
|
+
gets its own MCP session while sharing the WebSocket bridge.
|
|
45
49
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
**Key characteristics:**
|
|
51
|
-
|
|
52
|
-
- **Lifecycle management**: You must start the server independently (`npm start` or `npm run dev`). Claude Code connects
|
|
53
|
-
to the running server via HTTP.
|
|
54
|
-
- **Message protocol**: Communication uses JSON-RPC over HTTP POST for requests and Server-Sent Events (SSE) for
|
|
55
|
-
notifications.
|
|
56
|
-
- **Multi-client support**: Multiple AI agents can connect simultaneously, each with their own MCP session.
|
|
57
|
-
- **Session management**: Server tracks sessions via `mcp-session-id` headers and UUID-based request correlation.
|
|
58
|
-
|
|
59
|
-
This architecture enables multiple Claude Code windows to access RemNote concurrently while maintaining process
|
|
60
|
-
isolation and security boundaries. For technical details, see the [MCP
|
|
61
|
-
specification](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports).
|
|
50
|
+
**Remote Access:** By default, the server binds to localhost (127.0.0.1) for local AI agents. Cloud-based services like
|
|
51
|
+
Claude Cowork require remote access—use tunneling tools like ngrok to expose the HTTP endpoint securely. The WebSocket
|
|
52
|
+
connection always stays local for security. See [Remote Access Guide](docs/guides/remote-access.md) for setup.
|
|
62
53
|
|
|
63
54
|
## Features
|
|
64
55
|
|
|
@@ -69,479 +60,174 @@ specification](https://modelcontextprotocol.io/specification/2025-06-18/basic/tr
|
|
|
69
60
|
- **Journal Entries** - Append timestamped entries to daily documents
|
|
70
61
|
- **Connection Status** - Check server and plugin connection health
|
|
71
62
|
|
|
72
|
-
##
|
|
73
|
-
|
|
74
|
-
**Multiple AI agents can now connect simultaneously!** The server uses Streamable HTTP transport, allowing multiple
|
|
75
|
-
Claude Code sessions (or other MCP clients) to access the same RemNote knowledge base concurrently.
|
|
76
|
-
|
|
77
|
-
### How It Works
|
|
78
|
-
|
|
79
|
-
- One long-running server process on ports 3001 (HTTP) and 3002 (WebSocket)
|
|
80
|
-
- Multiple AI agents connect via HTTP and get independent MCP sessions
|
|
81
|
-
- All sessions share the same WebSocket bridge to RemNote
|
|
82
|
-
- Concurrent requests are handled via UUID-based correlation
|
|
83
|
-
|
|
84
|
-
### Limitations
|
|
85
|
-
|
|
86
|
-
The WebSocket bridge still enforces a **single RemNote plugin connection**. This means:
|
|
87
|
-
|
|
88
|
-
- Multiple AI agents can connect to the server
|
|
89
|
-
- But only one RemNote app instance can be connected at a time
|
|
90
|
-
- This is a RemNote plugin limitation, not an MCP server limitation
|
|
63
|
+
## Quick Start
|
|
91
64
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
- **Node.js** >= 18.0.0
|
|
95
|
-
- **RemNote app** with [RemNote MCP Bridge plugin](https://github.com/robert7/remnote-mcp-bridge) installed
|
|
96
|
-
- **Claude Code CLI** installed and configured
|
|
97
|
-
|
|
98
|
-
## Installation
|
|
99
|
-
|
|
100
|
-
### 1. Install the MCP Server
|
|
101
|
-
|
|
102
|
-
**From npm (recommended for most users):**
|
|
103
|
-
|
|
104
|
-
See [MCP Server npm Package](https://www.npmjs.com/package/remnote-mcp-server).
|
|
65
|
+
### 1. Install the Server
|
|
105
66
|
|
|
106
67
|
```bash
|
|
107
|
-
# Install globally
|
|
108
68
|
npm install -g remnote-mcp-server
|
|
109
|
-
|
|
110
|
-
# Verify installation
|
|
111
|
-
which remnote-mcp-server
|
|
112
|
-
# Should output: /path/to/node/bin/remnote-mcp-server
|
|
113
69
|
```
|
|
114
70
|
|
|
115
|
-
|
|
71
|
+
### 2. Install the RemNote Plugin
|
|
116
72
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
**From source (for development):**
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
git clone https://github.com/robert7/remnote-mcp-server.git
|
|
126
|
-
cd remnote-mcp-server
|
|
127
|
-
npm install
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### 2. Install RemNote MCP Bridge Plugin
|
|
131
|
-
|
|
132
|
-
Install the [RemNote MCP Bridge plugin](https://github.com/robert7/remnote-mcp-bridge) in your RemNote app:
|
|
133
|
-
|
|
134
|
-
1. Open RemNote
|
|
135
|
-
2. Navigate to plugin installation (see plugin repository for instructions)
|
|
73
|
+
Install the [RemNote MCP Bridge plugin](https://github.com/robert7/remnote-mcp-bridge) in your RemNote app. Currently
|
|
74
|
+
available from GitHub; registration in the RemNote marketplace is pending approval. Configure the plugin to connect
|
|
75
|
+
to `ws://127.0.0.1:3002`.
|
|
136
76
|
|
|
137
77
|
### 3. Start the Server
|
|
138
78
|
|
|
139
|
-
**IMPORTANT:** You must start the server before using it with Claude Code.
|
|
140
|
-
|
|
141
79
|
```bash
|
|
142
|
-
# Start with default settings
|
|
143
80
|
remnote-mcp-server
|
|
144
|
-
|
|
145
|
-
# With custom ports
|
|
146
|
-
remnote-mcp-server --ws-port 4002 --http-port 4001
|
|
147
|
-
|
|
148
|
-
# With verbose logging
|
|
149
|
-
remnote-mcp-server --verbose
|
|
150
|
-
|
|
151
|
-
# With file logging
|
|
152
|
-
remnote-mcp-server --log-file /tmp/remnote-mcp.log --log-level-file debug
|
|
153
|
-
|
|
154
|
-
# OR development mode (with hot reload)
|
|
155
|
-
npm run dev
|
|
156
|
-
# you can also pass CLI options after `--`, e.g.
|
|
157
|
-
npm run dev -- -h
|
|
158
81
|
```
|
|
159
82
|
|
|
160
|
-
**CLI Options:**
|
|
161
|
-
|
|
162
|
-
Server Configuration:
|
|
163
|
-
- `--ws-port <number>` - WebSocket port (default: 3002, env: REMNOTE_WS_PORT)
|
|
164
|
-
- `--http-port <number>` - HTTP MCP port (default: 3001, env: REMNOTE_HTTP_PORT)
|
|
165
|
-
|
|
166
|
-
Logging Configuration:
|
|
167
|
-
- `--log-level <level>` - Console log level: debug, info, warn, error (default: info)
|
|
168
|
-
- `--log-level-file <level>` - File log level (default: same as --log-level)
|
|
169
|
-
- `--verbose` - Shorthand for --log-level debug
|
|
170
|
-
- `--log-file <path>` - Log to file (default: console only)
|
|
171
|
-
- `--request-log <path>` - Log all WebSocket requests to file (JSON Lines)
|
|
172
|
-
- `--response-log <path>` - Log all WebSocket responses to file (JSON Lines)
|
|
173
|
-
|
|
174
|
-
Information:
|
|
175
|
-
- `-h, --help` - Display help message
|
|
176
|
-
- `-v, --version` - Display version number
|
|
177
|
-
|
|
178
83
|
Expected output:
|
|
179
|
-
```
|
|
180
|
-
RemNote MCP Server v0.2.1 listening { wsPort: 3002, httpPort: 3001 }
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
Keep this terminal running. The server must be running for Claude Code to connect.
|
|
184
|
-
|
|
185
|
-
## Configuration of AI Agents
|
|
186
|
-
|
|
187
|
-
### Claude Code CLI
|
|
188
|
-
|
|
189
|
-
Use the `claude mcp` CLI commands to add, test, and remove the MCP server.
|
|
190
|
-
|
|
191
|
-
**Add the server:**
|
|
192
|
-
|
|
193
|
-
```bash
|
|
194
|
-
# goto your project directory
|
|
195
|
-
cd /Users/username/Projects/sample-project
|
|
196
|
-
claude mcp add remnote --transport http http://localhost:3001/mcp
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
Example output:
|
|
200
|
-
|
|
201
|
-
```text
|
|
202
|
-
Added HTTP MCP server remnote with URL: http://localhost:3001/mcp to local config
|
|
203
|
-
File modified: /Users/username/.claude.json [project: /Users/username/Projects/sample-project]
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
**Verify connection:**
|
|
207
|
-
|
|
208
|
-
```bash
|
|
209
|
-
claude mcp list
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
Example output:
|
|
213
84
|
|
|
214
85
|
```text
|
|
215
|
-
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
As alternative you can use `/mcp` command in any Claude Code session to check the connection health.
|
|
219
|
-
|
|
220
|
-
**Using the server:**
|
|
221
|
-
|
|
222
|
-
Once configured, Claude Code automatically loads RemNote tools in your sessions. See the [Example Usage](#example-usage)
|
|
223
|
-
section below for conversational commands.
|
|
224
|
-
|
|
225
|
-
```bash
|
|
226
|
-
# In any Claude Code session
|
|
227
|
-
claude
|
|
228
|
-
|
|
229
|
-
prompt:
|
|
230
|
-
show remnote note titles related do AI assisted coding
|
|
231
|
-
...
|
|
232
|
-
remnote - remnote_search (MCP)(query: "AI assisted coding", limit: 20, includeContent: false)
|
|
233
|
-
...
|
|
234
|
-
Found 20 notes related to "AI assisted coding". The main results include:
|
|
235
|
-
|
|
236
|
-
Primary note:
|
|
237
|
-
- AI assisted coding (remId: qtVwh5XBQbJM2HfSp)
|
|
238
|
-
|
|
239
|
-
Related tools/platforms:
|
|
240
|
-
- Claude Code
|
|
241
|
-
- Gemini CLI
|
|
242
|
-
...
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
**Remove the server:**
|
|
246
|
-
|
|
247
|
-
```bash
|
|
248
|
-
claude mcp remove remnote
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
Example output:
|
|
252
|
-
|
|
253
|
-
```text
|
|
254
|
-
✓ Removed MCP server "remnote"
|
|
255
|
-
Config: /Users/username/.claude.json
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
### Claude Code CLI (manual configuration)
|
|
259
|
-
|
|
260
|
-
If you prefer to manually configure the MCP server in Claude Code CLI instead of using `claude mcp add`, you can
|
|
261
|
-
directly edit your `~/.claude.json` file.
|
|
262
|
-
|
|
263
|
-
MCP servers are configured in `~/.claude.json` under the `mcpServers` key within project-specific sections.
|
|
264
|
-
|
|
265
|
-
**Add to your `~/.claude.json`:**
|
|
266
|
-
|
|
267
|
-
```json
|
|
268
|
-
{
|
|
269
|
-
"projects": {
|
|
270
|
-
"/Users/username": {
|
|
271
|
-
...
|
|
272
|
-
"mcpServers": {
|
|
273
|
-
"remnote": {
|
|
274
|
-
"type": "http",
|
|
275
|
-
"url": "http://localhost:3001/mcp"
|
|
276
|
-
}
|
|
277
|
-
...
|
|
278
|
-
}
|
|
86
|
+
RemNote MCP Server v0.2.1 listening { wsPort: 3002, httpPort: 3001 }
|
|
279
87
|
```
|
|
280
88
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
## Verification
|
|
89
|
+
Keep this terminal running.
|
|
284
90
|
|
|
285
|
-
###
|
|
91
|
+
### 4. Configure Your AI Client
|
|
286
92
|
|
|
287
|
-
|
|
93
|
+
- [Configuration Guide](docs/guides/configuration.md) - Overview and generic setup
|
|
94
|
+
- [Claude Code CLI](docs/guides/configuration-claude-code-CLI.md) - Detailed Claude Code CLI configuration
|
|
95
|
+
- [Accomplish](docs/guides/configuration-accomplish.md) - Accomplish (Openwork) configuration
|
|
96
|
+
- [Claude Cowork](docs/guides/configuration-claude-cowork.md) - Cloud-based (requires remote access setup)
|
|
288
97
|
|
|
289
|
-
|
|
290
|
-
# Check HTTP port (MCP)
|
|
291
|
-
lsof -i :3001
|
|
292
|
-
|
|
293
|
-
# Check WebSocket port (RemNote bridge)
|
|
294
|
-
lsof -i :3002
|
|
295
|
-
```
|
|
98
|
+
## Documentation
|
|
296
99
|
|
|
297
|
-
|
|
100
|
+
### Getting Started
|
|
298
101
|
|
|
299
|
-
|
|
102
|
+
- **[Installation Guide](docs/guides/installation.md)** - Complete installation instructions
|
|
103
|
+
- **[Configuration Guide](docs/guides/configuration.md)** - Configure Claude Code CLI, Accomplish, and other clients
|
|
104
|
+
- **[Demo & Screenshots](docs/demo.md)** - See the server in action with different AI clients
|
|
300
105
|
|
|
301
|
-
|
|
106
|
+
### Usage
|
|
302
107
|
|
|
303
|
-
- **
|
|
304
|
-
- **
|
|
305
|
-
-
|
|
108
|
+
- **[CLI Options Reference](docs/guides/cli-options.md)** - Command-line options and environment variables
|
|
109
|
+
- **[MCP Tools Reference](docs/guides/tools-reference.md)** - Detailed reference for all 6 RemNote tools
|
|
110
|
+
- **[Remote Access Setup](docs/guides/remote-access.md)** - Expose server for Claude Cowork (ngrok, etc.)
|
|
306
111
|
|
|
307
|
-
###
|
|
308
|
-
|
|
309
|
-
In any Claude Code session, try:
|
|
310
|
-
|
|
311
|
-
```
|
|
312
|
-
Use remnote_status to check the connection
|
|
313
|
-
```
|
|
112
|
+
### Help & Advanced
|
|
314
113
|
|
|
315
|
-
|
|
114
|
+
- **[Troubleshooting](docs/guides/troubleshooting.md)** - Common issues and solutions
|
|
115
|
+
- **[Architecture](docs/architecture.md)** - Design rationale and technical architecture
|
|
316
116
|
|
|
317
|
-
|
|
318
|
-
⏺ remnote - remnote_status (MCP)
|
|
319
|
-
⎿ {
|
|
320
|
-
"connected": true,
|
|
321
|
-
"pluginVersion": "0.3.2"
|
|
322
|
-
}
|
|
323
|
-
```
|
|
117
|
+
### Development
|
|
324
118
|
|
|
325
|
-
|
|
119
|
+
- **[Development Setup](docs/guides/development-setup.md)** - Contributing guide for developers
|
|
120
|
+
- **[Publishing Guide](docs/npm-publishing.md)** - npm publishing process (maintainers only)
|
|
326
121
|
|
|
327
|
-
|
|
122
|
+
## Available MCP Tools
|
|
328
123
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
124
|
+
| Tool | Description |
|
|
125
|
+
|---------------------------|------------------------------------------------|
|
|
126
|
+
| `remnote_create_note` | Create new notes with optional parent and tags |
|
|
127
|
+
| `remnote_search` | Search knowledge base with full-text search |
|
|
128
|
+
| `remnote_read_note` | Read note by ID with configurable depth |
|
|
129
|
+
| `remnote_update_note` | Update title, append content, or modify tags |
|
|
130
|
+
| `remnote_append_journal` | Append to today's daily document |
|
|
131
|
+
| `remnote_status` | Check connection status and statistics |
|
|
332
132
|
|
|
333
|
-
|
|
133
|
+
See the [Tools Reference](docs/guides/tools-reference.md) for detailed usage and examples.
|
|
334
134
|
|
|
335
|
-
##
|
|
135
|
+
## Supported AI Clients
|
|
336
136
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
| `remnote_update_note` | Update title, append content, or modify tags | `remId`, `title`, `appendContent`, `addTags`, `removeTags` |
|
|
343
|
-
| `remnote_append_journal` | Append to today's daily document | `content`, `timestamp` |
|
|
344
|
-
| `remnote_status` | Check connection status and statistics | _(no parameters)_ |
|
|
137
|
+
- **[Claude Code CLI](https://claude.com/claude-code)** - Local terminal-based agent
|
|
138
|
+
- **[Claude Cowork](https://claude.com/blog/cowork-research-preview)** - Cloud-based workspace (requires [remote
|
|
139
|
+
access](docs/guides/remote-access.md))
|
|
140
|
+
- **[Accomplish](https://github.com/accomplish-ai/accomplish)** - Task-based MCP client (formerly Openwork)
|
|
141
|
+
- **Any MCP client** supporting Streamable HTTP transport
|
|
345
142
|
|
|
346
143
|
## Example Usage
|
|
347
144
|
|
|
348
|
-
### Conversational Commands
|
|
349
|
-
|
|
350
|
-
Claude Code will automatically select the appropriate tool based on your natural language commands:
|
|
351
|
-
|
|
352
145
|
**Create notes:**
|
|
353
|
-
|
|
146
|
+
|
|
147
|
+
```text
|
|
354
148
|
Create a note about "Project Ideas" with content:
|
|
355
149
|
- AI-powered note taking
|
|
356
150
|
- Personal knowledge management
|
|
357
151
|
```
|
|
358
152
|
|
|
359
153
|
**Search:**
|
|
360
|
-
```
|
|
361
|
-
Search my RemNote for notes about "machine learning"
|
|
362
|
-
```
|
|
363
154
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
Read the note with ID abc123
|
|
155
|
+
```text
|
|
156
|
+
Search my RemNote for notes about "machine learning"
|
|
367
157
|
```
|
|
368
158
|
|
|
369
159
|
**Update notes:**
|
|
370
|
-
|
|
160
|
+
|
|
161
|
+
```text
|
|
371
162
|
Add a tag "important" to note abc123
|
|
372
163
|
```
|
|
373
164
|
|
|
374
165
|
**Journal entries:**
|
|
375
|
-
|
|
166
|
+
|
|
167
|
+
```text
|
|
376
168
|
Add to my journal: "Completed the RemNote MCP integration"
|
|
377
169
|
```
|
|
378
170
|
|
|
379
|
-
|
|
380
|
-
```
|
|
381
|
-
Check if RemNote is connected
|
|
382
|
-
```
|
|
171
|
+
See the [Tools Reference](docs/guides/tools-reference.md) for more examples.
|
|
383
172
|
|
|
384
173
|
## Configuration
|
|
385
174
|
|
|
386
175
|
### Environment Variables
|
|
387
176
|
|
|
388
177
|
- `REMNOTE_HTTP_PORT` - HTTP MCP server port (default: 3001)
|
|
178
|
+
- `REMNOTE_HTTP_HOST` - HTTP server bind address (default: 127.0.0.1)
|
|
389
179
|
- `REMNOTE_WS_PORT` - WebSocket server port (default: 3002)
|
|
390
180
|
|
|
391
|
-
|
|
181
|
+
### Custom Ports
|
|
392
182
|
|
|
393
183
|
```bash
|
|
394
|
-
|
|
395
|
-
export REMNOTE_HTTP_PORT=3003
|
|
396
|
-
export REMNOTE_WS_PORT=3004
|
|
397
|
-
npm start
|
|
398
|
-
# you can pass CLI options after `--`, e.g.
|
|
399
|
-
npm start -- -h
|
|
184
|
+
remnote-mcp-server --http-port 3003 --ws-port 3004
|
|
400
185
|
```
|
|
401
186
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
**Note:** If you change the WebSocket port, you must also update the WebSocket URL in the RemNote MCP Bridge plugin
|
|
405
|
-
settings.
|
|
406
|
-
|
|
407
|
-
### RemNote Plugin Settings
|
|
187
|
+
After changing ports, update your MCP client configuration and RemNote plugin settings.
|
|
408
188
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
- **WebSocket URL:** `ws://127.0.0.1:3002` (or your custom port)
|
|
412
|
-
- **Auto-reconnect:** Enabled (recommended)
|
|
189
|
+
See [CLI Options Reference](docs/guides/cli-options.md) for all options.
|
|
413
190
|
|
|
414
191
|
## Troubleshooting
|
|
415
192
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
1. **Verify the server is running:**
|
|
419
|
-
```bash
|
|
420
|
-
lsof -i :3001
|
|
421
|
-
lsof -i :3002
|
|
422
|
-
```
|
|
423
|
-
Both ports should show active listeners.
|
|
424
|
-
|
|
425
|
-
2. **Check server output:**
|
|
426
|
-
- You should see: `[HTTP Server] Listening on port 3001`
|
|
427
|
-
- And: `[WebSocket Server] Listening on port 3002`
|
|
428
|
-
3. **If server fails to start:**
|
|
429
|
-
- Check if ports are already in use (see "Port Already in Use" below)
|
|
430
|
-
- Verify installation: `which remnote-mcp-server`
|
|
431
|
-
- Check server logs for errors
|
|
432
|
-
|
|
433
|
-
### Port Already in Use
|
|
434
|
-
|
|
435
|
-
If you see "EADDRINUSE" error for port 3001 or 3002:
|
|
436
|
-
|
|
437
|
-
```bash
|
|
438
|
-
# Find what's using the ports
|
|
439
|
-
lsof -i :3001
|
|
440
|
-
lsof -i :3002
|
|
441
|
-
|
|
442
|
-
# Kill the process if needed
|
|
443
|
-
kill -9 <PID>
|
|
444
|
-
```
|
|
445
|
-
|
|
446
|
-
Alternatively, configure different ports using environment variables (see Configuration section).
|
|
447
|
-
|
|
448
|
-
### Plugin Won't Connect
|
|
449
|
-
|
|
450
|
-
1. **Verify plugin settings in RemNote:**
|
|
451
|
-
- WebSocket URL: `ws://127.0.0.1:3002`
|
|
452
|
-
- Auto-reconnect: Enabled
|
|
453
|
-
2. **Check plugin console (RemNote Developer Tools):**
|
|
454
|
-
```
|
|
455
|
-
Cmd+Option+I (macOS)
|
|
456
|
-
Ctrl+Shift+I (Windows/Linux)
|
|
457
|
-
```
|
|
458
|
-
|
|
459
|
-
3. **Restart RemNote** after changing settings
|
|
460
|
-
4. **Check server logs** for connection messages
|
|
461
|
-
|
|
462
|
-
### Tools Not Appearing in Claude Code
|
|
193
|
+
**Server won't start:**
|
|
463
194
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
cat ~/.claude.json | grep -A 10 mcpServers
|
|
467
|
-
```
|
|
195
|
+
- Check ports aren't in use: `lsof -i :3001` and `lsof -i :3002`
|
|
196
|
+
- Verify installation: `which remnote-mcp-server`
|
|
468
197
|
|
|
469
|
-
|
|
470
|
-
3. **Restart Claude Code completely** (not just reload)
|
|
471
|
-
4. **Check MCP logs:**
|
|
472
|
-
```bash
|
|
473
|
-
tail -f ~/.claude/debug/mcp-*.log
|
|
474
|
-
```
|
|
198
|
+
**Plugin won't connect:**
|
|
475
199
|
|
|
476
|
-
|
|
200
|
+
- Verify plugin settings: WebSocket URL `ws://127.0.0.1:3002`
|
|
201
|
+
- Check server is running: `lsof -i :3002`
|
|
477
202
|
|
|
478
|
-
**
|
|
203
|
+
**Tools not appearing:**
|
|
479
204
|
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
"type": "stdio" // OLD - doesn't work anymore
|
|
483
|
-
```
|
|
484
|
-
|
|
485
|
-
✅ **Correct transport type:**
|
|
486
|
-
```json
|
|
487
|
-
"type": "http" // NEW - required
|
|
488
|
-
```
|
|
489
|
-
|
|
490
|
-
❌ **Using command instead of URL:**
|
|
491
|
-
```json
|
|
492
|
-
{
|
|
493
|
-
"type": "stdio",
|
|
494
|
-
"command": "remnote-mcp-server" // OLD
|
|
495
|
-
}
|
|
496
|
-
```
|
|
205
|
+
- Verify configuration: `claude mcp list`
|
|
206
|
+
- Restart Claude Code completely
|
|
497
207
|
|
|
498
|
-
|
|
499
|
-
```json
|
|
500
|
-
{
|
|
501
|
-
"type": "http",
|
|
502
|
-
"url": "http://127.0.0.1:3001/mcp" // NEW
|
|
503
|
-
}
|
|
504
|
-
```
|
|
208
|
+
See the [Troubleshooting Guide](docs/guides/troubleshooting.md) for detailed solutions.
|
|
505
209
|
|
|
506
|
-
## Development
|
|
210
|
+
## Contributing & Development
|
|
507
211
|
|
|
508
|
-
|
|
212
|
+
**Development setup:**
|
|
509
213
|
|
|
510
214
|
```bash
|
|
215
|
+
git clone https://github.com/robert7/remnote-mcp-server.git
|
|
216
|
+
cd remnote-mcp-server
|
|
511
217
|
npm install
|
|
512
218
|
npm run build
|
|
513
|
-
npm link
|
|
219
|
+
npm link
|
|
514
220
|
```
|
|
515
221
|
|
|
516
|
-
|
|
222
|
+
**Development workflow:**
|
|
517
223
|
|
|
518
224
|
```bash
|
|
519
225
|
npm run dev # Watch mode with hot reload
|
|
520
|
-
npm
|
|
521
|
-
|
|
226
|
+
npm test # Run test suite
|
|
227
|
+
./code-quality.sh # Run all quality checks
|
|
522
228
|
```
|
|
523
229
|
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
```bash
|
|
527
|
-
npm test # Run all tests
|
|
528
|
-
npm run test:watch # Watch mode
|
|
529
|
-
npm run test:coverage # With coverage report
|
|
530
|
-
```
|
|
531
|
-
|
|
532
|
-
### Code Quality
|
|
533
|
-
|
|
534
|
-
```bash
|
|
535
|
-
./code-quality.sh # Run all checks
|
|
536
|
-
npm run lint # ESLint only
|
|
537
|
-
npm run format # Format code
|
|
538
|
-
```
|
|
539
|
-
|
|
540
|
-
### Development Documentation
|
|
541
|
-
|
|
542
|
-
- **[docs/architecture.md](./docs/architecture.md)** - Architecture and design rationale
|
|
543
|
-
- **[AGENTS.md](./AGENTS.md)** - AI agent and developer guidance
|
|
544
|
-
- **[CHANGELOG.md](./CHANGELOG.md)** - Version history
|
|
230
|
+
See the [Development Setup Guide](docs/guides/development-setup.md) for complete instructions.
|
|
545
231
|
|
|
546
232
|
## Related Projects
|
|
547
233
|
|
|
@@ -551,3 +237,10 @@ npm run format # Format code
|
|
|
551
237
|
## License
|
|
552
238
|
|
|
553
239
|
MIT
|
|
240
|
+
|
|
241
|
+
## Links
|
|
242
|
+
|
|
243
|
+
- [Documentation](docs/guides/) - Complete documentation
|
|
244
|
+
- [GitHub Issues](https://github.com/robert7/remnote-mcp-server/issues) - Bug reports and feature requests
|
|
245
|
+
- [npm Package](https://www.npmjs.com/package/remnote-mcp-server) - Official npm package
|
|
246
|
+
- [CHANGELOG](CHANGELOG.md) - Version history and roadmap
|
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -14,6 +14,7 @@ export function parseCliArgs() {
|
|
|
14
14
|
.version(packageJson.version)
|
|
15
15
|
.option('--ws-port <number>', 'WebSocket port (default: 3002, env: REMNOTE_WS_PORT)', parsePort)
|
|
16
16
|
.option('--http-port <number>', 'HTTP MCP port (default: 3001, env: REMNOTE_HTTP_PORT)', parsePort)
|
|
17
|
+
.option('--http-host <host>', 'HTTP server bind address (default: 127.0.0.1, env: REMNOTE_HTTP_HOST). Use 0.0.0.0 for Docker/VPS deployments', validateHost)
|
|
17
18
|
.option('--log-level <level>', `Console log level: ${validLogLevels.join(', ')} (default: info)`, validateLogLevel)
|
|
18
19
|
.option('--log-level-file <level>', `File log level (default: same as --log-level)`, validateLogLevel)
|
|
19
20
|
.option('--verbose', 'Shorthand for --log-level debug')
|
|
@@ -48,4 +49,24 @@ function validateLogLevel(value) {
|
|
|
48
49
|
}
|
|
49
50
|
return value.toLowerCase();
|
|
50
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Validate host string
|
|
54
|
+
*/
|
|
55
|
+
function validateHost(value) {
|
|
56
|
+
// Allow localhost variations and 0.0.0.0
|
|
57
|
+
if (value === 'localhost' || value === '127.0.0.1' || value === '0.0.0.0') {
|
|
58
|
+
return value;
|
|
59
|
+
}
|
|
60
|
+
// Validate IPv4 format
|
|
61
|
+
const ipv4Pattern = /^(\d{1,3}\.){3}\d{1,3}$/;
|
|
62
|
+
if (!ipv4Pattern.test(value)) {
|
|
63
|
+
throw new Error(`Invalid host: ${value}. Must be localhost, 127.0.0.1, 0.0.0.0, or a valid IPv4 address`);
|
|
64
|
+
}
|
|
65
|
+
// Validate each octet is 0-255
|
|
66
|
+
const octets = value.split('.').map(Number);
|
|
67
|
+
if (octets.some((octet) => octet < 0 || octet > 255)) {
|
|
68
|
+
throw new Error(`Invalid host: ${value}. IPv4 octets must be between 0 and 255`);
|
|
69
|
+
}
|
|
70
|
+
return value;
|
|
71
|
+
}
|
|
51
72
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAc/C,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAE9B,OAAO;SACJ,IAAI,CAAC,oBAAoB,CAAC;SAC1B,WAAW,CAAC,8CAA8C,CAAC;SAC3D,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC;SAC5B,MAAM,CAAC,oBAAoB,EAAE,sDAAsD,EAAE,SA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AAc,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,sBAAsB,KAAK,mBAAmB,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7F,CAAC;IACD,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,SAAS,YAAY,CAAC,KAAa;IACjC,yCAAyC;IACzC,IAAI,KAAK,KAAK,WAAW,IAAI,KAAK,KAAK,WAAW,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1E,OAAO,KAAK,CAAC;IACf,CAAC;IAED,uBAAuB;IACvB,MAAM,WAAW,GAAG,yBAAyB,CAAC;IAC9C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CACb,iBAAiB,KAAK,kEAAkE,CACzF,CAAC;IACJ,CAAC;IAED,+BAA+B;IAC/B,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5C,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,GAAG,CAAC,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CAAC,iBAAiB,KAAK,yCAAyC,CAAC,CAAC;IACnF,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/config.d.ts
CHANGED
package/dist/config.js
CHANGED
|
@@ -19,6 +19,10 @@ export function getConfig(cliOptions) {
|
|
|
19
19
|
// Get ports with CLI > env > default precedence
|
|
20
20
|
const wsPort = cliOptions.wsPort || parseInt(process.env.REMNOTE_WS_PORT || '3002', 10);
|
|
21
21
|
const httpPort = cliOptions.httpPort || parseInt(process.env.REMNOTE_HTTP_PORT || '3001', 10);
|
|
22
|
+
// Get hosts with CLI > env > default precedence
|
|
23
|
+
// SECURITY: WebSocket ALWAYS binds to localhost, regardless of env var or CLI option
|
|
24
|
+
const wsHost = '127.0.0.1';
|
|
25
|
+
const httpHost = cliOptions.httpHost || process.env.REMNOTE_HTTP_HOST || '127.0.0.1';
|
|
22
26
|
// Validate port conflicts
|
|
23
27
|
if (wsPort === httpPort) {
|
|
24
28
|
throw new Error(`WebSocket port and HTTP port cannot be the same (both set to ${wsPort})`);
|
|
@@ -29,7 +33,9 @@ export function getConfig(cliOptions) {
|
|
|
29
33
|
const prettyLogs = process.stdout.isTTY === true;
|
|
30
34
|
return {
|
|
31
35
|
wsPort,
|
|
36
|
+
wsHost,
|
|
32
37
|
httpPort,
|
|
38
|
+
httpHost,
|
|
33
39
|
logLevel,
|
|
34
40
|
logLevelFile,
|
|
35
41
|
logFile: cliOptions.logFile,
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAeA;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,UAAsB;IAC9C,8BAA8B;IAC9B,IAAI,QAAQ,GAAG,UAAU,CAAC,QAAQ,IAAI,MAAM,CAAC;IAC7C,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;QACvB,QAAQ,GAAG,OAAO,CAAC;IACrB,CAAC;IAED,0CAA0C;IAC1C,IAAI,UAAU,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,CAAC,MAAM,GAAG,KAAK,CAAC,EAAE,CAAC;QAC5F,MAAM,IAAI,KAAK,CAAC,2BAA2B,UAAU,CAAC,MAAM,gCAAgC,CAAC,CAAC;IAChG,CAAC;IACD,IACE,UAAU,CAAC,QAAQ,KAAK,SAAS;QACjC,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-server.d.ts
CHANGED
|
@@ -8,11 +8,12 @@ export declare class HttpMcpServer {
|
|
|
8
8
|
private app;
|
|
9
9
|
private server;
|
|
10
10
|
private port;
|
|
11
|
+
private host;
|
|
11
12
|
private wsServer;
|
|
12
13
|
private serverInfo;
|
|
13
14
|
private logger;
|
|
14
15
|
private transports;
|
|
15
|
-
constructor(port: number, wsServer: WebSocketServer, serverInfo: ServerInfo, logger: Logger);
|
|
16
|
+
constructor(port: number, host: string, wsServer: WebSocketServer, serverInfo: ServerInfo, logger: Logger);
|
|
16
17
|
private setupRoutes;
|
|
17
18
|
private initializeNewSession;
|
|
18
19
|
private handleSessionRequest;
|
package/dist/http-server.js
CHANGED
|
@@ -7,12 +7,14 @@ export class HttpMcpServer {
|
|
|
7
7
|
app;
|
|
8
8
|
server = null;
|
|
9
9
|
port;
|
|
10
|
+
host;
|
|
10
11
|
wsServer;
|
|
11
12
|
serverInfo;
|
|
12
13
|
logger;
|
|
13
14
|
transports = new Map();
|
|
14
|
-
constructor(port, wsServer, serverInfo, logger) {
|
|
15
|
+
constructor(port, host, wsServer, serverInfo, logger) {
|
|
15
16
|
this.port = port;
|
|
17
|
+
this.host = host;
|
|
16
18
|
this.wsServer = wsServer;
|
|
17
19
|
this.serverInfo = serverInfo;
|
|
18
20
|
this.logger = logger.child({ context: 'http-server' });
|
|
@@ -150,8 +152,8 @@ export class HttpMcpServer {
|
|
|
150
152
|
async start() {
|
|
151
153
|
return new Promise((resolve, reject) => {
|
|
152
154
|
try {
|
|
153
|
-
this.server = this.app.listen(this.port, () => {
|
|
154
|
-
this.logger.info({ port: this.port }, 'HTTP server started');
|
|
155
|
+
this.server = this.app.listen(this.port, this.host, () => {
|
|
156
|
+
this.logger.info({ port: this.port, host: this.host }, 'HTTP server started');
|
|
155
157
|
resolve();
|
|
156
158
|
});
|
|
157
159
|
this.server.on('error', (error) => {
|
package/dist/http-server.js.map
CHANGED
|
@@ -1 +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,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAQpD,MAAM,OAAO,aAAa;IAChB,GAAG,CAAU;IACb,MAAM,GAAyC,IAAI,CAAC;IACpD,IAAI,CAAS;IACb,QAAQ,CAAkB;IAC1B,UAAU,CAAa;IACvB,MAAM,CAAS;IACf,UAAU,GAAG,IAAI,GAAG,EAAyC,CAAC;IAEtE,
|
|
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,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAQpD,MAAM,OAAO,aAAa;IAChB,GAAG,CAAU;IACb,MAAM,GAAyC,IAAI,CAAC;IACpD,IAAI,CAAS;IACb,IAAI,CAAS;IACb,QAAQ,CAAkB;IAC1B,UAAU,CAAa;IACvB,MAAM,CAAS;IACf,UAAU,GAAG,IAAI,GAAG,EAAyC,CAAC;IAEtE,YACE,IAAY,EACZ,IAAY,EACZ,QAAyB,EACzB,UAAsB,EACtB,MAAc;QAEd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UA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C,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI;QACR,8BAA8B;QAC9B,KAAK,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC;YAC/D,IAAI,CAAC;gBACH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,EAAE,qBAAqB,CAAC,CAAC;gBACxD,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;gBACxB,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACpC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,uBAAuB,CAAC,CAAC;YACnE,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,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;oBACxC,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
|
@@ -36,7 +36,7 @@ async function main() {
|
|
|
36
36
|
? createRequestResponseLogger(config.responseLog)
|
|
37
37
|
: undefined;
|
|
38
38
|
// Initialize WebSocket server for RemNote plugin
|
|
39
|
-
const wsServer = new WebSocketServer(config.wsPort, logger, requestLogger, responseLogger);
|
|
39
|
+
const wsServer = new WebSocketServer(config.wsPort, config.wsHost, logger, requestLogger, responseLogger);
|
|
40
40
|
// Log connection status
|
|
41
41
|
wsServer.onClientConnect(() => {
|
|
42
42
|
logger.info('RemNote plugin connected');
|
|
@@ -47,7 +47,7 @@ async function main() {
|
|
|
47
47
|
// Start WebSocket server
|
|
48
48
|
await wsServer.start();
|
|
49
49
|
// Initialize HTTP MCP server
|
|
50
|
-
const httpServer = new HttpMcpServer(config.httpPort, wsServer, {
|
|
50
|
+
const httpServer = new HttpMcpServer(config.httpPort, config.httpHost, wsServer, {
|
|
51
51
|
name: 'remnote-mcp-server',
|
|
52
52
|
version: packageJson.version,
|
|
53
53
|
}, logger);
|
|
@@ -55,7 +55,9 @@ async function main() {
|
|
|
55
55
|
// Log startup message
|
|
56
56
|
logger.info({
|
|
57
57
|
wsPort: config.wsPort,
|
|
58
|
+
wsHost: config.wsHost,
|
|
58
59
|
httpPort: config.httpPort,
|
|
60
|
+
httpHost: config.httpHost,
|
|
59
61
|
}, `RemNote MCP Server v${packageJson.version} listening`);
|
|
60
62
|
// Graceful shutdown
|
|
61
63
|
const shutdown = async () => {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAE5F,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/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AAC,IAAI,EAAE,CAAC;QACxB,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACtB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;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,4BAA4B;IAC5B,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;IAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/logger.js
CHANGED
|
@@ -6,7 +6,7 @@ import { dirname } from 'path';
|
|
|
6
6
|
*/
|
|
7
7
|
export function createLogger(config) {
|
|
8
8
|
const targets = [];
|
|
9
|
-
// Console transport
|
|
9
|
+
// Console transport with graceful fallback
|
|
10
10
|
if (config.pretty) {
|
|
11
11
|
targets.push({
|
|
12
12
|
level: config.consoleLevel,
|
|
@@ -33,12 +33,45 @@ export function createLogger(config) {
|
|
|
33
33
|
options: { destination: config.filePath },
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
// Wrap initialization to handle transport errors
|
|
37
|
+
try {
|
|
38
|
+
return pino({
|
|
39
|
+
level: getMinLevel(config.consoleLevel, config.fileLevel),
|
|
40
|
+
transport: {
|
|
41
|
+
targets,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
// Fall back to basic JSON logger if transport fails
|
|
47
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
48
|
+
// Only warn if pretty was requested (otherwise it's expected behavior)
|
|
49
|
+
if (config.pretty) {
|
|
50
|
+
console.error('[Logger] pino-pretty not available, falling back to JSON logging:', message);
|
|
51
|
+
}
|
|
52
|
+
// Create fallback logger with JSON output to stderr
|
|
53
|
+
const fallbackTargets = [
|
|
54
|
+
{
|
|
55
|
+
level: config.consoleLevel,
|
|
56
|
+
target: 'pino/file',
|
|
57
|
+
options: { destination: 2 }, // stderr
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
// Add file transport if configured
|
|
61
|
+
if (config.filePath && config.fileLevel) {
|
|
62
|
+
fallbackTargets.push({
|
|
63
|
+
level: config.fileLevel,
|
|
64
|
+
target: 'pino/file',
|
|
65
|
+
options: { destination: config.filePath },
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return pino({
|
|
69
|
+
level: getMinLevel(config.consoleLevel, config.fileLevel),
|
|
70
|
+
transport: {
|
|
71
|
+
targets: fallbackTargets,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
}
|
|
42
75
|
}
|
|
43
76
|
/**
|
|
44
77
|
* Create a logger for request/response logging (JSON Lines format)
|
package/dist/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAW/B;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,MAAoB;IAC/C,MAAM,OAAO,GAAkC,EAAE,CAAC;IAElD,
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAW/B;;GAEG;AACH,MAAM,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KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC5G,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAC,YAAoB,EAAE,SAAkB;IAC3D,MAAM,MAAM,GAA2B;QACrC,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,EAAE;KACV,CAAC;IAEF,MAAM,eAAe,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;IACnD,MAAM,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;IAEpE,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;IAE5D,6CAA6C;IAC7C,KAAK,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACjD,IAAI,GAAG,KAAK,WAAW,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -3,13 +3,14 @@ export declare class WebSocketServer {
|
|
|
3
3
|
private wss;
|
|
4
4
|
private client;
|
|
5
5
|
private port;
|
|
6
|
+
private host;
|
|
6
7
|
private logger;
|
|
7
8
|
private requestLogger;
|
|
8
9
|
private responseLogger;
|
|
9
10
|
private pendingRequests;
|
|
10
11
|
private connectCallbacks;
|
|
11
12
|
private disconnectCallbacks;
|
|
12
|
-
constructor(port: number, logger: Logger, requestLogger?: Logger, responseLogger?: Logger);
|
|
13
|
+
constructor(port: number, host: string, logger: Logger, requestLogger?: Logger, responseLogger?: Logger);
|
|
13
14
|
start(): Promise<void>;
|
|
14
15
|
stop(): Promise<void>;
|
|
15
16
|
sendRequest(action: string, payload: Record<string, unknown>): Promise<unknown>;
|
package/dist/websocket-server.js
CHANGED
|
@@ -4,22 +4,24 @@ export class WebSocketServer {
|
|
|
4
4
|
wss = null;
|
|
5
5
|
client = null;
|
|
6
6
|
port;
|
|
7
|
+
host;
|
|
7
8
|
logger;
|
|
8
9
|
requestLogger = null;
|
|
9
10
|
responseLogger = null;
|
|
10
11
|
pendingRequests = new Map();
|
|
11
12
|
connectCallbacks = [];
|
|
12
13
|
disconnectCallbacks = [];
|
|
13
|
-
constructor(port, logger, requestLogger, responseLogger) {
|
|
14
|
+
constructor(port, host, logger, requestLogger, responseLogger) {
|
|
14
15
|
this.port = port;
|
|
16
|
+
this.host = host;
|
|
15
17
|
this.logger = logger.child({ context: 'websocket-server' });
|
|
16
18
|
this.requestLogger = requestLogger || null;
|
|
17
19
|
this.responseLogger = responseLogger || null;
|
|
18
20
|
}
|
|
19
21
|
async start() {
|
|
20
22
|
return new Promise((resolve, reject) => {
|
|
21
|
-
this.wss = new WSServer({ port: this.port }, () => {
|
|
22
|
-
this.logger.debug({ port: this.port }, 'WebSocket server started');
|
|
23
|
+
this.wss = new WSServer({ port: this.port, host: this.host }, () => {
|
|
24
|
+
this.logger.debug({ port: this.port, host: this.host }, 'WebSocket server started');
|
|
23
25
|
resolve();
|
|
24
26
|
});
|
|
25
27
|
this.wss.on('error', (error) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"websocket-server.js","sourceRoot":"","sources":["../src/websocket-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,QAAQ,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAIpC,MAAM,OAAO,eAAe;IAClB,GAAG,GAAoB,IAAI,CAAC;IAC5B,MAAM,GAAqB,IAAI,CAAC;IAChC,IAAI,CAAS;IACb,MAAM,CAAS;IACf,aAAa,GAAkB,IA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