---
updatedAt: 2026-09-28T14:49:41.000Z
agentTools:
  projectIndex: https://developer.searchblox.com/llms.txt
---

# Claude Code (CLI)

# **Prerequisites:**

* **Node.js:** v18 or later.Refer from <https://nodejs.org/en/download>
* **Claude Code CLI:** <https://docs.claude.com/en/docs/claude-code/overview>
* **SearchBlox SearchAI version:** v12.1
* **Server URL:** SearchBlox instance URL (e.g., https\://your-server)
* **SB-PKEY:** your SearchBlox Private Key. You can find it in the SearchBlox Admin Console under Administration →\
  Users → (your admin user) → copy Private Key.

Note: Claude Code CLI requires an active Claude subscription (Claude Pro, Max, Team, or Enterprise) or an Anthropic API key with available credits. Without one of these, you will not be able to use Claude Code.

# **Getting Started - Opening Claude Code in Your Project**

Claude Code runs from your terminal inside a project folder. Open a terminal at your project location using the steps below.

1. Open a terminal (Command Prompt / PowerShell on Windows, Terminal on macOS or   Linux).
2. Navigate to your project folder:

* Windows: cd C:\path\to\your\project
* macOS: cd \~/path/to/your/project
* Linux: cd \~/path/to/your/project

3. Launch Claude Code:
   ```javascript JavaScript
   claude
   ```

Tip: Once Claude Code is running, type /help to see available commands or /mcp to view connected MCP servers.

# **Connection Configuration:**

Replace your-server with SearchBlox server address and your-SB-PKEY with SearchBlox API key.

**Option 1 - Configuration file**

Add the following to .mcp.json in your project root (or \~/.claude.json for a global config):

```java Java
{
  "mcpServers": {
    "my-server": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://your-server/rest/v2/api/mcp",
        "--header",
        "SB-PKEY: your-SB-PKEY"
      ]
    }
  }
}
```

**Option 2 - CLI command**

```java Java
claude mcp add searchblox --transport http 
https://your-server/rest/v2/api/mcp --header "SB-PKEY: your-SB-PKEY"
```

# **Verify the connection**

Inside Claude Code, run:

```java Java
/mcp
```

You should see **searchblox** listed as connected.

# **Fetch the available MCP tools**

Once connected, ask Claude to list every tool the SearchBlox MCP server exposes. This confirms the integration is working and shows what capabilities you have access to:

```javascript JavaScript
Use curl to list all tools from searchblox MCP server.
```

Claude will return the full catalog (search, collections, chatbots, analytics, agents, knowledge graph, commerce, and more) - typically 80+ tools depending on your SearchBlox version.

# **Quick Start Examples**

1. **Create a collection and chatbot**

You can create a collection and chatbot from scratch using the prompt below:

```javascript JavaScript
create a web collection named <--COLLECTION_NAME--> with root URL and allow paths 
as https:<--URLs-->,then create a chatbot named <--CHATBOT_NAME--> for the same 
collection.
```

2. **View Collection Settings**

You can view a collection's settings using the prompt below:

```javascript JavaScript
can you show me the settings for <--COLLECTION_NAME-->
```

3. **Invoke Agent**

You can invoke any agent and see the response using the prompt below:

```javascript JavaScript
Can you invoke "search-relevance-workflow" agent with query - Give me a relevance 
health check for <--QUERY TERM--> on <--COLLECTION_NAME-->: top 10 hybrid, scores, 
issues, tuning recommendations.
```

# **Troubleshooting**

If you experience issues after configuring the connection, refer to the common problems and solutions below:

**Connection not detected:** Verify the URL ends with /rest/v2/api/mcp and the API key is correct.\
**Connection refused:** Check that the SearchBlox server is running and accessible from your machine.\
**Authentication errors:** Confirm your SB-PKEY is valid and has not expired.\
**Timeout errors:** Ensure network/firewall rules allow HTTPS traffic to the SearchBlox port.

# **Useful CLI Commands**

```javascript JavaScript
claude mcp list                    # List configured MCP servers
claude mcp get searchblox          # Show searchblox server details
claude mcp remove searchblox       # Remove the server.
```

# **Claude CLI quick start demo:**

The demo below shows a complete end-to-end workflow for setting up and configuring your search indices using Claude Code CLI.

[block:html]
{
  "html": "<div style=\"width: 100%; position: relative; padding-bottom: 56.25%; height: 0; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.15); border: 1px solid #eee;\">\n  <video \n    style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%;\" \n    controls \n    preload=\"metadata\" \n    poster=\"https://res.cloudinary.com/debe7pdah/video/upload/claude-cli-quick-start-demo_sidlpw.jpg\">\n    <source src=\"https://res.cloudinary.com/debe7pdah/video/upload/claude-cli-quick-start-demo_sidlpw.mp4\" type=\"video/mp4\">\n    Your browser does not support the video tag.\n  </video>\n</div>"
}
[/block]