> ## Documentation Index
> Fetch the complete documentation index at: https://orchata.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code Setup

> Configure Claude Code to use the Orchata MCP server

Connect Claude Code to your Orchata knowledge base using MCP. Once configured, Claude Code can search your documents, upload content, and manage your knowledge base directly from your terminal.

## Prerequisites

* [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed
* An Orchata account

## Quick Setup

Add the Orchata MCP server to Claude Code with a single command:

```bash theme={null}
claude mcp add --transport http orchata https://api.orchata.ai/mcp --header "Oai-Api-Key: YOUR_API_KEY_HERE"
```

That's it! Claude Code will authenticate using the API key you provided.

## Verifying the Connection

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

```bash theme={null}
claude mcp list
```

You should see `orchata` in the list of configured MCP servers and it should say "Connected" next to it.

## Using Orchata with Claude Code

### Example Commands

**Searching your knowledge base:**

```bash theme={null}
claude "Search my Orchata knowledge base for information about API authentication"
```

**Uploading documents:**

```bash theme={null}
claude "Upload this README to the 'SDK Documentation' space in Orchata" < README.md
```

**Managing spaces:**

```bash theme={null}
claude "List all my Orchata spaces"
claude "Create a new Orchata space called 'Customer Support' for our support documentation"
```

### Interactive Mode

In interactive mode, you can have conversations with Claude Code that leverage your Orchata knowledge base:

```bash theme={null}
claude
```

Then ask:

> "What do we have documented about authentication in Orchata?"

Claude Code will use the `smart_query` or `query_spaces` tools to find relevant content.

## Available Tools

Claude Code has access to all 12 Orchata MCP tools:

**Space Management:**

* `list_spaces`, `create_space`, `get_space`, `update_space`, `delete_space`

**Document Management:**

* `list_documents`, `upload_document`, `get_document`, `update_document`, `delete_document`

**Querying:**

* `query_spaces`, `smart_query`

<Tip>
  See the full [MCP Tools Reference](/mcp/tools) for detailed documentation.
</Tip>

## Advanced Configuration

### View MCP Server Details

```bash theme={null}
claude mcp get orchata
```

### Remove the Server

```bash theme={null}
claude mcp remove orchata
```

### Local Development

For local development with the Orchata MCP server:

```bash theme={null}
claude mcp add orchata-local http://localhost:4748/api/mcp
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="Server not appearing in mcp list">
    1. Verify you ran `claude mcp add` successfully
    2. Check for typos in the server URL
    3. Run `claude mcp list` to see all configured servers
  </Accordion>

  <Accordion title="Authentication errors">
    1. Ensure you have an active Orchata account
    2. Try removing and re-adding the server: `claude mcp remove orchata && claude mcp add orchata https://api.orchata.ai/mcp`
    3. Clear any cached credentials and re-authenticate
  </Accordion>

  <Accordion title="Tools not working">
    1. Verify the server URL is correct
    2. Check your network connection
    3. Ensure the Orchata API is accessible from your machine
    4. Try running a simple command like `claude "List my Orchata spaces"`
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="MCP Tools" icon="wrench" href="/mcp/tools">
    Learn what each tool does.
  </Card>

  <Card title="Resources & Prompts" icon="book-open" href="/mcp/resources">
    Explore MCP resources and prompts.
  </Card>
</CardGroup>
