MCP server that lets any agent query a remote oG-Memory knowledge base with just OGMEM_API_URL + OGMEM_API_TOKEN
Project description
oG-Memory RAG MCP
An MCP server that gives any agent a
search_kb tool over a remote oG-Memory
knowledge base.
Install this MCP, set two environment variables — OGMEM_API_URL and
OGMEM_API_TOKEN — and your agent can query the shared knowledge base
directly. No local oG-Memory install, no vector DB, nothing else. The
knowledge base runs on a server; this is just the thin client that connects
your agent to it.
agent (Claude Code / Cursor / VS Code / …)
└─ ogmem-rag-mcp ──HTTP──► oG-Memory server (search_kb, token-gated)
tool: search_kb └─ vector + BM25 retrieval over the KB
Requirements
uvon PATH (providesuvx). Nothing else —uvxfetches and runs the server on demand.- An oG-Memory KB server URL and its team token (ask your admin).
Configuration (the only two you must set)
| Variable | Required | Meaning |
|---|---|---|
OGMEM_API_URL |
✅ | The KB server, e.g. http://110.40.165.184:19532 |
OGMEM_API_TOKEN |
✅ for shared servers | Team token, sent as the X-KB-Token header |
OGMEM_ACCOUNT_ID |
optional | KB account (default compatibility-sdk-5.1.1) |
OGMEM_USER_ID |
optional | Caller id recorded in retrieval signals |
OGMEM_TIMEOUT |
optional | Per-request seconds (default 60) |
Install
Every host uses the same command — uvx ogmem-rag-mcp — with the two env vars.
Pick your host below.
Cursor
Click the button (then replace <team-token> in the installed entry), or add
to ~/.cursor/mcp.json manually:
{
"mcpServers": {
"ogmem-rag": {
"command": "uvx",
"args": ["ogmem-rag-mcp"],
"env": {
"OGMEM_API_URL": "http://110.40.165.184:19532",
"OGMEM_API_TOKEN": "<team-token>"
}
}
}
}
Claude Code
One line:
claude mcp add ogmem-rag \
--env OGMEM_API_URL=http://110.40.165.184:19532 \
--env OGMEM_API_TOKEN=<team-token> \
-- uvx ogmem-rag-mcp
VS Code
Or add to .vscode/mcp.json:
{
"servers": {
"ogmem-rag": {
"command": "uvx",
"args": ["ogmem-rag-mcp"],
"env": {
"OGMEM_API_URL": "http://110.40.165.184:19532",
"OGMEM_API_TOKEN": "<team-token>"
}
}
}
}
Claude Desktop / Windsurf / Cline / Zed / any other MCP host
Same server entry in the host's MCP config file:
{
"mcpServers": {
"ogmem-rag": {
"command": "uvx",
"args": ["ogmem-rag-mcp"],
"env": {
"OGMEM_API_URL": "http://110.40.165.184:19532",
"OGMEM_API_TOKEN": "<team-token>"
}
}
}
}
Before it's on PyPI, replace
"args": ["ogmem-rag-mcp"]with"args": ["--from", "git+https://github.com/PoivronMax/oG-Memory-RAG", "ogmem-rag-mcp"]to run straight from GitHub.
Verify it can reach the server
OGMEM_API_URL=http://110.40.165.184:19532 OGMEM_API_TOKEN=<team-token> \
uvx ogmem-rag-mcp --check
# -> {"base_url": "...", "account_id": "compatibility-sdk-5.1.1", "health": {"status": "ok", ...}}
status: ok → ready. 403 → missing/wrong token. Connection error →
OGMEM_API_URL unreachable (check the address / your network).
The tool your agent gets
search_kb(query, top_k=8, snippet_chars=1500, min_score=None, categories=None)
— searches the KB and returns ranked hits. Each hit carries uri
(source/provenance), score, category, abstract, and a query-centered
snippet (with a truncated flag). Results are precise excerpts, not
whole-document dumps. When a hit looks right but its snippet is truncated,
search again with that document's distinctive terms and a larger
snippet_chars (up to 20000) to read deeper.
How it talks to the server
- Calls only
POST /api/v1/call/search_kb(retrieval) andGET /api/v1/health(probe) — both read-only and whitelisted on the server's reverse proxy. No write path is exposed. - Sends the token as
X-KB-Token; ignores system proxy env vars so a corporate/local proxy won't hijack the direct call. - Stateless: every call is independent; nothing is created on the server.
Develop
uv venv && uv pip install -e ".[dev]"
pytest # unit tests use httpx MockTransport, no live server needed
Publishing (maintainers)
Releases go to PyPI via Trusted Publishing (OIDC — no stored token). One-time:
- On PyPI, add a pending
trusted publisher: project
ogmem-rag-mcp, ownerPoivronMax, repooG-Memory-RAG, workflowpublish.yml, environmentpypi. - In the GitHub repo settings, create an environment named
pypi.
Then each release is just:
# bump version in pyproject.toml + src/ogmem_rag_mcp/__init__.py, commit, then:
git tag v0.1.0 && git push origin v0.1.0
The publish.yml workflow builds and uploads automatically.
Relationship to oG-Memory
The server side (ingestion, chunking, embedding, the search_kb endpoint)
lives in oG-Memory. This repo is
only the MCP client surface, kept standalone so it installs anywhere
without pulling in the full engine.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ogmem_rag_mcp-0.1.0.tar.gz.
File metadata
- Download URL: ogmem_rag_mcp-0.1.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ac77d5809e46a074ffd3809ec239a69df0777e19edafc9f546139a6444a41dc
|
|
| MD5 |
8330f169e7365ae5daec7242265c8784
|
|
| BLAKE2b-256 |
13d233c035172261f343ff970e1b33f9eaf3ad44e98fe511ef6f0b39e0c034e6
|
Provenance
The following attestation bundles were made for ogmem_rag_mcp-0.1.0.tar.gz:
Publisher:
publish.yml on PoivronMax/oG-Memory-RAG
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ogmem_rag_mcp-0.1.0.tar.gz -
Subject digest:
8ac77d5809e46a074ffd3809ec239a69df0777e19edafc9f546139a6444a41dc - Sigstore transparency entry: 2208596120
- Sigstore integration time:
-
Permalink:
PoivronMax/oG-Memory-RAG@96c5b5dda7a72308406807f0d3635dc3304e6af6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/PoivronMax
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@96c5b5dda7a72308406807f0d3635dc3304e6af6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ogmem_rag_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ogmem_rag_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b03510e2b9ece3c7f808a7ef61cd002c764e661a65db3b060bf09c431d1949cc
|
|
| MD5 |
b30b9c9218bf56a0848df044f6e3e8e1
|
|
| BLAKE2b-256 |
71cc8230fa7650cc1c2156f1652592d4a6ba000796545bff8b298383e0dbd56b
|
Provenance
The following attestation bundles were made for ogmem_rag_mcp-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on PoivronMax/oG-Memory-RAG
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ogmem_rag_mcp-0.1.0-py3-none-any.whl -
Subject digest:
b03510e2b9ece3c7f808a7ef61cd002c764e661a65db3b060bf09c431d1949cc - Sigstore transparency entry: 2208596365
- Sigstore integration time:
-
Permalink:
PoivronMax/oG-Memory-RAG@96c5b5dda7a72308406807f0d3635dc3304e6af6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/PoivronMax
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@96c5b5dda7a72308406807f0d3635dc3304e6af6 -
Trigger Event:
push
-
Statement type: