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.
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 dashboardYOUR_API_KEY- Your API key from the API Keys tab
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 listmy-project (http) - https://your-app.com/api/mcp/PROJECT_IDTest the connection:
claude mcp test my-project✓ Connection successful (45ms)✓ 8 tools availableUsing RLM Tools
Once connected, Claude Code will automatically use RLM tools when appropriate. You can also explicitly request them:
claudeUse 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
| Tool | Description | Example Prompt |
|---|---|---|
rlm_ask | Query documentation with a question | "How does the billing system work?" |
rlm_search | Search for patterns (regex supported) | "Search for usages of requireAuth" |
rlm_inject | Inject session context | "Set context: Working on auth refactor" |
rlm_context | Show current session context | "What's the current context?" |
rlm_clear_context | Clear session context | "Clear the RLM context" |
rlm_stats | Show documentation statistics | "Show doc stats" |
rlm_sections | List all sections | "List all doc sections" |
rlm_read | Read 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 ~/.bashrcexport 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
- Run
claude mcp listto verify the server is added - Check the URL is correct and accessible
- Try
claude mcp remove my-projectand add it again
- 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
- Use explicit prompts: "Use rlm_ask to..."
- Check that documents are indexed in your project
- Verify tools with
claude mcp test my-project
- Check your network connection
- Large documentation sets may take longer to search
- Use more specific queries for faster results