
Osiris
io.github.MlkBlk-IT由 GitHub 账号 MlkBlk-IT 发布v0.1.0更新于 Nov 1, 2026
Cache-aware context engine for AI agents: server-side payload filtering, honest context ledger.
概览
Osiris 是一个本地运行的上下文治理服务器,为助手提供任务计划、密封状态清单、操作预检、循环检测和过滤式召回,以减少 token 消耗。
- 可以做什么
- 规划、恢复任务并查看状态,生成助手在各轮之间携带的密封清单
- 依据不变量、token 预算和重复检测来批准或拒绝某个操作
- 记录操作、检测循环、外置大块数据并登记记忆
- 以服务端过滤方式(grep、范围、大纲、聚合)按需取回已存引用,而非整段载荷
- 对会话做快照、压缩或清理,并在代理之间签发委派契约
- 以资源形式提供任务清单、状态和引用原文,并提供任务恢复提示词
- 适用场景
- 适合长时间代理会话处理大块载荷(日志、文件、工具输出)导致上下文和成本膨胀的场景,也适合希望对代理操作施加可执行规则与循环保护时使用。它与其他文件系统、Git、shell 服务器并存,而非替代它们。
- 运行要求
- 通过 stdio 本地运行;npm 包只是启动器,需要 Python 运行时(按 OSIRIS_PYTHON、uvx、python3、python 顺序解析)以及 PyPI 包 mcp-osiris。可选环境变量:OSIRIS_HOME(状态目录,默认 ~/.osiris)、OSIRIS_ROOTS(允许读取的文件根目录,留空则不读取文件)、OSIRIS_CACHE_TTL_S、OSIRIS_PRUNE_THRESHOLD_TOKENS、OSIRIS_DISPATCH_ONLY。未声明认证。
安装
在 SourceWeft 中
- 打开 控制台中的 Osiris,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
[OSIRIS — Cache-aware context engine & state governor for AI agents]
OSIRIS
[PyPI] [npm] [Python] [License]
Cache-aware context engine & state governor for AI agents. Standard MCP server, local-first, independent of any model provider.
OSIRIS makes AI agents cheaper, faster, and more reliable: fewer tokens, fewer loops, zero unnecessary tools, and zero loss of context.
OSIRIS does not replace your other MCP servers (filesystem, Git, GitHub, shell, browser…). It coexists alongside them and drastically cuts what they cost in prompt context.
1. The Core Architectural Constraint
An MCP server never sees the final prompt assembled by the client host. It only sees what the agent sends to it. Therefore, OSIRIS cannot:
The promise is honest: OSIRIS provides stable state and an enforceable safety contract, not a client prompt builder.
2. Sealed Manifest — The Core Design
osiris.plan returns a deterministic block (~120 tokens) that the agent carries at a fixed position in its context window:
The SEAL is a SHA256 digest of stable zones. The agent passes it on every turn to osiris.observe: OSIRIS recomputes and detects any state drift immediately.
This is OSIRIS's passive transport: even if the agent stops calling tools, it carries the essential state cleanly.
Three Hashes Because Prompt Cache is Prefix-Based
Appending a constraint or decision changes
tail_hashbut notprefix_hash: the prompt cache holds, only the new tokens are prefilled.Rewriting a pinned decision is explicitly caught: OSIRIS checks collection identity, flagging a semantic break (
semantic_break: true,cause: pinned_rewrite).
3. The 6 MCP Tools
Access footprint: 1,019 tokens of schemas and descriptions in model context (measured via bench/run_bench.py). Paid on task start, amortized across the session — pays off on the very first turn with ≥800 token payloads.
osiris.observe combines logging, loop protection, payload externalization, memory registry, and automated pruning in a single call so the agent always reports back seamlessly.
Extended Operations
Resources & Prompts
osiris://task/{task_id}/manifest— Active zones, drift status, objectiveosiris://task/{task_id}/status— Real-time context pressureosiris://ref/{ref}— Raw byte content of any referenced payload- Prompt
osiris/task-resume— Clean agent recovery template after crashes
4. Architecture
5. Memory Model
Deterministic, typed, content-addressable memory — not an opaque vector database.
Scopes: task → project → agent → global.
6. Cache-Aware Pruning
Security Invariant: Pruning moves payload data to content-addressed refs (mem://sha256:…). It NEVER deletes.
7. LoopGuard Protection
8. Invariants (Guard Rails)
Define project safety rules in .osiris/invariants.toml:
9. Lossless Verification & Non-Loss Proof
OSIRIS guarantees full auditability for offloaded data:
- Self-verifying refs:
mem://sha256:<hash>. Reads re-verify data integrity against the hash before returning. - Zero deletion paths: data is relocated to the local store, never pruned permanently.
- Reproducible audit: Outputs cryptographic proof of non-loss:
10. Verified Benchmarks
Real measurements from python bench\run_bench.py running an automated coding workflow:
- Access Cost: 1,019 tokens of schemas, amortized across session tasks.
- Session Net Gate: PASS (Worst-case net across full suite: +951 tokens).
- At 20,000 tokens: +71.46% net savings on context usage.
11. Quick Start
CLI Verification
Registration as MCP Server
Add to your client configuration (mcp.json):
12. Installation
From PyPI (recommended)
From npm (no Python setup)
The npm package is a stdio launcher. It resolves the Python runtime in this
order — OSIRIS_PYTHON → uvx → python3 → python — and runs the PyPI
package mcp-osiris.
From source
MCP client configuration
License
MIT © 2026 Malik Belkacemi (MLKBLK-IT)
来源:README.md,提交 57651cd
工具
0版本历史
1- v0.1.0最新Nov 1, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分