Ossian Mcp

io.github.dockndevai由 GitHub 账号 dockndevai 发布v0.2.2更新于 Oct 24, 2026

Ask your own documents with citations, plus durable memory for agents. Safe by default.

已验证STDIO仅桌面知识与记忆安全与监控

概览

AI 生成的概览

让助手基于组织自有文档带引用地回答问题,并为智能体保留跨会话的持久记忆。

可以做什么
这是一个通过 stdio 连接智能体与 Ossian 实例的适配器。只读工具包括 ask_documents(基于语料库作答并给出引用,无依据时明确拒答)、list_namespaces、list_documents,以及按相关性、重要性和时效排序的 recall 记忆检索。写入工具 add_document_from_url 和 remember 需要 read-write 模式,forget_session 删除会话记忆则需要 admin 模式。只有当前访问模式允许其能力时,工具才会被注册。
适用场景
适合希望助手基于私有文档语料库作答并引用原文出处、而非依赖通用知识的场景。也适合需要跨会话持久记忆、且记忆与文档语料库相互独立的智能体。若没有可连接的运行中 Ossian 实例,则没有用处。
运行要求
需要本地 Node.js 运行环境并安装 npm 包 ossian-mcp,以及一个可通过 OSSIAN_URL 访问的运行中的 Ossian 实例。必须提供从控制台签发的 Ossian API 密钥(OSSIAN_API_KEY,osk_...)。可选变量包括 OSSIAN_AGENT_ID(默认 mcp)、OSSIAN_MODE(默认 read-only),以及 OSSIAN_ALLOW_FORGET、OSSIAN_NAMESPACE_ALLOWLIST、OSSIAN_PROTECTED_NAMESPACES、OSSIAN_DRY_RUN、OSSIAN_AUDIT_LOG 等策略变量。
安装前请注意
需要密钥 OSSIAN_API_KEY,应将其权限与命名空间限定到最小可用范围。写入类工具可抓取公开网页并记录记忆;forget_session 会不可逆地删除某次会话的记忆,需要 admin 模式并额外开启 OSSIAN_ALLOW_FORGET。可用 OSSIAN_DRY_RUN 校验并记录写入而不实际执行,OSSIAN_AUDIT_LOG 记录受控操作。共用同一 OSSIAN_AGENT_ID 的智能体会共享记忆。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Ossian Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

ossian-mcp

[npm] [licence]

MCP server for Ossian — ask your organisation's own documents and get the passages the answer came from, plus a memory for your agent that outlives the conversation.

Ossian is the server; this is the adapter that puts it in front of an agent. You need a running Ossian to point it at — see its README for a docker compose up.

What it gives an agent

Tools are gated by access mode (see Safe by default) — the server starts read-only, exposing only the four read tools until you raise the mode.

ToolForNeeds mode
ask_documentsanswer from the corpus, with citations — and say so when it cannotread-only
list_namespaceswhich slices exist, and how much is in eachread-only
list_documentswhat is available to answer from, and what is still ingestingread-only
recallretrieve what is relevant now, ranked by relevance, importance and recencyread-only
add_document_from_urlpull a public page into the corpusread-write
rememberrecord a preference, fact or decision worth keepingread-write
forget_sessionerase one conversation's memory (irreversible)admin + OSSIAN_ALLOW_FORGET

Install

bash
npm install -g ossian-mcp

You need a running Ossian and an API key. Issue one from the console (Console → API keys) or:

bash
curl -X POST "$OSSIAN_URL/api/admin/api-keys" \  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \  -d '{"name":"mcp","roles":["ossian-user"],"namespace":"handbooks"}'

Give the key the narrowest scope that works. namespace confines it to one slice, so a key that leaks reads only what that agent was for.

Configure

json
{  "mcpServers": {    "ossian": {      "command": "ossian-mcp",      "env": {        "OSSIAN_URL": "http://localhost:8081",        "OSSIAN_API_KEY": "osk_...",        "OSSIAN_AGENT_ID": "support-bot",        "OSSIAN_MODE": "read-only"      }    }  }}

OSSIAN_AGENT_ID separates one agent's memories from another's; two agents sharing an id share their recollections, which is occasionally what you want and usually not.

See docs/CLIENTS.md for Claude Code / Cursor / Codex / VS Code / Windsurf snippets, and .env.example for every supported variable.

Safe by default

The server enforces an access model on top of the Ossian API key — defence in depth over the key's own roles and namespace confinement. It reads its policy from the environment (.env.example) and enforces it in src/security.ts:

  • OSSIAN_MODE — read-only (default) → read-write → admin. A tool is registered only if the mode allows its capability. Read-only exposes four tools; ingest and remember need read-write; forget needs admin.
  • OSSIAN_ALLOW_FORGET — forget_session erases memory irreversibly, so on top of admin mode it also requires this flag.
  • OSSIAN_NAMESPACE_ALLOWLIST / OSSIAN_PROTECTED_NAMESPACES — confine which slices can be touched, and mark slices that may be read but never ingested into.
  • OSSIAN_DRY_RUN — validate and log writes (ingest / remember / forget) without executing.
  • OSSIAN_AUDIT_LOG — a JSON audit line per guarded operation, on stderr (default on).
  • Interactive confirmation — when the client supports MCP elicitation, forget_session prompts the human to approve before erasing a session's memory; clients that can't elicit fall back to the OSSIAN_ALLOW_FORGET gate.

The primary control remains the API key: issue the narrowest one that works. See SECURITY.md.

Two things worth knowing

A "not found" is an answer. ask_documents returns a refusal when nothing in the corpus supports a response, and the tool description tells the model to report that rather than falling back on general knowledge. An invented answer presented as company policy is the failure this whole system exists to prevent — do not paper over it in your own prompt.

Memory is not the corpus. recall searches what the agent was told; ask_documents searches what the organisation wrote down. They are separate stores on purpose: memories surfacing as citations in a policy answer would be indistinguishable from the policy itself.

Developing

bash
npm installnpm run buildOSSIAN_URL=http://localhost:8081 OSSIAN_API_KEY=osk_… node dist/index.js

It speaks JSON-RPC over stdio, so it will sit there waiting for a frame. To drive it by hand:

bash
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | node dist/index.js

Diagnostics go to stderr on purpose — anything written to stdout that is not a protocol frame corrupts the stream, and the failure looks like a client that cannot parse rather than a server that printed a log line.

Licence

Apache-2.0

来源:README.md,提交 d08810f

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分