Connect External Chats

Connect Claude Code, Claude Desktop, Cursor, and other coding assistants to read and write to your RA-H knowledge base.

What This Does

This lets your coding assistants (like Claude Code) read from and write to your personal RA-H knowledge database. Your assistant can:

  • Search your existing notes and research
  • Add new insights directly to your knowledge base
  • All data stays on your computer - nothing goes to the cloud

Prerequisites

  1. RA-H app must be running - Open RA-H and keep it running
  2. Enable External Agents - In RA-H, go to Settings → External Agents and toggle it ON
  3. Get your unique connection URL - Copy the URL that appears (will look like http://127.0.0.1:[PORT]/mcp where PORT is a number assigned to your app)

Claude Code Setup (Complete Beginner Guide)

Step 1: Get Claude Code Running

If you've never used Claude Code before, here's how to get started:

  1. Get Claude Access

    • Go to claude.ai and sign up for a Claude Pro account ($20/month)
    • You need a Pro account to use Claude Code
  2. Install Claude Code

    • Open Terminal (on Mac: press Cmd+Space, type "Terminal", press Enter)
    • Type this command and press Enter:
    npm install -g @anthropic-ai/claude-code
    
  3. Login to Claude Code

    • In Terminal, type: claude-code auth login
    • This will open your web browser to claude.ai
    • Login with your Claude Pro credentials
    • Close the browser when it says "Authentication successful"

Step 2: Create Your First Project

  1. Create a folder for your project

    mkdir my-ra-h-project
    cd my-ra-h-project
    
  2. Create the connection file

    • In Terminal, type: touch .mcp.json
    • Open the file in a text editor: open .mcp.json
    • Copy and paste this template into the file:
    {
      "mcpServers": {
        "ra-h": {
          "type": "http",
          "url": "REPLACE_WITH_YOUR_URL"
        }
      }
    }
    
    • Critical step: Replace REPLACE_WITH_YOUR_URL with the exact URL from RA-H Settings → External Agents
    • Your URL will look like http://127.0.0.1:44145/mcp (but the number might be different)
    • Save the file

Step 3: Start Claude Code

  1. Launch Claude Code in your project folder

    claude-code
    
    • This opens Claude Code connected to your project and RA-H
  2. Test the connection

    • Ask Claude: "Can you search my RA-H knowledge base for anything about 'test'?"
    • If it works, Claude will search your RA-H database
    • If it doesn't work, see troubleshooting below

Step 4: Start Using It

To search your knowledge base:

  • "Search RA-H for notes about [topic]"
  • "What do I already know about [subject]?"

To add new knowledge:

  • "Add this insight to RA-H: [your insight] with tags [tag1, tag2]"
  • "Save this research to my knowledge base: [content]"

Example conversation:

You: "Search RA-H for anything about machine learning"
Claude: [searches and shows results]
You: "Add this to RA-H: Machine learning projects need good data validation with tags machine-learning, best-practices"
Claude: [creates new node in your RA-H database]

Troubleshooting Claude Code

"Connection refused" or "tools not found"

  1. Make sure RA-H is running
  2. Check that External Agents is ON in RA-H Settings
  3. Double-check the URL - The number in your URL (port) must match exactly what's shown in RA-H Settings
  4. Restart Claude Code: press Ctrl+C to quit, then run claude-code again

"Authentication failed"

  • Run claude-code auth login again
  • Make sure you have Claude Pro (not the free version)

"File not found" errors

  • Make sure you're in the correct folder with your .mcp.json file
  • Check the file was saved properly with the right content

Other Coding Assistants

Claude Desktop

Uses the same setup as Claude Code:

  1. Create a .mcp.json file in your project folder (same format as above)
  2. Restart Claude Desktop
  3. Check Settings → Model Context Protocol to confirm connection

Cursor

  1. Create a .mcp.json file in your project (same format as Claude Code)
  2. Restart Cursor
  3. Test by asking Cursor to search your RA-H database

ChatGPT

Currently not supported - ChatGPT requires HTTPS connections and additional setup. We're working on a solution.


Best Practices

Always search first before adding new knowledge:

  • Ask: "Search RA-H for anything about [topic]"
  • This prevents creating duplicate notes

Use clear, descriptive titles when adding nodes:

  • Good: "Claude Code setup process with common errors"
  • Bad: "Setup stuff"

Include relevant tags (dimensions) to organize your knowledge:

  • Examples: "programming", "tutorials", "troubleshooting", "claude-code"

Example workflow:

  1. "Search RA-H for notes about Python debugging"
  2. Review what you already know
  3. "Add this to RA-H: New Python debugging technique using breakpoint() function with tags python, debugging, techniques"

Video Walkthrough

Advanced Troubleshooting

Connection suddenly stopped working

  • RA-H was probably closed. Restart RA-H and make sure External Agents is ON

"Authentication failed" in Claude Code

  • Your Claude Pro subscription may have expired
  • Try: claude-code auth login to re-authenticate

Want to test the connection manually? For advanced users, you can test RA-H directly in Terminal:

curl -s http://127.0.0.1:44145/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json,text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

You should see a JSON response with rah.search_nodes and rah.add_node. If not, RA-H isn't running properly.

Created a node but don't see it in RA-H

  • The database updates immediately, but the UI might need a refresh
  • Try switching between different views in RA-H