memoire-mcp 0.1.0__tar.gz

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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tazwar Ahnaf
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,177 @@
1
+ Metadata-Version: 2.4
2
+ Name: memoire-mcp
3
+ Version: 0.1.0
4
+ Summary: MCP Server for the Memoire semantic memory engine
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://github.com/tazwaryayyyy/Memorie-AI
7
+ Project-URL: Repository, https://github.com/tazwaryayyyy/Memorie-AI
8
+ Project-URL: Issues, https://github.com/tazwaryayyyy/Memorie-AI/issues
9
+ Project-URL: Changelog, https://github.com/tazwaryayyyy/Memorie-AI/blob/main/CHANGELOG.md
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: mcp[cli]==1.27.1
14
+ Requires-Dist: memoire-engine<0.2.0,>=0.1.0
15
+ Provides-Extra: dev
16
+ Requires-Dist: pytest==8.4.2; extra == "dev"
17
+ Dynamic: license-file
18
+
19
+ # memoire-mcp
20
+
21
+ <!-- mcp-name: io.github.tazwaryayyyy/memoire-mcp -->
22
+
23
+ MCP stdio server for Memoire. Python package: `memoire_mcp`. Console script:
24
+ `memoire-mcp` (also `python -m memoire_mcp`).
25
+
26
+ ## Run from a source checkout
27
+
28
+ Requires a Rust toolchain: the Python SDK (`bindings/python`, import name
29
+ `memoire_engine`) is a PyO3 extension built with maturin.
30
+
31
+ ```bash
32
+ cd mcp-server
33
+ uv sync --locked --extra dev # builds the native extension via maturin
34
+ uv run memoire-mcp
35
+ ```
36
+
37
+ Manual virtualenv install (package smoke tests):
38
+
39
+ ```bash
40
+ python -m pip install ./bindings/python # builds the PyO3 extension
41
+ python -m pip install "mcp[cli]==1.27.1"
42
+ python -m pip install --no-deps ./mcp-server
43
+ memoire-mcp
44
+ ```
45
+
46
+ Use `--no-deps` for the last step until the SDK's PyPI name is final: the
47
+ provisional name `memoire-engine` is not registered, and the unrelated PyPI
48
+ project `memoire` must never be installed in its place.
49
+
50
+ `MEMOIRE_LIB` and `cargo build --release` are **not** used by the Python package.
51
+ If the server reports `native_library_unavailable`, run `maturin develop --release`
52
+ inside `bindings/python` in the same virtualenv that runs the server.
53
+
54
+ First use downloads the embedding model (about 23 MB, from Hugging Face) unless it
55
+ is already cached.
56
+
57
+ ## MCP client configuration
58
+
59
+ Nothing is published to PyPI yet, so every command below points at the console script of a
60
+ virtualenv you built from a source checkout (see above). Replace the `/ABSOLUTE/PATH/...`
61
+ placeholders; on Windows use `...\.venv\Scripts\memoire-mcp.exe` and a path such as
62
+ `C:\Users\you\.memoire\memoire.db`.
63
+
64
+ Set `FASTEMBED_CACHE_DIR` to **one shared directory** in every client. Without it (and without
65
+ `HF_HOME`), the embedding model (about 23 MB) is downloaded into `./.fastembed_cache` relative to
66
+ the server's working directory, i.e. once per project. The first tool call that needs the
67
+ embedder downloads the model and can exceed a client's tool timeout; make one throwaway tool
68
+ call right after setup to warm the cache before relying on it.
69
+
70
+ ### Claude Code
71
+
72
+ Options must come before the server name, and `--` separates them from the command. Keep
73
+ `--transport stdio` between `--env` and the name: if the name directly follows `--env`, the CLI
74
+ reads it as another `KEY=VALUE` pair.
75
+
76
+ ```bash
77
+ claude mcp add --scope user \
78
+ --env MEMOIRE_DB_PATH=/ABSOLUTE/PATH/TO/memoire.db \
79
+ --env FASTEMBED_CACHE_DIR=/ABSOLUTE/PATH/TO/.fastembed_cache \
80
+ --transport stdio memoire \
81
+ -- /ABSOLUTE/PATH/TO/.venv/bin/memoire-mcp
82
+ ```
83
+
84
+ `--scope user` makes the server available in every project and keeps its configuration out of
85
+ the repository (`--scope project` would write `.mcp.json` into it). Check with
86
+ `claude mcp list`.
87
+
88
+ ### Cursor
89
+
90
+ Put this in `~/.cursor/mcp.json` (all projects) or `<project>/.cursor/mcp.json`:
91
+
92
+ ```json
93
+ {
94
+ "mcpServers": {
95
+ "memoire": {
96
+ "command": "/ABSOLUTE/PATH/TO/.venv/bin/memoire-mcp",
97
+ "env": {
98
+ "MEMOIRE_DB_PATH": "/ABSOLUTE/PATH/TO/memoire.db",
99
+ "FASTEMBED_CACHE_DIR": "/ABSOLUTE/PATH/TO/.fastembed_cache"
100
+ }
101
+ }
102
+ }
103
+ }
104
+ ```
105
+
106
+ ### Any other stdio client
107
+
108
+ ```json
109
+ {
110
+ "mcpServers": {
111
+ "memoire": {
112
+ "command": "/ABSOLUTE/PATH/TO/.venv/bin/memoire-mcp",
113
+ "env": {
114
+ "MEMOIRE_DB_PATH": "/ABSOLUTE/PATH/TO/memoire.db",
115
+ "FASTEMBED_CACHE_DIR": "/ABSOLUTE/PATH/TO/.fastembed_cache"
116
+ }
117
+ }
118
+ }
119
+ }
120
+ ```
121
+
122
+ The old `python /path/to/mcp-server/server.py` invocation no longer exists. Once
123
+ `memoire-mcp` is published, running it through `uvx` should also work; that has not been tested
124
+ because nothing is published.
125
+
126
+ ### `MEMOIRE_TRIAL_CAP`
127
+
128
+ Optional (non-negative integer; an invalid value stops the server with exit code `2`). A recall
129
+ returns at most this many *unverified* memories (ones with no recorded feedback); the default is
130
+ `1`. With a fresh database every memory is unverified, so by default a recall returns one
131
+ result. Raising it makes recalls return more results before any feedback exists. It changes how
132
+ many results are offered, **not** how good they are: the only pre-registered evaluation run so far
133
+ did not show an accuracy benefit for the default or for any other setting (the `trial_cap=3`
134
+ numbers in it are exploratory and not inferential; see "Evidence so far" in the repository
135
+ README). Choose a value for how many results you want to see, not for an expected accuracy gain.
136
+
137
+ ## Database location
138
+
139
+ Highest precedence first:
140
+
141
+ 1. `MEMOIRE_DB_PATH`, then `MEMOIRE_DB`: explicit operator configuration, used as given.
142
+ 2. `<workspace>/.memoire_path`: **must resolve to a location inside the workspace**
143
+ (symlinks are followed). A target outside it is rejected with an error, because the
144
+ file lives in the repository, which may be untrusted. To use a database elsewhere,
145
+ set `MEMOIRE_DB_PATH`.
146
+ 3. `<workspace>/memoire.db`.
147
+
148
+ MCP's initialize handshake carries no workspace folder, so `<workspace>` is the
149
+ server process's working directory unless the client sends non-standard
150
+ `workspaceFolders`/`rootUri` fields. Set `MEMOIRE_DB_PATH` explicitly if your client
151
+ does not start the server in the project directory.
152
+
153
+ ## Admin tools (off by default)
154
+
155
+ `memoire_clear` and `memoire_import` are **not listed** unless the server is started
156
+ with `MEMOIRE_ENABLE_ADMIN_TOOLS=1` (also `true`, `yes`, `on`). An agent, or text that
157
+ steers it, should not be able to wipe or bulk-load memory by default. The flag is read
158
+ at startup (restart to change it) and re-checked on every call.
159
+
160
+ `memoire_import` always treats the snapshot as untrusted: only each memory's `content`
161
+ is used, and trust metadata (`trust_ema`, `reinforcement_count`, `importance_base`,
162
+ `confidence`, `created_at`) is ignored, so an imported memory is no more trusted than a
163
+ freshly remembered one. At most 1000 memories per call. `memoire_forget` is not gated.
164
+
165
+ ## Tool notes
166
+
167
+ - `memoire_recall` and `memoire_recall_explained` return live memories only unless
168
+ `include_shadow=true`, which is passed to the engine as `include_hidden` (hidden rows
169
+ included, trial cap skipped). Each memory has an `exposure` label.
170
+ - `MEMOIRE_TRIAL_CAP` overrides the engine's `trial_cap` (default `1`: with no feedback a
171
+ recall returns at most one result). Non-integer or negative values stop the server.
172
+ - Feedback tools send one session id per server process (`memoire_status` shows it).
173
+ - `memoire_identify_gaps` `min_trust` defaults to the engine HINT threshold (0.40).
174
+ - `memoire_export` returns `{"ok": true, "error": null, "snapshot": {...}}`; pass the
175
+ `snapshot` value to `memoire_import`.
176
+
177
+ See `docs/RELEASE.md` in the repository root for the release workflow.
@@ -0,0 +1,159 @@
1
+ # memoire-mcp
2
+
3
+ <!-- mcp-name: io.github.tazwaryayyyy/memoire-mcp -->
4
+
5
+ MCP stdio server for Memoire. Python package: `memoire_mcp`. Console script:
6
+ `memoire-mcp` (also `python -m memoire_mcp`).
7
+
8
+ ## Run from a source checkout
9
+
10
+ Requires a Rust toolchain: the Python SDK (`bindings/python`, import name
11
+ `memoire_engine`) is a PyO3 extension built with maturin.
12
+
13
+ ```bash
14
+ cd mcp-server
15
+ uv sync --locked --extra dev # builds the native extension via maturin
16
+ uv run memoire-mcp
17
+ ```
18
+
19
+ Manual virtualenv install (package smoke tests):
20
+
21
+ ```bash
22
+ python -m pip install ./bindings/python # builds the PyO3 extension
23
+ python -m pip install "mcp[cli]==1.27.1"
24
+ python -m pip install --no-deps ./mcp-server
25
+ memoire-mcp
26
+ ```
27
+
28
+ Use `--no-deps` for the last step until the SDK's PyPI name is final: the
29
+ provisional name `memoire-engine` is not registered, and the unrelated PyPI
30
+ project `memoire` must never be installed in its place.
31
+
32
+ `MEMOIRE_LIB` and `cargo build --release` are **not** used by the Python package.
33
+ If the server reports `native_library_unavailable`, run `maturin develop --release`
34
+ inside `bindings/python` in the same virtualenv that runs the server.
35
+
36
+ First use downloads the embedding model (about 23 MB, from Hugging Face) unless it
37
+ is already cached.
38
+
39
+ ## MCP client configuration
40
+
41
+ Nothing is published to PyPI yet, so every command below points at the console script of a
42
+ virtualenv you built from a source checkout (see above). Replace the `/ABSOLUTE/PATH/...`
43
+ placeholders; on Windows use `...\.venv\Scripts\memoire-mcp.exe` and a path such as
44
+ `C:\Users\you\.memoire\memoire.db`.
45
+
46
+ Set `FASTEMBED_CACHE_DIR` to **one shared directory** in every client. Without it (and without
47
+ `HF_HOME`), the embedding model (about 23 MB) is downloaded into `./.fastembed_cache` relative to
48
+ the server's working directory, i.e. once per project. The first tool call that needs the
49
+ embedder downloads the model and can exceed a client's tool timeout; make one throwaway tool
50
+ call right after setup to warm the cache before relying on it.
51
+
52
+ ### Claude Code
53
+
54
+ Options must come before the server name, and `--` separates them from the command. Keep
55
+ `--transport stdio` between `--env` and the name: if the name directly follows `--env`, the CLI
56
+ reads it as another `KEY=VALUE` pair.
57
+
58
+ ```bash
59
+ claude mcp add --scope user \
60
+ --env MEMOIRE_DB_PATH=/ABSOLUTE/PATH/TO/memoire.db \
61
+ --env FASTEMBED_CACHE_DIR=/ABSOLUTE/PATH/TO/.fastembed_cache \
62
+ --transport stdio memoire \
63
+ -- /ABSOLUTE/PATH/TO/.venv/bin/memoire-mcp
64
+ ```
65
+
66
+ `--scope user` makes the server available in every project and keeps its configuration out of
67
+ the repository (`--scope project` would write `.mcp.json` into it). Check with
68
+ `claude mcp list`.
69
+
70
+ ### Cursor
71
+
72
+ Put this in `~/.cursor/mcp.json` (all projects) or `<project>/.cursor/mcp.json`:
73
+
74
+ ```json
75
+ {
76
+ "mcpServers": {
77
+ "memoire": {
78
+ "command": "/ABSOLUTE/PATH/TO/.venv/bin/memoire-mcp",
79
+ "env": {
80
+ "MEMOIRE_DB_PATH": "/ABSOLUTE/PATH/TO/memoire.db",
81
+ "FASTEMBED_CACHE_DIR": "/ABSOLUTE/PATH/TO/.fastembed_cache"
82
+ }
83
+ }
84
+ }
85
+ }
86
+ ```
87
+
88
+ ### Any other stdio client
89
+
90
+ ```json
91
+ {
92
+ "mcpServers": {
93
+ "memoire": {
94
+ "command": "/ABSOLUTE/PATH/TO/.venv/bin/memoire-mcp",
95
+ "env": {
96
+ "MEMOIRE_DB_PATH": "/ABSOLUTE/PATH/TO/memoire.db",
97
+ "FASTEMBED_CACHE_DIR": "/ABSOLUTE/PATH/TO/.fastembed_cache"
98
+ }
99
+ }
100
+ }
101
+ }
102
+ ```
103
+
104
+ The old `python /path/to/mcp-server/server.py` invocation no longer exists. Once
105
+ `memoire-mcp` is published, running it through `uvx` should also work; that has not been tested
106
+ because nothing is published.
107
+
108
+ ### `MEMOIRE_TRIAL_CAP`
109
+
110
+ Optional (non-negative integer; an invalid value stops the server with exit code `2`). A recall
111
+ returns at most this many *unverified* memories (ones with no recorded feedback); the default is
112
+ `1`. With a fresh database every memory is unverified, so by default a recall returns one
113
+ result. Raising it makes recalls return more results before any feedback exists. It changes how
114
+ many results are offered, **not** how good they are: the only pre-registered evaluation run so far
115
+ did not show an accuracy benefit for the default or for any other setting (the `trial_cap=3`
116
+ numbers in it are exploratory and not inferential; see "Evidence so far" in the repository
117
+ README). Choose a value for how many results you want to see, not for an expected accuracy gain.
118
+
119
+ ## Database location
120
+
121
+ Highest precedence first:
122
+
123
+ 1. `MEMOIRE_DB_PATH`, then `MEMOIRE_DB`: explicit operator configuration, used as given.
124
+ 2. `<workspace>/.memoire_path`: **must resolve to a location inside the workspace**
125
+ (symlinks are followed). A target outside it is rejected with an error, because the
126
+ file lives in the repository, which may be untrusted. To use a database elsewhere,
127
+ set `MEMOIRE_DB_PATH`.
128
+ 3. `<workspace>/memoire.db`.
129
+
130
+ MCP's initialize handshake carries no workspace folder, so `<workspace>` is the
131
+ server process's working directory unless the client sends non-standard
132
+ `workspaceFolders`/`rootUri` fields. Set `MEMOIRE_DB_PATH` explicitly if your client
133
+ does not start the server in the project directory.
134
+
135
+ ## Admin tools (off by default)
136
+
137
+ `memoire_clear` and `memoire_import` are **not listed** unless the server is started
138
+ with `MEMOIRE_ENABLE_ADMIN_TOOLS=1` (also `true`, `yes`, `on`). An agent, or text that
139
+ steers it, should not be able to wipe or bulk-load memory by default. The flag is read
140
+ at startup (restart to change it) and re-checked on every call.
141
+
142
+ `memoire_import` always treats the snapshot as untrusted: only each memory's `content`
143
+ is used, and trust metadata (`trust_ema`, `reinforcement_count`, `importance_base`,
144
+ `confidence`, `created_at`) is ignored, so an imported memory is no more trusted than a
145
+ freshly remembered one. At most 1000 memories per call. `memoire_forget` is not gated.
146
+
147
+ ## Tool notes
148
+
149
+ - `memoire_recall` and `memoire_recall_explained` return live memories only unless
150
+ `include_shadow=true`, which is passed to the engine as `include_hidden` (hidden rows
151
+ included, trial cap skipped). Each memory has an `exposure` label.
152
+ - `MEMOIRE_TRIAL_CAP` overrides the engine's `trial_cap` (default `1`: with no feedback a
153
+ recall returns at most one result). Non-integer or negative values stop the server.
154
+ - Feedback tools send one session id per server process (`memoire_status` shows it).
155
+ - `memoire_identify_gaps` `min_trust` defaults to the engine HINT threshold (0.40).
156
+ - `memoire_export` returns `{"ok": true, "error": null, "snapshot": {...}}`; pass the
157
+ `snapshot` value to `memoire_import`.
158
+
159
+ See `docs/RELEASE.md` in the repository root for the release workflow.
@@ -0,0 +1 @@
1
+ """Memoire MCP server (stdio). Entry point: ``memoire-mcp`` or ``python -m memoire_mcp``."""
@@ -0,0 +1,4 @@
1
+ from .server import main
2
+
3
+ if __name__ == "__main__":
4
+ main()