Skip to main content
Glama

mcp-ollama-qdrant

An MCP server that gives your AI agent a persistent vector memory backed by:

  • Ollama for embeddings (tested with qwen3-embedding:8b)

  • Qdrant as the vector store

It exposes five tools over the stdio MCP transport:

Tool

Description

save_memory(text, metadata)

Embeds text via Ollama and upserts it into Qdrant. metadata is an optional JSON string stored alongside the vector.

save_memories(texts, metadata)

Batch version: embeds a list of texts in one Ollama call and upserts them as a single batch. metadata applies to all documents.

search_memory(query, limit, filter)

Embeds query and returns the limit most similar stored memories with similarity scores. Optional filter is a payload-filter JSON string (see below).

delete_memory(point_id)

Deletes the stored memory (point) with the given ID.

list_collections()

Lists all existing Qdrant collections.

Payload filtering

search_memory accepts an optional filter JSON string built from payload fields. List values become a MatchAny condition (matches if the payload field contains any of the values), scalar values become exact matches. Multiple conditions are AND-ed together:

{"tags": ["x"]}                      // payload.tags contains "x"
{"source": "doc1"}                   // exact match
{"tags": ["a", "b"], "source": "s"}  // AND of MatchAny + match

On startup the server connects to Ollama and Qdrant and creates the collection automatically if it does not exist (cosine distance, dimension probed from the embedding model). If the collection already exists with a different vector dimension than the current EMBED_MODEL produces, the server fails fast with a clear error instead of silently storing corrupt vectors — fix it by deleting and recreating the collection, or by switching back to the original embedding model.

Requirements

  • Python 3.11+ and uv

  • A reachable Ollama instance (default http://192.168.X.X:11434)

  • A reachable Qdrant instance (default http://192.168.X.X:6333)

Related MCP server: Qdrant MCP Server

Configuration

Settings resolve in order: CLI flags > environment variables > defaults.

Setting

CLI flag

Env var

Default

Ollama base URL

--ollama-url

OLLAMA_URL

http://192.168.X.X:11434

Qdrant base URL

--qdrant-url

QDRANT_URL

http://192.168.X.X:6333

Embedding model

--embed-model

EMBED_MODEL

qwen3-embedding:8b

Collection name

--collection

COLLECTION_NAME

agent_scenarios

Running

With uv (recommended — handles the venv and sync automatically):

uv sync
uv run mcp-ollama-qdrant            # or: uv run python mcp_server.py
# with overrides:
uv run mcp-ollama-qdrant --qdrant-url http://localhost:6333

Interactive testing / inspection:

uv run mcp dev mcp_server.py

MCP client config

Add to your client's MCP config (Claude Desktop, Hermes, etc.):

{
  "mcpServers": {
    "vector-memory": {
      "command": "uv",
      "args": [
        "--directory", "/path/to/mcp-ollama-qdrant",
        "run", "mcp-ollama-qdrant"
      ],
      "env": {
        "OLLAMA_URL": "http://192.168.X.X:11434",
        "QDRANT_URL": "http://192.168.X.X:6333",
        "EMBED_MODEL": "qwen3-embedding:8b",
        "COLLECTION_NAME": "agent_scenarios"
      }
    }
  }
}

(Env entries are optional if the defaults already point at your instances.)

For Hermes ~/.hermes/config.yaml:

mcp:
  servers:
    vector-memory:
      command: uv
      args: ["--directory", "/path/to/mcp-ollama-qdrant", "run", "mcp-ollama-qdrant"]

Testing

End-to-end smoke test against live Ollama + Qdrant (saves a few memories, searches for them, prints similarity scores):

uv sync
uv run python test_server.py

Notes

  • All diagnostics are logged to stderr; stdout is reserved for the stdio MCP transport.

  • Dependency pins: numpy<2, qdrant-client<1.15, mcp[cli]<2 — chosen for compatibility with older x86-64 hardware (pre-x86-64-v2) and the mcp v2 FastMCP rename. Adjust only with reason.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides intelligent memory management capabilities using Qdrant vector database for semantic search and storage. Supports global, learned, and agent-specific memory types with markdown processing and duplicate detection.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables storing and retrieving information using semantic search with Qdrant vector database. Acts as a memory layer for LLMs to persistently store and semantically search through information and metadata.
    Apache 2.0
  • A
    license
    A
    quality
    C
    maintenance
    Persistent semantic memory for AI agents. SQLite-backed, local-first, zero config. Semantic search via Ollama embeddings with keyword fallback. Tools: remember, recall, history, forget, stats.
    17
    37
    1
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides persistent AI agent memory using a local vector database for long-term semantic storage and short-term session scratchpads. It enables low-latency memory operations including search, storage, and bulk management without external cloud dependencies.
    -