@astrivya/mcp 0.0.0-stage → 0.1.0-beta.12
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/LICENSE +202 -0
- package/README.md +203 -2
- package/bin/memnoth-mcp.js +102 -0
- package/package.json +34 -4
- package/vendor/darwin-arm64/memnoth-mcp +0 -0
- package/vendor/darwin-x64/memnoth-mcp +0 -0
- package/vendor/linux-arm64/memnoth-mcp +0 -0
- package/vendor/linux-x64/memnoth-mcp +0 -0
- package/vendor/win32-x64/memnoth-mcp.exe +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,204 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @astrivya/mcp
|
|
2
|
+
|
|
3
|
+
Launcher for the [memnoth](https://github.com/astrivya/memnoth) MCP server.
|
|
4
|
+
|
|
5
|
+
The release package bundles the server binary in `vendor/<platform>-<arch>/memnoth-mcp`
|
|
6
|
+
(`memnoth-mcp.exe` on Windows) for five targets: `win32-x64`, `linux-x64`, `linux-arm64`,
|
|
7
|
+
`darwin-x64`, and `darwin-arm64`. The release workflow extracts these binaries from the
|
|
8
|
+
checksummed CLI archives and runs the Linux binary's MCP self-test before publishing.
|
|
9
|
+
The launcher resolution order is:
|
|
10
|
+
|
|
11
|
+
1. **`MEMNOTH_BIN` environment variable** — explicit path to a `memnoth` CLI build; overrides the bundled copy
|
|
12
|
+
2. **Bundled binary** (`vendor/<platform>-<arch>/memnoth-mcp`) — works offline
|
|
13
|
+
3. **`memnoth` on `PATH`** — what `cargo install` and release installers produce
|
|
14
|
+
|
|
15
|
+
The bundled standalone binary is used when `MEMNOTH_BIN` is unset. If the package has no bundled
|
|
16
|
+
binary for the current platform, the launcher falls back to `memnoth` on `PATH`.
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx -y @astrivya/mcp@beta --help # show server options; does not start a server
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The published package ships the server binary, so no separate Memnoth install is required.
|
|
25
|
+
`MEMNOTH_BIN` is for maintainers or users who deliberately want to run a different full `memnoth`
|
|
26
|
+
CLI build; that CLI is started as `memnoth mcp serve`.
|
|
27
|
+
|
|
28
|
+
## Release publishing setup
|
|
29
|
+
|
|
30
|
+
The package metadata points to `https://github.com/astrivya/memnoth.git`; keep this
|
|
31
|
+
repository URL aligned with the GitHub repository because npm uses it to bind the
|
|
32
|
+
trusted publisher. The `dist` job in `.github/workflows/release.yml` uses Node 22.14.0,
|
|
33
|
+
npm 11.5.1, and `id-token: write` for npm's GitHub Actions OIDC publishing.
|
|
34
|
+
|
|
35
|
+
### One-time first publication and trusted publisher setup
|
|
36
|
+
|
|
37
|
+
npm cannot configure a trusted publisher until the package exists. For the first
|
|
38
|
+
publication only, publish the verified release tarball interactively from a
|
|
39
|
+
maintainer's npm account that has publish access to the `astrivya` organization.
|
|
40
|
+
Do not add an npm token to GitHub Actions or commit local npm credentials. After
|
|
41
|
+
the package exists:
|
|
42
|
+
|
|
43
|
+
After the package exists, open the package's settings on npmjs.com and add a trusted
|
|
44
|
+
publisher with:
|
|
45
|
+
|
|
46
|
+
- Provider: **GitHub Actions**
|
|
47
|
+
- Organization/user: **astrivya**
|
|
48
|
+
- Repository: **memnoth**
|
|
49
|
+
- Workflow file: **`release.yml`**
|
|
50
|
+
- GitHub environment: leave empty (the release job does not use an environment)
|
|
51
|
+
- Allowed actions: enable **`npm publish`**. New publishers default to staged publishing,
|
|
52
|
+
while the release workflow publishes tags directly.
|
|
53
|
+
|
|
54
|
+
After saving the publisher, set the GitHub repository Actions variable
|
|
55
|
+
`NPM_TRUSTED_PUBLISHING` to `true`, then remove any `NPM_TOKEN` Actions secret.
|
|
56
|
+
The workflow uses OIDC only when that variable is enabled. With neither publishing
|
|
57
|
+
method configured, it skips npm publication and still attaches the verified package
|
|
58
|
+
tarball to the GitHub release. Verify the next normal publish succeeds and the npm
|
|
59
|
+
package provenance names `Astrivya/memnoth` and `release.yml`; do not restore a
|
|
60
|
+
long-lived token as routine publishing configuration. If the token is temporarily
|
|
61
|
+
retained during the transition, it takes precedence over OIDC until it is removed.
|
|
62
|
+
|
|
63
|
+
## Client config
|
|
64
|
+
|
|
65
|
+
This is a standalone stdio server for MCP hosts such as OpenCode, Codex, Claude
|
|
66
|
+
Code, Cursor, and Zed. It must be pointed at one vault file; it never guesses a
|
|
67
|
+
default. If you do not have a vault yet, run `memnoth vault init` and
|
|
68
|
+
`memnoth vault status`, then copy the absolute vault file path shown by status.
|
|
69
|
+
Creating a new vault requires the Memnoth CLI once; after that, the packaged
|
|
70
|
+
MCP server runs independently. You can also point it at a vault file already
|
|
71
|
+
created on another machine.
|
|
72
|
+
Use that path below in place of `/absolute/path/to/.memnoth/vault.db`. The
|
|
73
|
+
default profile is `memory`; this example starts read-only:
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"mcpServers": {
|
|
78
|
+
"memnoth": {
|
|
79
|
+
"command": "npx",
|
|
80
|
+
"args": ["-y", "@astrivya/mcp@beta"],
|
|
81
|
+
"env": {
|
|
82
|
+
"MEMNOTH_MCP_DB": "/absolute/path/to/.memnoth/vault.db",
|
|
83
|
+
"MEMNOTH_MCP_PROFILE": "memory",
|
|
84
|
+
"MEMNOTH_MCP_READ_ONLY": "1"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
For OpenCode, add this to `opencode.json` (replace the vault placeholder with
|
|
92
|
+
the absolute path from `memnoth vault status`):
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"$schema": "https://opencode.ai/config.json",
|
|
97
|
+
"mcp": {
|
|
98
|
+
"servers": {
|
|
99
|
+
"memnoth": {
|
|
100
|
+
"type": "local",
|
|
101
|
+
"command": ["npx", "-y", "@astrivya/mcp@beta"],
|
|
102
|
+
"environment": {
|
|
103
|
+
"MEMNOTH_MCP_DB": "/absolute/path/to/.memnoth/vault.db",
|
|
104
|
+
"MEMNOTH_MCP_PROFILE": "memory",
|
|
105
|
+
"MEMNOTH_MCP_READ_ONLY": "1"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
For Codex CLI, use the add command:
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
codex mcp add memnoth \
|
|
117
|
+
--env MEMNOTH_MCP_DB=/absolute/path/to/.memnoth/vault.db \
|
|
118
|
+
--env MEMNOTH_MCP_PROFILE=memory \
|
|
119
|
+
--env MEMNOTH_MCP_READ_ONLY=1 \
|
|
120
|
+
-- npx -y @astrivya/mcp@beta
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Or add this to `~/.codex/config.toml` or a project `.codex/config.toml`:
|
|
124
|
+
|
|
125
|
+
```toml
|
|
126
|
+
[mcp_servers.memnoth]
|
|
127
|
+
command = "npx"
|
|
128
|
+
args = ["-y", "@astrivya/mcp@beta"]
|
|
129
|
+
|
|
130
|
+
[mcp_servers.memnoth.env]
|
|
131
|
+
MEMNOTH_MCP_DB = "/absolute/path/to/.memnoth/vault.db"
|
|
132
|
+
MEMNOTH_MCP_PROFILE = "memory"
|
|
133
|
+
MEMNOTH_MCP_READ_ONLY = "1"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
For Claude Code, register a local stdio server from the project directory:
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
claude mcp add --transport stdio \
|
|
140
|
+
--env MEMNOTH_MCP_DB=/absolute/path/to/.memnoth/vault.db \
|
|
141
|
+
--env MEMNOTH_MCP_PROFILE=memory \
|
|
142
|
+
--env MEMNOTH_MCP_READ_ONLY=1 \
|
|
143
|
+
memnoth -- npx -y @astrivya/mcp@beta
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
For Zed, add the equivalent entry to its settings JSON:
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"context_servers": {
|
|
151
|
+
"memnoth": {
|
|
152
|
+
"command": "npx",
|
|
153
|
+
"args": ["-y", "@astrivya/mcp@beta"],
|
|
154
|
+
"env": {
|
|
155
|
+
"MEMNOTH_MCP_DB": "/absolute/path/to/.memnoth/vault.db",
|
|
156
|
+
"MEMNOTH_MCP_PROFILE": "memory",
|
|
157
|
+
"MEMNOTH_MCP_READ_ONLY": "1"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
This npm setup launches the standalone packaged server from the host's config.
|
|
165
|
+
Separately, `memnoth mcp add --local --clients opencode` is the CLI-managed
|
|
166
|
+
registration flow: it writes a local Memnoth CLI server entry (including its
|
|
167
|
+
resolved vault path) into OpenCode's config. Use one setup flow; do not add both
|
|
168
|
+
entries unless you intentionally want two servers.
|
|
169
|
+
|
|
170
|
+
## Protocol compatibility
|
|
171
|
+
|
|
172
|
+
The stdio server supports both MCP lifecycles. Hosts that begin with
|
|
173
|
+
`initialize` negotiate the legacy `2025-11-25` response shape; hosts using the
|
|
174
|
+
stateless `server/discover` flow use `2026-07-28`. This lets hosts that still
|
|
175
|
+
default to the legacy lifecycle connect without changing the modern protocol
|
|
176
|
+
used by newer clients. The hosted HTTP endpoint uses the modern stateless
|
|
177
|
+
protocol.
|
|
178
|
+
|
|
179
|
+
The published package includes the server binary for supported platforms, so
|
|
180
|
+
the Memnoth CLI is optional when running the MCP server. `MEMNOTH_MCP_DB`
|
|
181
|
+
selects the vault the standalone server opens.
|
|
182
|
+
|
|
183
|
+
## Offline version check
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
npx -y @astrivya/mcp@beta --version
|
|
187
|
+
# 0.1.0-beta.12
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
The `--version` flag works completely offline without spawning the binary.
|
|
191
|
+
|
|
192
|
+
**The profile tool counts are generated by** `scripts/check_surface.py` **from** the standalone server's `server.json` metadata. Rust tests verify those counts against implemented server tools; the CLI's broader capability catalog may include tools unavailable in this binary.
|
|
193
|
+
| `MEMNOTH_MCP_PROFILE` | Tools | What it is for |
|
|
194
|
+
|---|---|---|
|
|
195
|
+
| `memory` | 21 | The vault, the temporal quartet (`vault_history`, `vault_asof`, `vault_contradictions`, `vault_top`), vault hygiene (`mem_duplicates`), index health |
|
|
196
|
+
| `code` | 19 | Code-graph navigation plus the filesystem/git toolbox |
|
|
197
|
+
| `coord` | 14 | Multi-agent claims, tasks, messaging |
|
|
198
|
+
| `micro` | 4 | Smallest useful set |
|
|
199
|
+
| `full` | 47 | Everything |
|
|
200
|
+
|
|
201
|
+
A tool you expected but cannot see is a profile setting, not a missing
|
|
202
|
+
capability — the server reports the active profile and its tool count in the
|
|
203
|
+
`server/discover` instructions.
|
|
2
204
|
|
|
3
|
-
This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// Launcher for the memnoth MCP server.
|
|
5
|
+
//
|
|
6
|
+
// A release of memnoth-mcp is a single Rust binary per platform, and this package ships one
|
|
7
|
+
// copy per platform under `vendor/` when the release script has built it. An explicit
|
|
8
|
+
// `MEMNOTH_BIN` takes precedence for development or custom installations; otherwise use the
|
|
9
|
+
// bundled server, then `memnoth` on PATH.
|
|
10
|
+
//
|
|
11
|
+
// STDOUT IS THE PROTOCOL. Everything this script says about itself must go to
|
|
12
|
+
// stderr; a single stray console.log corrupts the JSON-RPC stream and the host
|
|
13
|
+
// reports a parse error instead of a missing install.
|
|
14
|
+
|
|
15
|
+
const fs = require("node:fs");
|
|
16
|
+
const path = require("node:path");
|
|
17
|
+
const { spawn } = require("node:child_process");
|
|
18
|
+
|
|
19
|
+
// Handle --version before doing anything else (works offline after install)
|
|
20
|
+
if (process.argv.includes("--version") || process.argv.includes("-v")) {
|
|
21
|
+
const pkgPath = path.join(__dirname, "..", "package.json");
|
|
22
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
|
23
|
+
console.log(pkg.version);
|
|
24
|
+
process.exit(0);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Which binary to run, in a fixed order:
|
|
28
|
+
//
|
|
29
|
+
// 1. `MEMNOTH_BIN`, an explicit path to the full `memnoth` CLI;
|
|
30
|
+
// 2. a binary bundled in the tarball (`vendor/<platform>-<arch>/memnoth-mcp[.exe]`), which is
|
|
31
|
+
// the standalone server and needs no subcommand;
|
|
32
|
+
// 3. `memnoth` on PATH, which is what `cargo install` and the release installers produce.
|
|
33
|
+
//
|
|
34
|
+
// An explicit environment variable wins so a maintainer can test a local build even when the
|
|
35
|
+
// package contains a bundled copy.
|
|
36
|
+
// Nothing here guesses a path from the user's home directory — a launcher that reads
|
|
37
|
+
// `~/.cargo/bin` works on one machine and fails on the next.
|
|
38
|
+
function bundledBinary() {
|
|
39
|
+
const name = process.platform === "win32" ? "memnoth-mcp.exe" : "memnoth-mcp";
|
|
40
|
+
const candidate = path.join(
|
|
41
|
+
__dirname,
|
|
42
|
+
"..",
|
|
43
|
+
"vendor",
|
|
44
|
+
`${process.platform}-${process.arch}`,
|
|
45
|
+
name,
|
|
46
|
+
);
|
|
47
|
+
return fs.existsSync(candidate) ? candidate : null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const env = process.env.MEMNOTH_BIN;
|
|
51
|
+
const fromEnv = env && env.trim() ? env.trim() : null;
|
|
52
|
+
const bundled = bundledBinary();
|
|
53
|
+
const binary = fromEnv || bundled || "memnoth";
|
|
54
|
+
// The bundled artifact is the standalone `memnoth-mcp` server, which begins
|
|
55
|
+
// serving as soon as it starts. A `memnoth` from MEMNOTH_BIN or PATH is the full
|
|
56
|
+
// CLI and needs the `mcp serve` subcommand first. Extra argv is passed through in
|
|
57
|
+
// both cases so a host can add `--db <path>` from its own server config.
|
|
58
|
+
const standalone = !fromEnv && Boolean(bundled);
|
|
59
|
+
const args = standalone ? process.argv.slice(2) : ["mcp", "serve", ...process.argv.slice(2)];
|
|
60
|
+
|
|
61
|
+
const child = spawn(binary, args, {
|
|
62
|
+
stdio: "inherit",
|
|
63
|
+
windowsHide: true,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
child.on("error", (error) => {
|
|
67
|
+
if (error.code === "ENOENT") {
|
|
68
|
+
const resolutionHint = fromEnv
|
|
69
|
+
? "MEMNOTH_BIN is an explicit override, so no bundled or PATH fallback was attempted.\n" +
|
|
70
|
+
"Correct it or unset it to use the package binary (when available) or `memnoth` on PATH.\n"
|
|
71
|
+
: bundled
|
|
72
|
+
? "The selected bundled binary could not be started. Reinstall the package or use MEMNOTH_BIN to select a full CLI build.\n"
|
|
73
|
+
: "No bundled binary is available for this platform; install the CLI or set MEMNOTH_BIN.\n";
|
|
74
|
+
process.stderr.write(
|
|
75
|
+
`memnoth-mcp: could not find "${binary}".\n` +
|
|
76
|
+
resolutionHint +
|
|
77
|
+
"Install it with `cargo install memnoth`, or download a release from " +
|
|
78
|
+
"https://github.com/astrivya/memnoth/releases, then either put it on " +
|
|
79
|
+
"PATH or set MEMNOTH_BIN to its full path.\n"
|
|
80
|
+
);
|
|
81
|
+
process.exit(127);
|
|
82
|
+
}
|
|
83
|
+
process.stderr.write(`memnoth-mcp: failed to start "${binary}": ${error.message}\n`);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// Forward termination so a host that stops the server also stops the child,
|
|
88
|
+
// rather than leaving an orphan holding the vault database.
|
|
89
|
+
for (const signal of ["SIGINT", "SIGTERM"]) {
|
|
90
|
+
process.on(signal, () => {
|
|
91
|
+
if (!child.killed) {
|
|
92
|
+
child.kill(signal);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
child.on("exit", (code, signal) => {
|
|
98
|
+
if (signal) {
|
|
99
|
+
process.exit(1);
|
|
100
|
+
}
|
|
101
|
+
process.exit(code === null ? 1 : code);
|
|
102
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrivya/mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-beta.12",
|
|
4
|
+
"description": "MCP server for memnoth: bi-temporal memory vault, code graph, and multi-agent coordination. This package is a launcher for the memnoth binary.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"bin": {
|
|
7
|
+
"memnoth-mcp": "bin/memnoth-mcp.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/",
|
|
11
|
+
"vendor/",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=18"
|
|
17
|
+
},
|
|
18
|
+
"os": [
|
|
19
|
+
"linux",
|
|
20
|
+
"darwin",
|
|
21
|
+
"win32"
|
|
22
|
+
],
|
|
23
|
+
"keywords": [
|
|
24
|
+
"mcp",
|
|
25
|
+
"model-context-protocol",
|
|
26
|
+
"memory",
|
|
27
|
+
"knowledge-graph",
|
|
28
|
+
"code-graph",
|
|
29
|
+
"agent"
|
|
30
|
+
],
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/astrivya/memnoth.git"
|
|
34
|
+
},
|
|
35
|
+
"mcpName": "ai.astrivya.memnoth"
|
|
36
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|