> ## Documentation Index
> Fetch the complete documentation index at: https://renor.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Renor in your own agent

> Give the agents you build the same memory as the agents you use: copy-paste MCP setup for the AI SDK, Mastra, LangChain, the OpenAI Agents SDK, the Claude Agent SDK, Google ADK, Pydantic AI and Agno.

Every agent framework below is already an MCP client, so your own agent reaches Renor the way Claude Code or Codex does: one MCP address and one key. What your coding agent saved, your own agent can recall, and the other way round.

```text theme={null}
https://mcp.renor.cloud/mcp
```

## Before you start

1. In the [dashboard](https://app.renor.cloud), open **API keys** and choose **Create key**. The key is shown once; it works for 365 days and you can revoke it there.
2. Put it in your environment. Every example on this page reads it from `RENOR_API_KEY` and sends it as `Authorization: Bearer <key>`.

```bash theme={null}
export RENOR_API_KEY="paste-your-key-here"
```

The key belongs to your workspace: an agent using it reads and writes the same memory as every other agent you have connected (see [Several agents, one memory](https://renor.mintlify.site/several-agents-one-memory.md)). Keep it on the server side of your app, never in a browser.

Renor serves 24 tools ([Tools](https://renor.mintlify.site/tools.md)). Two do most of the work, and the examples tell the model to use them:

* `get_context`: call it before answering, with the current request.
* `remember`: call it when the user asks to keep something.

A framework sends the model every tool it is given, and the 24 tool descriptions come to about 10,000 tokens on each request. Where a framework can keep only some tools (the Google ADK and Agno examples do), keeping these two cuts that cost.

Each example runs the agent twice, as two separate conversations. The first tells it how you deploy (with Kamal, to a server named orca-7); the second starts with no history, asks how you deploy, and can only answer from Renor. Swap the model for any model your framework supports.

## AI SDK

```bash theme={null}
npm install ai @ai-sdk/mcp
```

```ts agent.ts theme={null}
import { createMCPClient } from '@ai-sdk/mcp';
import { generateText, isStepCount } from 'ai';

const renor = await createMCPClient({
  transport: {
    type: 'http',
    url: 'https://mcp.renor.cloud/mcp',
    headers: { Authorization: `Bearer ${process.env.RENOR_API_KEY}` },
  },
});

try {
  const tools = await renor.tools();
  for (const prompt of ['Remember that I deploy with Kamal to the server orca-7.', 'How do I deploy?']) {
    const { text } = await generateText({
      model: 'openai/gpt-5',
      tools,
      stopWhen: isStepCount(10),
      system: 'Renor is your long-term memory. Before answering, call get_context with the request: it holds what the user told you in earlier conversations. When the user asks you to remember something, call remember.',
      prompt,
    });
    console.log(text);
  }
} finally {
  await renor.close();
}
```

## Mastra

```bash theme={null}
npm install @mastra/core @mastra/mcp
```

```ts agent.ts theme={null}
import { Agent } from '@mastra/core/agent';
import { MCPClient } from '@mastra/mcp';

const mcp = new MCPClient({
  servers: {
    renor: {
      url: new URL('https://mcp.renor.cloud/mcp'),
      requestInit: { headers: { Authorization: `Bearer ${process.env.RENOR_API_KEY}` } },
    },
  },
});

const agent = new Agent({
  id: 'assistant',
  name: 'Assistant',
  instructions: 'Renor is your long-term memory. Before answering, call renor_get_context with the request: it holds what the user told you in earlier conversations. When the user asks you to remember something, call renor_remember.',
  model: 'openai/gpt-5',
  tools: await mcp.listTools(),
});

for (const prompt of ['Remember that I deploy with Kamal to the server orca-7.', 'How do I deploy?']) {
  const result = await agent.generate(prompt);
  console.log(result.text);
}
await mcp.disconnect();
```

Mastra prefixes each tool with the server's name, so `remember` is `renor_remember`.

## LangChain and LangGraph

```bash theme={null}
pip install langchain langchain-mcp-adapters langchain-openai
```

```python agent.py theme={null}
import asyncio
import os

from langchain.agents import create_agent
from langchain_mcp_adapters.client import MultiServerMCPClient


async def main():
    client = MultiServerMCPClient({
        "renor": {
            "transport": "streamable_http",
            "url": "https://mcp.renor.cloud/mcp",
            "headers": {"Authorization": f"Bearer {os.environ['RENOR_API_KEY']}"},
        }
    })
    agent = create_agent(
        "openai:gpt-5",
        await client.get_tools(),
        system_prompt="Renor is your long-term memory. Before answering, call get_context with the request: it holds what the user told you in earlier conversations. When the user asks you to remember something, call remember.",
    )
    for prompt in ["Remember that I deploy with Kamal to the server orca-7.", "How do I deploy?"]:
        result = await agent.ainvoke({"messages": [("user", prompt)]})
        print(result["messages"][-1].content)


asyncio.run(main())
```

`create_agent` returns a LangGraph graph, so the same tools work in a graph you build yourself.

## OpenAI Agents SDK

```bash theme={null}
pip install openai-agents
```

```python agent.py theme={null}
import asyncio
import os

from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp


async def main():
    async with MCPServerStreamableHttp(
        name="renor",
        params={
            "url": "https://mcp.renor.cloud/mcp",
            "headers": {"Authorization": f"Bearer {os.environ['RENOR_API_KEY']}"},
        },
    ) as renor:
        agent = Agent(
            name="Assistant",
            model="gpt-5",
            instructions="Renor is your long-term memory. Before answering, call get_context with the request: it holds what the user told you in earlier conversations. When the user asks you to remember something, call remember.",
            mcp_servers=[renor],
        )
        for prompt in ["Remember that I deploy with Kamal to the server orca-7.", "How do I deploy?"]:
            result = await Runner.run(agent, prompt)
            print(result.final_output)


asyncio.run(main())
```

## Claude Agent SDK

```bash theme={null}
npm install @anthropic-ai/claude-agent-sdk
```

```ts agent.ts theme={null}
import { query, type Options } from '@anthropic-ai/claude-agent-sdk';

const options: Options = {
  mcpServers: {
    renor: {
      type: 'http',
      url: 'https://mcp.renor.cloud/mcp',
      headers: { Authorization: `Bearer ${process.env.RENOR_API_KEY}` },
    },
  },
  allowedTools: ['mcp__renor__get_context', 'mcp__renor__remember'],
  systemPrompt: 'Renor is your long-term memory. Before answering, call get_context with the request: it holds what the user told you in earlier conversations. When the user asks you to remember something, call remember.',
};

for (const prompt of ['Remember that I deploy with Kamal to the server orca-7.', 'How do I deploy?']) {
  for await (const message of query({ prompt, options })) {
    if (message.type === 'result' && message.subtype === 'success') console.log(message.result);
  }
}
```

The SDK names MCP tools `mcp__<server>__<tool>`; `allowedTools` lets the agent call these two without asking.

## Google ADK

```bash theme={null}
pip install "google-adk[mcp]"
```

The `[mcp]` extra is needed: without it the MCP toolset cannot be imported.

```python agent.py theme={null}
import asyncio
import os

from google.adk.agents import LlmAgent
from google.adk.runners import InMemoryRunner
from google.adk.tools.mcp_tool import McpToolset, StreamableHTTPConnectionParams

renor = McpToolset(
    connection_params=StreamableHTTPConnectionParams(
        url="https://mcp.renor.cloud/mcp",
        headers={"Authorization": f"Bearer {os.environ['RENOR_API_KEY']}"},
    ),
    tool_filter=["get_context", "remember"],
)
agent = LlmAgent(
    name="assistant",
    model="gemini-2.5-flash",
    instruction="Renor is your long-term memory. Before answering, call get_context with the request: it holds what the user told you in earlier conversations. When the user asks you to remember something, call remember.",
    tools=[renor],
)


async def main():
    runner = InMemoryRunner(agent=agent)
    for session, prompt in enumerate(["Remember that I deploy with Kamal to the server orca-7.", "How do I deploy?"]):
        events = await runner.run_debug(prompt, session_id=f"session-{session}", quiet=True)
        print(events[-1].content.parts[-1].text)
    await renor.close()


asyncio.run(main())
```

## Pydantic AI

```bash theme={null}
pip install "pydantic-ai-slim[mcp,openai]"
```

```python agent.py theme={null}
import os

from pydantic_ai import Agent
from pydantic_ai.mcp import MCPToolset

renor = MCPToolset(
    "https://mcp.renor.cloud/mcp",
    headers={"Authorization": f"Bearer {os.environ['RENOR_API_KEY']}"},
)
agent = Agent(
    "openai:gpt-5",
    toolsets=[renor],
    instructions="Renor is your long-term memory. Before answering, call get_context with the request: it holds what the user told you in earlier conversations. When the user asks you to remember something, call remember.",
)

for prompt in ["Remember that I deploy with Kamal to the server orca-7.", "How do I deploy?"]:
    result = agent.run_sync(prompt)
    print(result.output)
```

## Agno

```bash theme={null}
pip install "agno[mcp]" openai
```

```python agent.py theme={null}
import asyncio
import os

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.mcp import MCPTools


async def main():
    async with MCPTools(
        transport="streamable-http",
        url="https://mcp.renor.cloud/mcp",
        headers={"Authorization": f"Bearer {os.environ['RENOR_API_KEY']}"},
        include_tools=["get_context", "remember"],
    ) as renor:
        agent = Agent(
            model=OpenAIChat(id="gpt-5"),
            tools=[renor],
            instructions="Renor is your long-term memory. Before answering, call get_context with the request: it holds what the user told you in earlier conversations. When the user asks you to remember something, call remember.",
        )
        for prompt in ["Remember that I deploy with Kamal to the server orca-7.", "How do I deploy?"]:
            result = await agent.arun(prompt)
            print(result.content)


asyncio.run(main())
```

## Self-hosted Renor

The same code works against a self-hosted Renor HTTP server: replace the address with the server's `/mcp` address and the key with the OAuth access token the server issued to your client ([engine self-hosting guide](https://github.com/patrickpassosb/renor-engine/blob/main/docs/self-hosting.md#http-server)). The command-line server (`npx -y renor-engine mcp`) runs over stdio and serves different tool names: `search`, `remember_fact` and `note` instead of `get_context` and `remember`.

## What these examples were checked against

Each example on this page was run as printed, with two changes: the address of a self-hosted Renor HTTP server instead of the hosted one, and a scripted model instead of a real one. In the first conversation the scripted model calls `remember`; in the second it calls `get_context` and answers with what that returned. A framework passed only when the server logged both calls, its memory folder held the saved sentence, and that sentence came back through the framework in the second answer. The TypeScript examples also type-check under `strict`. The same examples were then run with a real open-weight model, to check that a model following the instruction recalls the saved fact in a new conversation.

Versions checked, on 2026-10-21: `ai` 7.0.148 with `@ai-sdk/mcp` 2.0.81, `@mastra/core` 1.79.0 with `@mastra/mcp` 2.5.0, `@anthropic-ai/claude-agent-sdk` 0.3.307, `langchain` 1.4.7 with `langchain-mcp-adapters` 0.3.2, `openai-agents` 0.24.0, `google-adk` 2.12.0, `pydantic-ai-slim` 2.59.0, `agno` 3.1.8. A later release of a framework may rename an option; its own MCP documentation is then the reference.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.