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

# MCP Server

> Use Membit's Model Context Protocol (MCP) server to give AI agents real-time social context.

Membit MCP Server connects your AI systems to live social insights via Membit's API. Using the Model Context Protocol (MCP), the server exposes tools that make up-to-the-minute social context—trending discussion clusters, raw posts, and more—available to your AI agents in Cursor, Claude Desktop, Goose, and any MCP-compatible client.

## Available tools

These tools are exposed by the Membit MCP server and can be called by MCP-compatible clients (e.g., Cursor, Claude Desktop).

### clusters.search

Search for trending discussion clusters across platforms.

<ParamField query="q" type="string" required>
  Free-text query describing the topic (e.g., "ai agents", "us elections").
</ParamField>

<ParamField query="limit" type="integer" default="10">
  Maximum number of clusters to return. Range: 1–50.
</ParamField>

### clusters.info

Get detailed context for a specific cluster label, including representative posts.

<ParamField query="label" type="string" required>
  Cluster label obtained from `clusters.search`.
</ParamField>

<ParamField query="limit" type="integer" default="10">
  Maximum number of representative posts to include. Range: 1–50.
</ParamField>

### posts.search

Search raw social posts that match your query across supported platforms.

<ParamField query="q" type="string" required>
  Free-text query describing the topic or keywords.
</ParamField>

<ParamField query="limit" type="integer" default="10">
  Maximum number of posts to return. Range: 1–100.
</ParamField>

<Tip>
  All tools respect privacy: results surface public conversations only and never
  expose personal identifiers beyond public metadata.
</Tip>

## Remote MCP Server

Connect Membit's remote MCP server directly without the need for local setup. This approach offers a streamlined experience that eliminates local installation and configuration requirements.

Use the remote MCP server endpoint with your Membit API key:

```text theme={null}
https://mcp.membit.ai/mcp
```

**Authentication**: The remote server requires your API key to be passed as an HTTP header `X-Membit-Api-Key: <your-api-key>`. The configurations below handle this automatically for each client.

Obtain your [Membit API key](/access-and-auth).

### Configuring Remote MCP Clients

See platform-specific setup guides in the **Integrations** section.

## Local MCP

Run the server locally if you prefer.

### Requirements

* Membit API key ([get one](/access-and-auth))
* Python 3.11+
* An MCP client (e.g., Claude Desktop, Goose, Cursor)
* Git (optional, if cloning)

### API Key Configuration

Provide your key in one of two ways:

**Environment variable (recommended):**

Create a `.env` file in the project root:

```bash theme={null}
MEMBIT_API_KEY=<your-api-key>
```

**HTTP header (useful for direct HTTP testing):**

```bash theme={null}
curl -H 'X-Membit-Api-Key: <your-api-key>' http://localhost:8000/mcp
```

### Installation Guide

#### Clone from Git

<Steps>
  <Step title="Clone the Repository">
    ```bash theme={null}
    git clone https://github.com/bandprotocol/membit-mcp.git
    cd membit-mcp
    ```
  </Step>

  <Step title="Choose Installation Method">
    **Option 1: Direct Installation**

    ```bash theme={null}
    uv sync
    uv run src/membit_mcp/server.py
    ```

    **Option 2: Docker Installation**

    Build the Docker image:

    ```bash theme={null}
    docker build -t membit-mcp .
    ```

    Run the container:

    ```bash theme={null}
    # Using environment variable
    docker run -p 8000:8000 -e MEMBIT_API_KEY=<your-api-key> membit-mcp

    # Using HTTP header
    docker run -p 8000:8000 membit-mcp
    # Then use: curl -H 'X-Membit-Api-Key: <your-api-key>' http://localhost:8000/mcp
    ```
  </Step>
</Steps>
