Claude Desktop Integration

Connect Claude to your AI's memory πŸ”—

Step 1: Find Config File

macOS:

~/Library/Application Support/Claude/claude_desktop_config.json

Windows:

%APPDATA%\Claude\claude_desktop_config.json

Linux:

~/.config/Claude/claude_desktop_config.json

Step 2: Edit Configuration

Open the file and add:

{
  "mcpServers": {
    "memofai": {
      "command": "node",
      "args": ["/absolute/path/to/memofai-mcp-server/dist/index.js"],
      "env": {
        "MEMOFAI_API_TOKEN": "moa_your_token_here",
        "MEMOFAI_ENVIRONMENT": "production"
      }
    }
  }
}

Important: Replace /absolute/path/to/ with your actual path!

Find Your Path

# Navigate to mcp-server directory
cd memofai-mcp-server

# Get absolute path
pwd

# Example output: /Users/yourname/memofai-mcp-server

Step 3: Restart Claude

  1. Quit Claude Desktop completely
  2. Reopen Claude Desktop
  3. Look for the πŸ”Œ icon in the bottom-right

Step 4: Test It!

Try these commands in Claude:

"Create a workspace called 'Test Workspace'" "Create a bot named 'Memory Bot' in that workspace" "Remember that I love building AI applications" "What do you know about my interests?"

Claude will use Memof.ai to store and retrieve memories!

Complete Configuration Example

{
  "mcpServers": {
    "memofai": {
      "command": "node",
      "args": ["/Users/yourname/memofai-mcp-server/dist/index.js"],
      "env": {
        "MEMOFAI_API_TOKEN": "moa_abc123xyz...",
        "MEMOFAI_ENVIRONMENT": "production"
      }
    },
    "other-mcp-server": {
      "command": "...",
      "args": ["..."]
    }
  }
}

Note: You can have multiple MCP servers!

Troubleshooting

"No MCP servers found"

Check:

  1. Path to dist/index.js is correct
  2. File exists: ls /path/to/memofai-mcp-server/dist/index.js
  3. Node is in your PATH: which node

Fix:

# Use full path to node
"command": "/usr/local/bin/node"  # or wherever node is

"Invalid API token"

Check:

  1. Token starts with moa_
  2. Token is in quotes
  3. No extra spaces

Fix:

"MEMOFAI_API_TOKEN": "moa_your_token"  // βœ… Correct
"MEMOFAI_API_TOKEN": moa_your_token    // ❌ Missing quotes

"Connection refused"

Check:

  1. Environment is set to production
  2. Internet connection is working

Fix:

"MEMOFAI_ENVIRONMENT": "production"  // Not "prod" or "live"

Claude not showing πŸ”Œ icon

Steps:

  1. Quit Claude completely (Cmd+Q on macOS)
  2. Check config file syntax is valid JSON
  3. Restart Claude
  4. Check Claude logs (Help β†’ View Logs)

Using with Claude API

import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env.ANTHROPIC_API_KEY,
});

const response = await client.messages.create({
  model: "claude-3-5-sonnet-20241022",
  max_tokens: 1024,
  tools: [
    // MCP tools would be here
    {
      name: "memofai_store_memory",
      description: "Store a memory in Memof.ai",
      input_schema: {
        type: "object",
        properties: {
          bot_id: { type: "string" },
          content: { type: "string" }
        }
      }
    }
  ],
  messages: [
    { role: "user", content: "Remember that I love Python" }
  ]
});

Example Conversation

You: Create a workspace for my project notes

Claude: πŸ”§ Uses memofai_create_workspace

"I've created a workspace called 'Project Notes' with ID ws_abc123"

You: Add a bot for coding tasks

Claude: πŸ”§ Uses memofai_create_bot

"Created 'Coding Tasks Bot' in your Project Notes workspace"

You: Remember that I prefer FastAPI over Flask

Claude: πŸ”§ Uses memofai_store_memory

"I'll remember that you prefer FastAPI over Flask"

You: What framework do I prefer?

Claude: πŸ” Uses memofai_search_memories

"Based on what you've told me, you prefer FastAPI over Flask"

Multiple Workspaces

You can have Claude manage multiple workspaces:

"Create a workspace for personal notes" "Create a workspace for work projects" "List all my workspaces"

Claude will keep track of them all!

Next Steps


Need help? β†’ Troubleshooting