Skip to main content
Glama

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.

Tool

For

Needs mode

ask_documents

answer from the corpus, with citations — and say so when it cannot

read-only

list_namespaces

which slices exist, and how much is in each

read-only

list_documents

what is available to answer from, and what is still ingesting

read-only

recall

retrieve what is relevant now, ranked by relevance, importance and recency

read-only

add_document_from_url

pull a public page into the corpus

read-write

remember

record a preference, fact or decision worth keeping

read-write

forget_session

erase one conversation's memory (irreversible)

admin + OSSIAN_ALLOW_FORGET

Related MCP server: MCP Server + Document Memory System

Install

npm install -g ossian-mcp

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

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

{
  "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

npm install
npm run build
OSSIAN_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:

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

Available Tools

4 tools
ask_documentsAsk the documentsA
Read-onlyIdempotent

Answer a question from the organisation's own documents, with citations. Returns the exact passages the answer was written from. Use this for anything about internal policy, runbooks, handbooks, contracts or product documentation — anything the user's organisation wrote down. If nothing in the corpus supports an answer this reports that rather than guessing: treat 'not found' as the real answer and say so, do not fall back on general knowledge and present it as the organisation's policy.

Inputs: question (required), namespace.

list_documentsList documentsA
Read-onlyIdempotent

List the documents available to answer from, with their ingestion status. Use this to tell the user what the system actually knows about, or to check whether something they uploaded has finished processing.

Inputs: namespace.

list_namespacesList namespacesA
Read-onlyIdempotent

List the slices the document corpus is divided into, with how many documents each holds. Use this before ask_documents when a question clearly belongs to one area and you want to avoid another area answering it.

Inputs: no named parameters.

recallRecall from memoryA
Read-onlyIdempotent

Retrieve what was previously remembered that relates to the current situation. Ranked by relevance, weighted by importance and decayed by age, so a recent statement outranks an old one saying the opposite. Worth calling at the start of a conversation with a returning user. This searches memory, not documents — use ask_documents for anything the organisation wrote down.

Inputs: query (required), limit, agentId, subject, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 4 tools

    Disambiguation4/5

    recall vs ask_documents is clearly delineated (memory vs organisational documents) and reinforced with explicit cross-references in the descriptions. list_documents and list_namespaces are both listing operations but target different resources (documents vs corpus slices with counts), so an agent should rarely confuse them.

    Naming Consistency3/5

    Two tools follow a clean list_* pattern (list_documents, list_namespaces) and ask_documents uses a verb_noun form, but 'recall' is a bare verb with no object, breaking the pattern. The set is still readable, just not uniformly conventional.

    Tool Count4/5

    Four tools is on the lean side but suits a narrow retrieval/memory scope where each tool earns its place. Nothing feels redundant or excessive for the stated purpose.

    Completeness3/5

    The read path is well covered (list documents, list namespaces, ask, recall), but there is no tool to store or update memories, and no way to fetch or inspect a single document. If ingestion is handled externally this is workable, but the memory side looks write-incomplete.

    Maintenance

    ActivityActive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides AI agents with persistent, searchable memory that survives across conversations using semantic search, temporal versioning, and smart organization. Enables long-term context retention and cross-session continuity for AI assistants.
      14
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents with long-term memory and retrieval-augmented generation (RAG) capabilities, allowing them to recall past conversations, search local files, and learn user preferences.
      MIT