Skip to content

§ Interfaces

MCP client. One client, many servers.

Talk to OctaMem from your own Python using the standard MCP SDK. The right path when you're writing a custom agent that needs to call OctaMem alongside other MCP servers in the same loop.

Base URL
platform.octamem.com
Auth
Bearer API key
Primitives
details / search / add

Install

We use the official Python MCP SDK. OctaMem has no separate MCP client, the standard one works.

install.sh
Shell
pip install "mcp[cli]"
export OCTA_API_KEY="oct_live_..."

Connect and call

OctaMem speaks MCP over streamable HTTP. Open a session, list tools, and call remember and recall.

mcp_client.py
Python
import asyncio
import os
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client

OCTA_URL = "https://mcp.octamem.com"
TOKEN = os.environ["OCTA_API_KEY"]

async def main():
    async with streamablehttp_client(
        OCTA_URL,
        headers={"Authorization": f"Bearer {TOKEN}"},
    ) as (read, write, _):
        async with ClientSession(read, write) as session:
            await session.initialize()

            # List tools exposed by the server.
            tools = await session.list_tools()
            for t in tools.tools:
                print(t.name, ",", t.description)

            # Capture a memory.
            await session.call_tool("remember", {
                "content": "Beta opens March 20.",
                "type": "episodic",
                "scope": "acme/launch",
            })

            # Recall it.
            res = await session.call_tool("recall", {
                "query": "When does beta open?",
                "scope": "acme/launch",
            })
            print(res.content)

asyncio.run(main())

Common issues

  • 401 Unauthorized. Confirm OCTA_API_KEYis set and isn’t the placeholder string from the snippet above.
  • SSE timeout on long recalls. Bump the streamable HTTP timeout in the client config; OctaMem holds the connection open while it gathers context.
  • Tool not found. Compare the name you passed to call_tool against the output of session.list_tools(). Tool names are versioned, see the changelog if a name changed.