Claude Code Integration

Claude Code is Anthropic's official CLI for Claude with native MCP support. This guide covers multiple ways to connect RLM to Claude Code.

Recommended: Claude Code has the best MCP integration and is the preferred way to use RLM.

Quick Setup (One Command)

The fastest way to connect RLM to Claude Code is using the claude mcp add command:

claude mcp add my-project \
  --transport http \
  --url "https://your-app.com/api/mcp/PROJECT_ID" \
  --header "X-API-Key: YOUR_API_KEY"

Replace the placeholders:

  • my-project - A name for this MCP server (use your project slug)
  • PROJECT_ID - Your project ID from the RLM dashboard
  • YOUR_API_KEY - Your API key from the API Keys tab
Tip: Go to your project's Integrations tab to get a pre-filled command with your actual project ID and endpoint.

Manual Configuration

For more control, you can manually edit the Claude Code settings file at ~/.claude/settings.json:

{
  "mcpServers": {
    "my-project": {
      "transport": "http",
      "url": "https://your-app.com/api/mcp/PROJECT_ID",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Verify Installation

After adding the server, verify it's configured correctly:

claude mcp list
my-project (http) - https://your-app.com/api/mcp/PROJECT_ID

Test the connection:

claude mcp test my-project
✓ Connection successful (45ms)
✓ 8 tools available

Using RLM Tools

Once connected, Claude Code will automatically use RLM tools when appropriate. You can also explicitly request them:

claude
Use rlm_ask to find how authentication works in this project
[Calling rlm_ask with question="How does authentication work?"]
Based on the documentation, authentication uses JWT tokens...

Available Tools

ToolDescriptionExample Prompt
rlm_askQuery documentation with a question"How does the billing system work?"
rlm_searchSearch for patterns (regex supported)"Search for usages of requireAuth"
rlm_injectInject session context"Set context: Working on auth refactor"
rlm_contextShow current session context"What's the current context?"
rlm_clear_contextClear session context"Clear the RLM context"
rlm_statsShow documentation statistics"Show doc stats"
rlm_sectionsList all sections"List all doc sections"
rlm_readRead specific line ranges"Read lines 50-100 from the docs"

Multiple Projects

You can connect multiple RLM projects to Claude Code:

claude mcp add frontend-docs --transport http --url ".../mcp/proj1" --header "..."
claude mcp add backend-docs --transport http --url ".../mcp/proj2" --header "..."
claude mcp add api-specs --transport http --url ".../mcp/proj3" --header "..."

Claude Code will intelligently route questions to the appropriate project based on context.

Using Environment Variables

For security, store your API key in an environment variable:

~/.zshrc or ~/.bashrc
export RLM_API_KEY="rlm_your_api_key_here"

Then reference it in your configuration:

claude mcp add my-project \
  --transport http \
  --url "https://your-app.com/api/mcp/PROJECT_ID" \
  --header "X-API-Key: $RLM_API_KEY"

Troubleshooting

"Server not found" error
  • Run claude mcp list to verify the server is added
  • Check the URL is correct and accessible
  • Try claude mcp remove my-project and add it again
Authentication errors (401)
  • Verify your API key is correct (no extra spaces)
  • Check the header format: X-API-Key: rlm_...
  • Ensure the API key hasn't expired
  • Try generating a new API key in the dashboard
Tools not being used by Claude
  • Use explicit prompts: "Use rlm_ask to..."
  • Check that documents are indexed in your project
  • Verify tools with claude mcp test my-project
Slow responses
  • Check your network connection
  • Large documentation sets may take longer to search
  • Use more specific queries for faster results

Next Steps