Ditto exposes a Model Context Protocol (MCP) server for tools that can use outside context. Connect it once, and Claude, Codex, Cursor, Antigravity, or another MCP client can search your Ditto memories and subjects from the place where you are already working.
Using OpenClaw or Hermes Agent? Those integrations use the Ditto CLI, not MCP. Start with Agent Integrations, OpenClaw, or Hermes Agent.
Endpoint
https://api.heyditto.ai/mcp
This is a Streamable HTTP endpoint that implements the full MCP specification. Clients no longer need to specify "transport": "sse" in their configuration.
Legacy fallback: The previous SSE endpoints (
/mcp/sseand/mcp/message) still work for older clients that haven’t migrated yet.
Pick Your Tool
Start with the tool you use most. The setup values stay the same; the auth flow and config shape change by client.
Recommended for Codex desktop users
Codex App
Use the app form in Settings → Integrations & MCP. This mirrors the setup pattern in Ditto's MCP key screen: copy the exact fields you need, then keep the full config nearby for advanced users.
DittoStreamable HTTPhttps://api.heyditto.ai/mcpAuthorizationBearer YOUR_API_KEY- Open Codex settings with
Cmd+,. - Choose Integrations & MCP, then add a custom MCP server named Ditto.
- Select Streamable HTTP, paste the URL, and add the Authorization header.
Advanced: config.toml
[mcp_servers.ditto]
url = "https://api.heyditto.ai/mcp"
bearer_token_env_var = "DITTO_MCP_API_KEY"
Shared by Codex CLI and IDE extension
Codex CLI
Codex stores MCP servers in config.toml. The CLI and IDE extension share that config, so you only need to register Ditto once.
export DITTO_MCP_API_KEY="YOUR_API_KEY"
codex mcp add --url https://api.heyditto.ai/mcp \
--bearer-token-env-var DITTO_MCP_API_KEY ditto
codex mcp list
- Create a Ditto MCP API key.
- Export it as
DITTO_MCP_API_KEY. - Run the command, then confirm
dittoappears incodex mcp list.
OAuth, no API key
Claude.ai
Claude.ai supports remote custom connectors. Use OAuth here when possible; it avoids storing a Ditto API key in a local config file.
Dittohttps://api.heyditto.ai/mcpOAuth- Open Claude.ai Settings → Connectors.
- Choose Add custom connector.
- Paste the Ditto MCP URL and complete the Ditto sign-in flow.
Terminal setup, OAuth sign-in
Claude Code
Add Ditto as an HTTP MCP server, then use Claude Code's /mcp flow to authenticate remote servers that support OAuth.
claude mcp add --transport http ditto https://api.heyditto.ai/mcp
- Run the command in the project where you use Claude Code.
- Open Claude Code and run
/mcp. - Choose Ditto and complete the browser OAuth flow.
Advanced: API key command
claude mcp add --transport http ditto https://api.heyditto.ai/mcp \
--header "Authorization: Bearer YOUR_API_KEY"
Remote connector first
Claude Desktop
Use Claude Desktop's connector flow when available. Keep the JSON config for older local setups or environments where the connector UI is not available yet.
Dittohttps://api.heyditto.ai/mcpOAuth- Open Claude Desktop Settings → Connectors.
- Add a custom connector named Ditto.
- Paste the Ditto MCP URL and sign in with OAuth.
Advanced: local JSON config
Config file locations: ~/Library/Application Support/Claude/claude_desktop_config.json on macOS and %APPDATA%\Claude\claude_desktop_config.json on Windows.
{
"mcpServers": {
"ditto": {
"url": "https://api.heyditto.ai/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
Remote MCP server
Cursor
Cursor supports Streamable HTTP MCP servers. Use the remote URL by itself when Cursor can complete OAuth; use headers when your build or workspace needs a token-backed config.
{
"mcpServers": {
"ditto": {
"url": "https://api.heyditto.ai/mcp"
}
}
}
- Open Cursor Settings → MCP, or edit
~/.cursor/mcp.json. - Add a remote MCP server named ditto.
- Authenticate when Cursor prompts, then restart Cursor if the server does not appear.
Advanced: API key JSON
{
"mcpServers": {
"ditto": {
"url": "https://api.heyditto.ai/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
Uses serverUrl
Antigravity
Antigravity's MCP config uses serverUrl for remote servers. The Ditto endpoint and Authorization header stay the same.
{
"mcpServers": {
"ditto": {
"serverUrl": "https://api.heyditto.ai/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
- Open
~/.gemini/antigravity/mcp_config.json. - Paste the JSON block above.
- Restart Antigravity.
Authentication
Two methods are available:
OAuth
Use OAuth when your client supports remote MCP authentication. It is the cleanest option for Claude.ai, Claude Desktop, Claude Code, and some Cursor setups.
OAuth avoids storing a Ditto API key in a local config file. The client opens a browser sign-in flow, then stores and refreshes its token.
API Key
Use an API key when your client does not support OAuth yet, when you are using a local JSON/TOML config, or when you need a deterministic setup for a specific machine.
- Open heyditto.ai → Settings → MCP API Keys
- Click “Create Key” and give it a name
- Copy the key immediately, it won’t be shown again
Use the key in an Authorization: Bearer <key> header.
Available Tools
Ditto’s MCP server exposes six tools:
search_memories
Search your memories using semantic similarity with composite retrieval (similarity, recency, and frequency signals).
| Parameter | Type | Required | Description |
|---|---|---|---|
queries | string[] | Yes | Search queries (e.g., ["React migration", "performance"]) |
stripImages | boolean | No | Strip image data from results (default: true) |
alreadyFoundPairIDs | string[] | No | Exclude these memory IDs from results (deduplication) |
fetch_memories
Fetch the full content of specific memories by their IDs. Use this after search_memories to get complete conversation text.
| Parameter | Type | Required | Description |
|---|---|---|---|
pairIds | string[] | Yes | Memory pair IDs to fetch |
stripImages | boolean | No | Strip image data (default: true) |
search_subjects
Search your knowledge graph subjects by semantic similarity.
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | What to search for |
topK | integer | No | Max results (default: 10, max: 100) |
minSimilarity | float | No | Minimum similarity threshold (default: 0.1) |
search_memories_in_subjects
Get memory summaries linked to specific subjects in your knowledge graph.
| Parameter | Type | Required | Description |
|---|---|---|---|
subjectIds | string[] | Yes | Subject UUIDs to search within |
stripImages | boolean | No | Strip image data (default: true) |
get_memory_network
Get a memory and its network of related memories via shared subjects.
| Parameter | Type | Required | Description |
|---|---|---|---|
pairId | string | Yes | Memory pair ID to start from |
limit | integer | No | Max related memories (default: 20, max: 50) |
save_memory
Save an external memory to your knowledge graph. Useful for importing notes, documents, or context from other tools.
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | The memory content to save |
source | string | No | Source identifier (default: “mcp”) |
sourceContext | string | No | Additional context about the source |
Resources
Three read-only resources provide context about your account:
| URI | Description |
|---|---|
memory://profile | Your name, personality summary, and timezone |
memory://stats | Total memories, total subjects, and top subjects by frequency |
memory://capabilities | Available tools and limits |
API Key Best Practices
- Create separate keys per tool: easier to revoke if one is compromised
- Never commit keys to git: use environment variables or secrets managers
- Check “Last Used” timestamps: revoke unused keys in Settings → MCP API Keys
- Use OAuth when available: no credentials in config files, automatic token rotation
Troubleshooting
”Not Authenticated” Error
- Verify the key is correct with no extra spaces
- Check the header format:
Authorization: Bearer YOUR_API_KEY - Confirm the key hasn’t been revoked in Settings → MCP API Keys
- Restart the AI tool after adding configuration
Empty Search Results
- Make sure you have conversations in Ditto (the memories come from your chats)
- Try broader search terms
- Lower the
minSimilaritythreshold for wider results - Check that the AI tool is actually invoking the MCP tools
OAuth Flow Fails
- Log into Ditto first in your browser
- Check that pop-ups aren’t blocked
- Try in an incognito window
- Clear browser cache and retry