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

# MCP

This is a **Model Context Protocol (MCP)** server that integrates the **AI Search API** into MCP-compatible apps.\
It brings **semantic search**, **context awareness**, and **source citations** directly into your workflows.

👉 Get started now:

* [Sign Up](https://app.aisearchapi.io/join)
* [Log In](https://app.aisearchapi.io/login)
* [Dashboard](https://app.aisearchapi.io/dashboard) (manage your API key)

***

# Features

* 🔍 **Intelligent Semantic Search** – Natural language queries with embeddings
* 💬 **Context Management** – Keep or clear conversation history
* 📝 **Flexible Responses** – Markdown or plain text output
* 📚 **Source Citations** – Reliable references included
* 📊 **Balance Monitoring** – Track credits in real time
* ⚡ **TypeScript Support** – Strong typing & IDE hints

***

# Installation

## From npm (recommended)

```bash theme={null}
npm install -g aisearchapi-mcp
```

## From source

```bash theme={null}
git clone https://github.com/aisearchapi/aisearchapi-mcp.git
cd aisearchapi-mcp
npm install
npm run build
```

***

# Configuration

## 1. Get API Key

Create an account and copy your key:

* [Join](https://app.aisearchapi.io/join) | [Login](https://app.aisearchapi.io/login) | [Dashboard](https://app.aisearchapi.io/dashboard)

## 2. Environment Variables

Set up `.env` file:

```env theme={null}
AISEARCHAPI_KEY=your-api-key-here
AISEARCHAPI_BASE_URL=https://api.aisearchapi.io
AISEARCHAPI_TIMEOUT=30000
AISEARCHAPI_VERBOSE=false
```

***

# Configure Claude for Desktop

First, install **Claude Code**:

```bash theme={null}
npm install -g @anthropic-ai/claude-code
```

Go through the authorization process to access Claude Code.\
Then set up your local MCP:

```bash theme={null}
claude mcp add aisearchapi "npx -y aisearchapi-mcp" --env API_KEY=<YOUR-API-KEY>
```

Check if it’s added correctly:

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

You should see:

```
Checking MCP server health...
aisearchapi: npx -y aisearchapi-mcp  - ✓ Connected
```

Now you’re ready to go!

***

# Command Line Usage

List available tools:

```bash theme={null}
node dist/index.js --list-tools
```

Check balance:

```bash theme={null}
node dist/index.js --check-balance
```

Run the server:

```bash theme={null}
node dist/index.js
```

***

# Error Codes

| Code | Meaning           | Fix                          |
| ---- | ----------------- | ---------------------------- |
| 401  | Unauthorized      | Invalid key → Get a new key  |
| 429  | Too Many Requests | Slow down or add retry logic |
| 433  | Quota Exceeded    | Buy credits / upgrade        |
| 500  | Server Error      | Try again later              |
| 503  | Service Down      | Temporary downtime           |

***

# Development

```bash theme={null}
git clone https://github.com/aisearchapi/aisearchapi-mcp.git
cd aisearchapi-mcp
npm install
npm run build
npm run dev
```

***

# Best Practices

* Clear context when switching topics
* Use markdown output for richer UI
* Monitor credits regularly
* Secure your API key with environment variables

***

# Resources

* [AI Search API Homepage](https://aisearchapi.io)
* [Join](https://app.aisearchapi.io/join) | [Login](https://app.aisearchapi.io/login) | [Dashboard](https://app.aisearchapi.io/dashboard)
* [npm Package](https://www.npmjs.com/package/aisearchapi-mcp)
* [Issues](https://github.com/aisearchapi/aisearchapi-mcp/issues)
* [Blog](https://aisearchapi.io/blog)

***

# Start Now

Install the package, configure Claude Desktop, and start searching with the AI Search API MCP Server:

```bash theme={null}
npm install -g aisearchapi-mcp
```

***
