memory: write side has no size caps, and every mutation rewrites the whole graph file — measured linear cost (hardening note)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
Hướng nghiên cứu
Start with src/memory/index.ts, especially the write schemas at lines 889–903 and the load, save, and locking paths at lines 419, 442, and 532/610. Compare the existing read-side limits from issue #3953 and decide which write limits or README guidance fit this server. Done means the chosen limits or cost documentation address the uncapped growth and whole-file rewrite behavior described here.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Which server?
memory (@modelcontextprotocol/server-memory)
Protocol era
Modern (2026-07-28)
MCP client
No response
The problem
Summary
This is a scalability/hardening observation, not a security report and not a bug claim. In the memory server (src/memory/index.ts, checked at monorepo commit 6cfff622fb8eb41e2504340d5a6105d34094143c):
- There is no cap on the write side: no length limit on entity/relation/observation strings, and no count limit on the per-call input arrays or on the total graph. The only .max( in the file is the 2048-character cap on the search query string (index.ts:905, 909); the schemas at index.ts:889-903 carry no limits.
- Every mutation loads and validates the entire file and writes the entire graph back (temp file + rename), under the cross-process file lock: load at index.ts:442, save at index.ts:532, 610, locking at index.ts:419.
The read side already gained opt-in limits (#3953: observationLimit, limit, …), so the write side is the remaining uncapped direction.
Measured cost (real KnowledgeGraphManager, synthetic dummy graph)
Median of 3 runs, single process, one minimal mutation ("add one entity") per measurement; synthetic entities ≈240 bytes/line with 3 observations each:
| Entities | File size | Time to add 1 entity |
| 1,000 | 0.23 MB | 7 ms |
| 5,000 | 1.18 MB | 25 ms |
| 20,000 | 4.78 MB | 93 ms |
| 50,000 | 12.0 MB | 223 ms |
| 100,000 | 24.1 MB | 411 ms |
The cost is linear at ≈4.1 µs/entity, and the write volume is the whole file every time: at 100,000 entities, adding a single ~300-byte entity rewrote 24.06 MB. (Measurement harness and raw numbers are preserved on the reporter's side and can be shared verbatim.)
What this note does not claim
No availability or timeout claim is made. At the measured rate, a single mutation costs well under a second even at 100,000 entities; nothing here demonstrates a client being starved or a write timing out. The point is only the combination of (a) no operator-set ceiling on how large the store can grow through the write tools, and (b) a per-mutation cost and lock-holding time that grow linearly with that unbounded size, in the shared-file multi-client configuration the README supports.
Reporter: Tomoki Murota, CISSP
Solution you have in mind (optional)
Consider parity with the read side: opt-in caps for write payloads and/or total graph size (entities, relations, observation bytes), and/or a short README note documenting the linear per-mutation cost so operators sharing one file can size it deliberately.
Which MCP feature does it demonstrate? (optional)
No response
Alternatives or workarounds you have tried
No response
Already built it locally?
Not built. No diff is attached, per this repository's contribution model. The measurement harness and raw numbers are preserved on the reporter's side and can be shared verbatim.
Before you submit
- I searched existing issues and this is not a duplicate.
- This is a request for this repository or one of its servers, not a new server, the MCP specification or an SDK.
- Ngôn ngữ chính
- TypeScript
- Star
- 91.9k
- Fork
- 11.9k
- Merge trung bình
- 3 giờ 10 phút
- Pull request đã merge (30 ngày)
- 178
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/servers
-
bug server-sequentialthinking v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
modelcontextprotocol/servers#5526 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
modelcontextprotocol/servers#5521 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(docker): correct stale --db-path comments in fetch/git Dockerfiles and clarify git READMECó thể đã có người làm @cliffhall đã nhận hôm nay. Đang mởdocumentation server-fetch server-git v2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
modelcontextprotocol/servers#5483 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore v2
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
modelcontextprotocol/servers#5527 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
everything: README description of `get-env` masking omits the whole-segment rule — `APIKEY` / `MYKEY` are not maskedCó thể đã có người làm @cliffhall đã nhận hôm nay. Đang mởdocumentation server-everything v2
modelcontextprotocol/servers#5524 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/servers
Issue tương tự
-
maintenance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
assistant-ui/assistant-ui#10499 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
app-server bug CLI
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
cimd: default originBoundFields rejects a cross-origin client_uri, which the CIMD draft forbidsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
better-auth/better-auth#12458 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ログイン中の404画面にヘッダーとナビを出すĐang mởCodex使用可 コード
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ryuki-moro/Nicomaru#218 ·
Maintainer thường phản hồi trong vòng 3 ngày