jev-memory-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,19 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ Copyright 2026 JEV Memory Maintainers
8
+
9
+ Licensed under the Apache License, Version 2.0 (the "License");
10
+ you may not use this file except in compliance with the License.
11
+ You may obtain a copy of the License at
12
+
13
+ http://www.apache.org/licenses/LICENSE-2.0
14
+
15
+ Unless required by applicable law or agreed to in writing, software
16
+ distributed under the License is distributed on an "AS IS" BASIS,
17
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ See the License for the specific language governing permissions and
19
+ limitations under the License.
@@ -0,0 +1,3 @@
1
+ include LICENSE README.md pyproject.toml
2
+ recursive-include examples *.json *.py
3
+ recursive-include tests *.py
@@ -0,0 +1,207 @@
1
+ Metadata-Version: 2.4
2
+ Name: jev-memory-mcp
3
+ Version: 0.1.0
4
+ Summary: Public MCP access layer and Python SDK for JEV Memory — Different models. Shared experience. Growing capability.
5
+ Author: JEV Memory Maintainers
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/NOyu015/jev-memory-mcp
8
+ Project-URL: Documentation, https://github.com/NOyu015/jev-memory-mcp#readme
9
+ Project-URL: Issues, https://github.com/NOyu015/jev-memory-mcp/issues
10
+ Keywords: mcp,model-context-protocol,ai-memory,jev-memory,agent-memory,llm
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest>=7.0; extra == "dev"
26
+ Dynamic: license-file
27
+
28
+ # JEV Memory MCP (`jev-memory-mcp`)
29
+
30
+ **JEV Memory — Different models. Shared experience. Growing capability.**
31
+
32
+ `jev-memory-mcp` is the public, zero-dependency [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) access layer and thin Python SDK for **JEV Memory**. It connects MCP-compatible AI coding clients (Claude Desktop, Cursor, Windsurf, Cline, Claude Code) to your JEV Memory service so verified engineering experience is recalled, validated, and inherited across sessions and models.
33
+
34
+ > **Important Architecture Note:** This package contains **only the public MCP stdio bridge, CLI, and Python client SDK**. Core graph formation, structural evolution, and graph storage live exclusively on your JEV Memory backend service—you must provide a reachable `JEV_MCP_ENDPOINT` and `JEV_MCP_API_KEY`.
35
+
36
+ ## Why JEV Memory?
37
+
38
+ Stop letting AI agents re-solve the same multi-step engineering problems from scratch. JEV Memory stores execution-verified experience nodes in a lifecycle-governed graph (`CANDIDATE -> VERIFIED -> MATURE -> CORE`), keeps retrieval read-only, and updates trust/maturity only through explicit verification feedback.
39
+
40
+ ### Benchmark Scope (Transparent Disclosure)
41
+
42
+ In our controlled 100-task evaluation against Basic RAG using the same base model and budget:
43
+ - **Overall completion (100 tasks):** JEV V3.3 `75%` vs Basic RAG `77%`
44
+ - **Complex multi-step tasks (34 tasks):** JEV V3.3 `67.6%` vs Basic RAG `52.9%`
45
+
46
+ JEV Memory is **not** a universal replacement for RAG on simple document lookup, and model parameter differences must **not** be treated directly as cost savings. Its strength is reusable, execution-verified engineering workflows on complex recurring tasks.
47
+
48
+ ## Installation
49
+
50
+ Requires Python 3.9+ (zero third-party runtime dependencies).
51
+
52
+ ### Option A: Run directly with `uvx` (recommended for MCP hosts)
53
+
54
+ ```bash
55
+ uvx jev-memory-mcp --version
56
+ ```
57
+
58
+ ### Option B: Install with `pip`
59
+
60
+ ```bash
61
+ pip install jev-memory-mcp
62
+ jev-memory-mcp --version
63
+ ```
64
+
65
+ ## Quick Start & Connection Check
66
+
67
+ Set your JEV Memory service endpoint and Bearer API key as environment variables (never hardcode keys in committed files):
68
+
69
+ ```bash
70
+ export JEV_MCP_ENDPOINT="https://your-jev-service.example.com/mcp"
71
+ export JEV_MCP_API_KEY="your-bearer-token"
72
+
73
+ # Verify /health, Bearer authentication, and tools/list
74
+ jev-memory-mcp --check
75
+ ```
76
+
77
+ To print a ready-to-paste MCP client configuration snippet:
78
+
79
+ ```bash
80
+ jev-memory-mcp --print-config --endpoint "https://your-jev-service.example.com/mcp"
81
+ ```
82
+
83
+ ## MCP Client Configuration
84
+
85
+ ### Claude Desktop (`claude_desktop_config.json`)
86
+
87
+ ```json
88
+ {
89
+ "mcpServers": {
90
+ "jev-memory": {
91
+ "command": "uvx",
92
+ "args": ["jev-memory-mcp"],
93
+ "env": {
94
+ "JEV_MCP_ENDPOINT": "https://your-jev-service.example.com/mcp",
95
+ "JEV_MCP_API_KEY": "<YOUR_JEV_MCP_API_KEY>"
96
+ }
97
+ }
98
+ }
99
+ }
100
+ ```
101
+
102
+ ### Cursor (`.cursor/mcp.json`)
103
+
104
+ ```json
105
+ {
106
+ "mcpServers": {
107
+ "jev-memory": {
108
+ "command": "jev-memory-mcp",
109
+ "args": [],
110
+ "env": {
111
+ "JEV_MCP_ENDPOINT": "https://your-jev-service.example.com/mcp",
112
+ "JEV_MCP_API_KEY": "<YOUR_JEV_MCP_API_KEY>"
113
+ }
114
+ }
115
+ }
116
+ }
117
+ ```
118
+
119
+ See `examples/` for additional configuration templates and a runnable Python SDK walkthrough.
120
+
121
+ ## Available MCP Tools
122
+
123
+ | Tool | Mode | Purpose |
124
+ |---|---|---|
125
+ | `jev_recall` | Read-only | Retrieve verified experience matching a task query (`M0`/`M1`/`M2`/`M3` adaptive routing). Never mutates graph state. |
126
+ | `jev_learn` | Write (gated) | Record a newly verified engineering helper/pattern with verification evidence. |
127
+ | `jev_record` | Feedback | Submit pass/fail verification feedback for recalled node IDs to update trust, maturity, or quarantine status. |
128
+ | `jev_stats` | Read-only | Inspect tenant graph counts, lifecycle distribution, and routing stats. |
129
+ | `jev_export_mature` | Export (jailed) | Export verified `MATURE`/`CORE` subgraphs to a server-jailed `.json` filename (no overwrite). |
130
+ | `jev_snapshot` | Snapshot (jailed) | Create an atomic server-jailed full snapshot (no overwrite). |
131
+
132
+ ## Feedback Submission & Host Support Matrix
133
+
134
+ MCP exposes tools to the host LLM, **but the MCP specification itself does not force a host to call tools or submit feedback automatically.**
135
+
136
+ | MCP Host | Tool Discovery & Manual Call | Automatic Recall / Feedback | Recommended Workflow |
137
+ |---|---|---|---|
138
+ | Claude Desktop | Supported | No (prompt-driven) | Instruct Claude to call `jev_recall` before coding and `jev_record`/`jev_learn` after tests pass. |
139
+ | Cursor / Windsurf / Cline | Supported | Configurable via project rules | Add a short rule in `.cursorrules` / system instructions requiring `jev_recall` at task start and `jev_record` after test verification. |
140
+ | Claude Code / Custom Agents | Supported | Configurable via hooks/agent loop | Call `jev_recall` before task execution and `jev_record`/`jev_learn` automatically from your test verifier hook. |
141
+ | Python SDK (`JevMemoryClient`) | Direct programmatic control | Full control | Call `client.recall(...)`, run your verifier, then call `client.record(...)` / `client.learn(...)`. |
142
+
143
+ ## Python SDK Example
144
+
145
+ ```python
146
+ import os
147
+ from jev_memory_mcp import JevMemoryClient
148
+
149
+ client = JevMemoryClient(
150
+ endpoint=os.environ["JEV_MCP_ENDPOINT"],
151
+ api_key=os.environ["JEV_MCP_API_KEY"],
152
+ )
153
+
154
+ # 1. Read-only recall before solving a task
155
+ recalled = client.recall("parse iso8601 timestamp safely into YYYY-MM-DD", model_id="claude-sonnet")
156
+
157
+ # 2. Submit a verified helper after your tests pass
158
+ learned = client.learn(
159
+ task_text="parse iso8601 timestamp safely into YYYY-MM-DD",
160
+ helper_code=(
161
+ "from datetime import datetime\n"
162
+ "def parse_iso_date(s: str) -> str:\n"
163
+ " return datetime.fromisoformat(s.replace('Z', '+00:00')).strftime('%Y-%m-%d')\n"
164
+ ),
165
+ evidence="pytest: 12/12 passed",
166
+ task_id="PROJ-101",
167
+ model_id="claude-sonnet",
168
+ )
169
+
170
+ # 3. Record verification feedback in a later session or different model
171
+ client.record(
172
+ [learned["node_id"]],
173
+ passed=True,
174
+ mode="M1",
175
+ model_id="cursor-agent",
176
+ task_id="PROJ-102",
177
+ )
178
+ ```
179
+
180
+ ## Authentication, Security & Data Privacy
181
+
182
+ - **HTTPS enforced by default:** Plain `http://` is permitted only for loopback hosts (`127.0.0.1`, `localhost`, `::1`). Non-loopback plain HTTP is rejected unless `--allow-insecure-http` is explicitly passed for a private network.
183
+ - **Bearer token isolation:** Every request sends `Authorization: Bearer <JEV_MCP_API_KEY>`. API keys are never embedded in URLs, never printed in `repr()`, and never included in error messages.
184
+ - **Frame size cap:** Both stdio and HTTP requests enforce a strict `65,536`-byte JSON-RPC frame limit.
185
+ - **Tenant isolation & server-side gates:** On the JEV Memory backend, each API key maps to an isolated tenant database, with server-side rate limiting, AST code-poisoning checks, prompt-injection filtering, and jailed no-overwrite exports.
186
+ - **Data privacy:** Only the queries, code snippets, and feedback you explicitly send via MCP tool calls are transmitted to your configured `JEV_MCP_ENDPOINT`. No telemetry is collected by `jev-memory-mcp`.
187
+
188
+ ## Troubleshooting
189
+
190
+ - **`JEV_MCP_ENDPOINT is required` / `JEV_MCP_API_KEY is required`:** Set both environment variables in your shell or MCP host `env` block, then re-run `jev-memory-mcp --check`.
191
+ - **`Refusing plain http:// for a non-loopback host`:** Use an `https://` endpoint behind TLS (Cloudflare/Nginx/Caddy), or pass `--allow-insecure-http` only inside a trusted private network.
192
+ - **`Authentication failed (HTTP 401)`:** Verify your Bearer token matches an active key configured on the JEV Memory service.
193
+ - **`Rate limit exceeded (HTTP 429)`:** Reduce burst frequency or increase the tenant rate limit on your JEV Memory service.
194
+
195
+ ## Known Limitations
196
+
197
+ - Requires a running JEV Memory MCP HTTP(S) service; this package does not ship a local graph engine.
198
+ - Automatic recall and post-verification feedback depend on your MCP host's rules/hooks or explicit prompting.
199
+ - Cross-platform verification status is documented per release in the release audit report.
200
+
201
+ ## JEV Ecosystem
202
+
203
+ `jev-memory-mcp` is part of the **JEV** product family alongside the JEV auditor (`jev-guard`). Both products share the JEV brand and verification-first philosophy while maintaining completely independent architectures and release lifecycles.
204
+
205
+ ## License
206
+
207
+ Apache-2.0. See `LICENSE`.
@@ -0,0 +1,180 @@
1
+ # JEV Memory MCP (`jev-memory-mcp`)
2
+
3
+ **JEV Memory — Different models. Shared experience. Growing capability.**
4
+
5
+ `jev-memory-mcp` is the public, zero-dependency [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) access layer and thin Python SDK for **JEV Memory**. It connects MCP-compatible AI coding clients (Claude Desktop, Cursor, Windsurf, Cline, Claude Code) to your JEV Memory service so verified engineering experience is recalled, validated, and inherited across sessions and models.
6
+
7
+ > **Important Architecture Note:** This package contains **only the public MCP stdio bridge, CLI, and Python client SDK**. Core graph formation, structural evolution, and graph storage live exclusively on your JEV Memory backend service—you must provide a reachable `JEV_MCP_ENDPOINT` and `JEV_MCP_API_KEY`.
8
+
9
+ ## Why JEV Memory?
10
+
11
+ Stop letting AI agents re-solve the same multi-step engineering problems from scratch. JEV Memory stores execution-verified experience nodes in a lifecycle-governed graph (`CANDIDATE -> VERIFIED -> MATURE -> CORE`), keeps retrieval read-only, and updates trust/maturity only through explicit verification feedback.
12
+
13
+ ### Benchmark Scope (Transparent Disclosure)
14
+
15
+ In our controlled 100-task evaluation against Basic RAG using the same base model and budget:
16
+ - **Overall completion (100 tasks):** JEV V3.3 `75%` vs Basic RAG `77%`
17
+ - **Complex multi-step tasks (34 tasks):** JEV V3.3 `67.6%` vs Basic RAG `52.9%`
18
+
19
+ JEV Memory is **not** a universal replacement for RAG on simple document lookup, and model parameter differences must **not** be treated directly as cost savings. Its strength is reusable, execution-verified engineering workflows on complex recurring tasks.
20
+
21
+ ## Installation
22
+
23
+ Requires Python 3.9+ (zero third-party runtime dependencies).
24
+
25
+ ### Option A: Run directly with `uvx` (recommended for MCP hosts)
26
+
27
+ ```bash
28
+ uvx jev-memory-mcp --version
29
+ ```
30
+
31
+ ### Option B: Install with `pip`
32
+
33
+ ```bash
34
+ pip install jev-memory-mcp
35
+ jev-memory-mcp --version
36
+ ```
37
+
38
+ ## Quick Start & Connection Check
39
+
40
+ Set your JEV Memory service endpoint and Bearer API key as environment variables (never hardcode keys in committed files):
41
+
42
+ ```bash
43
+ export JEV_MCP_ENDPOINT="https://your-jev-service.example.com/mcp"
44
+ export JEV_MCP_API_KEY="your-bearer-token"
45
+
46
+ # Verify /health, Bearer authentication, and tools/list
47
+ jev-memory-mcp --check
48
+ ```
49
+
50
+ To print a ready-to-paste MCP client configuration snippet:
51
+
52
+ ```bash
53
+ jev-memory-mcp --print-config --endpoint "https://your-jev-service.example.com/mcp"
54
+ ```
55
+
56
+ ## MCP Client Configuration
57
+
58
+ ### Claude Desktop (`claude_desktop_config.json`)
59
+
60
+ ```json
61
+ {
62
+ "mcpServers": {
63
+ "jev-memory": {
64
+ "command": "uvx",
65
+ "args": ["jev-memory-mcp"],
66
+ "env": {
67
+ "JEV_MCP_ENDPOINT": "https://your-jev-service.example.com/mcp",
68
+ "JEV_MCP_API_KEY": "<YOUR_JEV_MCP_API_KEY>"
69
+ }
70
+ }
71
+ }
72
+ }
73
+ ```
74
+
75
+ ### Cursor (`.cursor/mcp.json`)
76
+
77
+ ```json
78
+ {
79
+ "mcpServers": {
80
+ "jev-memory": {
81
+ "command": "jev-memory-mcp",
82
+ "args": [],
83
+ "env": {
84
+ "JEV_MCP_ENDPOINT": "https://your-jev-service.example.com/mcp",
85
+ "JEV_MCP_API_KEY": "<YOUR_JEV_MCP_API_KEY>"
86
+ }
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ See `examples/` for additional configuration templates and a runnable Python SDK walkthrough.
93
+
94
+ ## Available MCP Tools
95
+
96
+ | Tool | Mode | Purpose |
97
+ |---|---|---|
98
+ | `jev_recall` | Read-only | Retrieve verified experience matching a task query (`M0`/`M1`/`M2`/`M3` adaptive routing). Never mutates graph state. |
99
+ | `jev_learn` | Write (gated) | Record a newly verified engineering helper/pattern with verification evidence. |
100
+ | `jev_record` | Feedback | Submit pass/fail verification feedback for recalled node IDs to update trust, maturity, or quarantine status. |
101
+ | `jev_stats` | Read-only | Inspect tenant graph counts, lifecycle distribution, and routing stats. |
102
+ | `jev_export_mature` | Export (jailed) | Export verified `MATURE`/`CORE` subgraphs to a server-jailed `.json` filename (no overwrite). |
103
+ | `jev_snapshot` | Snapshot (jailed) | Create an atomic server-jailed full snapshot (no overwrite). |
104
+
105
+ ## Feedback Submission & Host Support Matrix
106
+
107
+ MCP exposes tools to the host LLM, **but the MCP specification itself does not force a host to call tools or submit feedback automatically.**
108
+
109
+ | MCP Host | Tool Discovery & Manual Call | Automatic Recall / Feedback | Recommended Workflow |
110
+ |---|---|---|---|
111
+ | Claude Desktop | Supported | No (prompt-driven) | Instruct Claude to call `jev_recall` before coding and `jev_record`/`jev_learn` after tests pass. |
112
+ | Cursor / Windsurf / Cline | Supported | Configurable via project rules | Add a short rule in `.cursorrules` / system instructions requiring `jev_recall` at task start and `jev_record` after test verification. |
113
+ | Claude Code / Custom Agents | Supported | Configurable via hooks/agent loop | Call `jev_recall` before task execution and `jev_record`/`jev_learn` automatically from your test verifier hook. |
114
+ | Python SDK (`JevMemoryClient`) | Direct programmatic control | Full control | Call `client.recall(...)`, run your verifier, then call `client.record(...)` / `client.learn(...)`. |
115
+
116
+ ## Python SDK Example
117
+
118
+ ```python
119
+ import os
120
+ from jev_memory_mcp import JevMemoryClient
121
+
122
+ client = JevMemoryClient(
123
+ endpoint=os.environ["JEV_MCP_ENDPOINT"],
124
+ api_key=os.environ["JEV_MCP_API_KEY"],
125
+ )
126
+
127
+ # 1. Read-only recall before solving a task
128
+ recalled = client.recall("parse iso8601 timestamp safely into YYYY-MM-DD", model_id="claude-sonnet")
129
+
130
+ # 2. Submit a verified helper after your tests pass
131
+ learned = client.learn(
132
+ task_text="parse iso8601 timestamp safely into YYYY-MM-DD",
133
+ helper_code=(
134
+ "from datetime import datetime\n"
135
+ "def parse_iso_date(s: str) -> str:\n"
136
+ " return datetime.fromisoformat(s.replace('Z', '+00:00')).strftime('%Y-%m-%d')\n"
137
+ ),
138
+ evidence="pytest: 12/12 passed",
139
+ task_id="PROJ-101",
140
+ model_id="claude-sonnet",
141
+ )
142
+
143
+ # 3. Record verification feedback in a later session or different model
144
+ client.record(
145
+ [learned["node_id"]],
146
+ passed=True,
147
+ mode="M1",
148
+ model_id="cursor-agent",
149
+ task_id="PROJ-102",
150
+ )
151
+ ```
152
+
153
+ ## Authentication, Security & Data Privacy
154
+
155
+ - **HTTPS enforced by default:** Plain `http://` is permitted only for loopback hosts (`127.0.0.1`, `localhost`, `::1`). Non-loopback plain HTTP is rejected unless `--allow-insecure-http` is explicitly passed for a private network.
156
+ - **Bearer token isolation:** Every request sends `Authorization: Bearer <JEV_MCP_API_KEY>`. API keys are never embedded in URLs, never printed in `repr()`, and never included in error messages.
157
+ - **Frame size cap:** Both stdio and HTTP requests enforce a strict `65,536`-byte JSON-RPC frame limit.
158
+ - **Tenant isolation & server-side gates:** On the JEV Memory backend, each API key maps to an isolated tenant database, with server-side rate limiting, AST code-poisoning checks, prompt-injection filtering, and jailed no-overwrite exports.
159
+ - **Data privacy:** Only the queries, code snippets, and feedback you explicitly send via MCP tool calls are transmitted to your configured `JEV_MCP_ENDPOINT`. No telemetry is collected by `jev-memory-mcp`.
160
+
161
+ ## Troubleshooting
162
+
163
+ - **`JEV_MCP_ENDPOINT is required` / `JEV_MCP_API_KEY is required`:** Set both environment variables in your shell or MCP host `env` block, then re-run `jev-memory-mcp --check`.
164
+ - **`Refusing plain http:// for a non-loopback host`:** Use an `https://` endpoint behind TLS (Cloudflare/Nginx/Caddy), or pass `--allow-insecure-http` only inside a trusted private network.
165
+ - **`Authentication failed (HTTP 401)`:** Verify your Bearer token matches an active key configured on the JEV Memory service.
166
+ - **`Rate limit exceeded (HTTP 429)`:** Reduce burst frequency or increase the tenant rate limit on your JEV Memory service.
167
+
168
+ ## Known Limitations
169
+
170
+ - Requires a running JEV Memory MCP HTTP(S) service; this package does not ship a local graph engine.
171
+ - Automatic recall and post-verification feedback depend on your MCP host's rules/hooks or explicit prompting.
172
+ - Cross-platform verification status is documented per release in the release audit report.
173
+
174
+ ## JEV Ecosystem
175
+
176
+ `jev-memory-mcp` is part of the **JEV** product family alongside the JEV auditor (`jev-guard`). Both products share the JEV brand and verification-first philosophy while maintaining completely independent architectures and release lifecycles.
177
+
178
+ ## License
179
+
180
+ Apache-2.0. See `LICENSE`.
@@ -0,0 +1,12 @@
1
+ {
2
+ "mcpServers": {
3
+ "jev-memory": {
4
+ "command": "uvx",
5
+ "args": ["jev-memory-mcp"],
6
+ "env": {
7
+ "JEV_MCP_ENDPOINT": "https://your-jev-service.example.com/mcp",
8
+ "JEV_MCP_API_KEY": "<YOUR_JEV_MCP_API_KEY>"
9
+ }
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "mcpServers": {
3
+ "jev-memory": {
4
+ "command": "jev-memory-mcp",
5
+ "args": [],
6
+ "env": {
7
+ "JEV_MCP_ENDPOINT": "https://your-jev-service.example.com/mcp",
8
+ "JEV_MCP_API_KEY": "<YOUR_JEV_MCP_API_KEY>"
9
+ }
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,44 @@
1
+ """Minimal end-to-end Python SDK example for JEV Memory MCP."""
2
+ from __future__ import annotations
3
+
4
+ import os
5
+ from jev_memory_mcp import JevMemoryClient
6
+
7
+
8
+ def main() -> None:
9
+ client = JevMemoryClient(
10
+ endpoint=os.environ["JEV_MCP_ENDPOINT"],
11
+ api_key=os.environ["JEV_MCP_API_KEY"],
12
+ )
13
+ print("Health:", client.health())
14
+ print("Tools:", [t["name"] for t in client.list_tools()])
15
+
16
+ recalled = client.recall("parse iso8601 date safely", model_id="demo-model")
17
+ print("Initial recall:", recalled.get("mode"), recalled.get("node_ids"))
18
+
19
+ learned = client.learn(
20
+ task_text="parse iso8601 date safely into YYYY-MM-DD",
21
+ helper_code=(
22
+ "from datetime import datetime\n"
23
+ "def parse_iso_date(s: str) -> str:\n"
24
+ " return datetime.fromisoformat(s.replace('Z', '+00:00')).strftime('%Y-%m-%d')\n"
25
+ ),
26
+ evidence="pytest: 10/10 passed",
27
+ task_id="EXAMPLE-1",
28
+ model_id="demo-model",
29
+ )
30
+ print("Learned:", learned)
31
+
32
+ fb = client.record(
33
+ [learned["node_id"]],
34
+ passed=True,
35
+ mode="M1",
36
+ model_id="demo-model-2",
37
+ task_id="EXAMPLE-2",
38
+ )
39
+ print("Feedback:", fb)
40
+ print("Stats:", client.stats())
41
+
42
+
43
+ if __name__ == "__main__":
44
+ main()
@@ -0,0 +1,47 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "jev-memory-mcp"
7
+ version = "0.1.0"
8
+ description = "Public MCP access layer and Python SDK for JEV Memory — Different models. Shared experience. Growing capability."
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "Apache-2.0"
12
+ license-files = ["LICENSE"]
13
+ authors = [
14
+ {name = "JEV Memory Maintainers"}
15
+ ]
16
+ keywords = ["mcp", "model-context-protocol", "ai-memory", "jev-memory", "agent-memory", "llm"]
17
+ classifiers = [
18
+ "Development Status :: 3 - Alpha",
19
+ "Intended Audience :: Developers",
20
+ "Operating System :: OS Independent",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.9",
23
+ "Programming Language :: Python :: 3.10",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Programming Language :: Python :: 3.12",
26
+ "Programming Language :: Python :: 3.13",
27
+ "Topic :: Software Development :: Libraries :: Python Modules",
28
+ ]
29
+ dependencies = []
30
+
31
+ [project.optional-dependencies]
32
+ dev = ["pytest>=7.0"]
33
+
34
+ [project.scripts]
35
+ jev-memory-mcp = "jev_memory_mcp.cli:main"
36
+
37
+ [project.urls]
38
+ Homepage = "https://github.com/NOyu015/jev-memory-mcp"
39
+ Documentation = "https://github.com/NOyu015/jev-memory-mcp#readme"
40
+ Issues = "https://github.com/NOyu015/jev-memory-mcp/issues"
41
+
42
+ [tool.setuptools]
43
+ package-dir = {"" = "src"}
44
+
45
+ [tool.setuptools.packages.find]
46
+ where = ["src"]
47
+ include = ["jev_memory_mcp*"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,20 @@
1
+ """Public MCP access layer and thin Python SDK for JEV Memory.
2
+
3
+ This package intentionally contains only the public protocol client, stdio-to-HTTP
4
+ MCP bridge, and CLI. Core graph formation, structural evolution, and mature graph
5
+ storage remain on your private JEV Memory service.
6
+ """
7
+ from __future__ import annotations
8
+
9
+ from .client import JevMemoryClient, JevMemoryError
10
+ from .protocol import MCP_PROTOCOL_VERSION, PUBLIC_TOOLS
11
+
12
+ __version__ = "0.1.0"
13
+
14
+ __all__ = [
15
+ "__version__",
16
+ "MCP_PROTOCOL_VERSION",
17
+ "PUBLIC_TOOLS",
18
+ "JevMemoryClient",
19
+ "JevMemoryError",
20
+ ]
@@ -0,0 +1,7 @@
1
+ """Allow running as `python -m jev_memory_mcp`."""
2
+ from __future__ import annotations
3
+
4
+ from .cli import main
5
+
6
+ if __name__ == "__main__":
7
+ raise SystemExit(main())
@@ -0,0 +1,105 @@
1
+ """Stdio MCP JSON-RPC 2.0 bridge forwarding requests to a remote JEV Memory HTTP(S) service."""
2
+ from __future__ import annotations
3
+
4
+ import json
5
+ import sys
6
+ from typing import Any, BinaryIO, Dict, Optional, TextIO
7
+
8
+ from .client import JevMemoryClient, JevMemoryError
9
+ from .protocol import (
10
+ MAX_JSONRPC_FRAME_BYTES,
11
+ ProtocolError,
12
+ decode_jsonrpc_line,
13
+ jsonrpc_error,
14
+ )
15
+
16
+
17
+ class StdioMCPBridge:
18
+ """Bridges local MCP stdio clients (Claude Desktop, Cursor, Windsurf, Cline, Claude Code)
19
+ to a remote authenticated JEV Memory MCP HTTP(S) service.
20
+ """
21
+
22
+ def __init__(
23
+ self,
24
+ client: JevMemoryClient,
25
+ *,
26
+ stdin_buf: Optional[BinaryIO] = None,
27
+ stdout: Optional[TextIO] = None,
28
+ stdout_buf: Optional[BinaryIO] = None,
29
+ ):
30
+ self.client = client
31
+ self.stdin_buf = stdin_buf if stdin_buf is not None else sys.stdin.buffer
32
+ self.stdout = stdout
33
+ self.stdout_buf = stdout_buf if stdout_buf is not None else (None if stdout is not None else sys.stdout.buffer)
34
+
35
+ def handle_message(self, req: Dict[str, Any]) -> Optional[Dict[str, Any]]:
36
+ method = str(req.get("method", ""))
37
+ has_id = "id" in req
38
+ req_id = req.get("id")
39
+
40
+ # Notifications carry no id and must not produce a JSON-RPC response.
41
+ if not has_id or method.startswith("notifications/"):
42
+ try:
43
+ self.client.send_rpc(req)
44
+ except JevMemoryError:
45
+ pass
46
+ return None
47
+
48
+ if method == "ping":
49
+ return {"jsonrpc": "2.0", "id": req_id, "result": {}}
50
+
51
+ try:
52
+ resp = self.client.send_rpc(req)
53
+ except JevMemoryError as exc:
54
+ return jsonrpc_error(req_id, exc.code or -32000, str(exc))
55
+ except Exception as exc:
56
+ return jsonrpc_error(req_id, -32603, f"Bridge error: {type(exc).__name__}")
57
+
58
+ if resp is None:
59
+ return jsonrpc_error(req_id, -32603, "Remote MCP server returned an empty response.")
60
+ return resp
61
+
62
+ def _emit(self, obj: Dict[str, Any]) -> None:
63
+ line = json.dumps(obj, ensure_ascii=False) + "\n"
64
+ if self.stdout_buf is not None:
65
+ self.stdout_buf.write(line.encode("utf-8"))
66
+ self.stdout_buf.flush()
67
+ else:
68
+ assert self.stdout is not None
69
+ self.stdout.write(line)
70
+ self.stdout.flush()
71
+
72
+ def serve_forever(self) -> int:
73
+ """Read newline-delimited JSON-RPC 2.0 requests from stdin until EOF."""
74
+ while True:
75
+ raw_line = self.stdin_buf.readline(MAX_JSONRPC_FRAME_BYTES + 1)
76
+ if not raw_line:
77
+ return 0
78
+ if len(raw_line) > MAX_JSONRPC_FRAME_BYTES and not raw_line.endswith(b"\n"):
79
+ # Drain remainder of oversized line so framing stays aligned.
80
+ while True:
81
+ chunk = self.stdin_buf.readline(4096)
82
+ if not chunk or chunk.endswith(b"\n"):
83
+ break
84
+ self._emit(
85
+ jsonrpc_error(
86
+ None,
87
+ -32600,
88
+ f"PAYLOAD_TOO_LARGE: request exceeds {MAX_JSONRPC_FRAME_BYTES} bytes.",
89
+ )
90
+ )
91
+ continue
92
+ try:
93
+ req = decode_jsonrpc_line(raw_line)
94
+ except json.JSONDecodeError:
95
+ self._emit(jsonrpc_error(None, -32700, "Parse error"))
96
+ continue
97
+ except ProtocolError as exc:
98
+ self._emit(jsonrpc_error(None, -32600, str(exc)))
99
+ continue
100
+
101
+ if req is None:
102
+ continue
103
+ resp = self.handle_message(req)
104
+ if resp is not None:
105
+ self._emit(resp)