jev-memory-mcp 0.1.0a1__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.
- jev_memory_mcp-0.1.0a1/LICENSE +19 -0
- jev_memory_mcp-0.1.0a1/MANIFEST.in +3 -0
- jev_memory_mcp-0.1.0a1/PKG-INFO +207 -0
- jev_memory_mcp-0.1.0a1/README.md +180 -0
- jev_memory_mcp-0.1.0a1/examples/claude_desktop_config.json +12 -0
- jev_memory_mcp-0.1.0a1/examples/cursor_mcp.json +12 -0
- jev_memory_mcp-0.1.0a1/examples/sdk_quickstart.py +44 -0
- jev_memory_mcp-0.1.0a1/pyproject.toml +47 -0
- jev_memory_mcp-0.1.0a1/setup.cfg +4 -0
- jev_memory_mcp-0.1.0a1/src/jev_memory_mcp/__init__.py +20 -0
- jev_memory_mcp-0.1.0a1/src/jev_memory_mcp/__main__.py +7 -0
- jev_memory_mcp-0.1.0a1/src/jev_memory_mcp/bridge.py +97 -0
- jev_memory_mcp-0.1.0a1/src/jev_memory_mcp/cli.py +115 -0
- jev_memory_mcp-0.1.0a1/src/jev_memory_mcp/client.py +268 -0
- jev_memory_mcp-0.1.0a1/src/jev_memory_mcp/protocol.py +81 -0
- jev_memory_mcp-0.1.0a1/src/jev_memory_mcp.egg-info/PKG-INFO +207 -0
- jev_memory_mcp-0.1.0a1/src/jev_memory_mcp.egg-info/SOURCES.txt +21 -0
- jev_memory_mcp-0.1.0a1/src/jev_memory_mcp.egg-info/dependency_links.txt +1 -0
- jev_memory_mcp-0.1.0a1/src/jev_memory_mcp.egg-info/entry_points.txt +2 -0
- jev_memory_mcp-0.1.0a1/src/jev_memory_mcp.egg-info/requires.txt +3 -0
- jev_memory_mcp-0.1.0a1/src/jev_memory_mcp.egg-info/top_level.txt +1 -0
- jev_memory_mcp-0.1.0a1/tests/test_protocol_and_client.py +107 -0
- jev_memory_mcp-0.1.0a1/tests/test_stdio_bridge.py +59 -0
|
@@ -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,207 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jev-memory-mcp
|
|
3
|
+
Version: 0.1.0a1
|
|
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,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.0a1"
|
|
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,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.0a1"
|
|
13
|
+
|
|
14
|
+
__all__ = [
|
|
15
|
+
"__version__",
|
|
16
|
+
"MCP_PROTOCOL_VERSION",
|
|
17
|
+
"PUBLIC_TOOLS",
|
|
18
|
+
"JevMemoryClient",
|
|
19
|
+
"JevMemoryError",
|
|
20
|
+
]
|
|
@@ -0,0 +1,97 @@
|
|
|
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
|
+
):
|
|
29
|
+
self.client = client
|
|
30
|
+
self.stdin_buf = stdin_buf if stdin_buf is not None else sys.stdin.buffer
|
|
31
|
+
self.stdout = stdout if stdout is not None else sys.stdout
|
|
32
|
+
|
|
33
|
+
def handle_message(self, req: Dict[str, Any]) -> Optional[Dict[str, Any]]:
|
|
34
|
+
method = str(req.get("method", ""))
|
|
35
|
+
has_id = "id" in req
|
|
36
|
+
req_id = req.get("id")
|
|
37
|
+
|
|
38
|
+
# Notifications carry no id and must not produce a JSON-RPC response.
|
|
39
|
+
if not has_id or method.startswith("notifications/"):
|
|
40
|
+
try:
|
|
41
|
+
self.client.send_rpc(req)
|
|
42
|
+
except JevMemoryError:
|
|
43
|
+
pass
|
|
44
|
+
return None
|
|
45
|
+
|
|
46
|
+
if method == "ping":
|
|
47
|
+
return {"jsonrpc": "2.0", "id": req_id, "result": {}}
|
|
48
|
+
|
|
49
|
+
try:
|
|
50
|
+
resp = self.client.send_rpc(req)
|
|
51
|
+
except JevMemoryError as exc:
|
|
52
|
+
return jsonrpc_error(req_id, exc.code or -32000, str(exc))
|
|
53
|
+
except Exception as exc:
|
|
54
|
+
return jsonrpc_error(req_id, -32603, f"Bridge error: {type(exc).__name__}")
|
|
55
|
+
|
|
56
|
+
if resp is None:
|
|
57
|
+
return jsonrpc_error(req_id, -32603, "Remote MCP server returned an empty response.")
|
|
58
|
+
return resp
|
|
59
|
+
|
|
60
|
+
def _emit(self, obj: Dict[str, Any]) -> None:
|
|
61
|
+
self.stdout.write(json.dumps(obj, ensure_ascii=False) + "\n")
|
|
62
|
+
self.stdout.flush()
|
|
63
|
+
|
|
64
|
+
def serve_forever(self) -> int:
|
|
65
|
+
"""Read newline-delimited JSON-RPC 2.0 requests from stdin until EOF."""
|
|
66
|
+
while True:
|
|
67
|
+
raw_line = self.stdin_buf.readline(MAX_JSONRPC_FRAME_BYTES + 1)
|
|
68
|
+
if not raw_line:
|
|
69
|
+
return 0
|
|
70
|
+
if len(raw_line) > MAX_JSONRPC_FRAME_BYTES and not raw_line.endswith(b"\n"):
|
|
71
|
+
# Drain remainder of oversized line so framing stays aligned.
|
|
72
|
+
while True:
|
|
73
|
+
chunk = self.stdin_buf.readline(4096)
|
|
74
|
+
if not chunk or chunk.endswith(b"\n"):
|
|
75
|
+
break
|
|
76
|
+
self._emit(
|
|
77
|
+
jsonrpc_error(
|
|
78
|
+
None,
|
|
79
|
+
-32600,
|
|
80
|
+
f"PAYLOAD_TOO_LARGE: request exceeds {MAX_JSONRPC_FRAME_BYTES} bytes.",
|
|
81
|
+
)
|
|
82
|
+
)
|
|
83
|
+
continue
|
|
84
|
+
try:
|
|
85
|
+
req = decode_jsonrpc_line(raw_line)
|
|
86
|
+
except json.JSONDecodeError:
|
|
87
|
+
self._emit(jsonrpc_error(None, -32700, "Parse error"))
|
|
88
|
+
continue
|
|
89
|
+
except ProtocolError as exc:
|
|
90
|
+
self._emit(jsonrpc_error(None, -32600, str(exc)))
|
|
91
|
+
continue
|
|
92
|
+
|
|
93
|
+
if req is None:
|
|
94
|
+
continue
|
|
95
|
+
resp = self.handle_message(req)
|
|
96
|
+
if resp is not None:
|
|
97
|
+
self._emit(resp)
|