> ## 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.

**q** `string` *required*

Free-text query describing the topic (e.g., "ai agents", "us elections").

**limit** `integer` (default: 10)

Maximum number of clusters to return. Range: 1–50.

### clusters.info

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

**label** `string` *required*

Cluster label obtained from `clusters.search`.

**limit** `integer` (default: 10)

Maximum number of representative posts to include. Range: 1–50.

### posts.search

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

**q** `string` *required*

Free-text query describing the topic or keywords.

**limit** `integer` (default: 10)

Maximum number of posts to return. Range: 1–100.

> [!TIP]
>
> All tools respect privacy: results surface public conversations only and never
> expose personal identifiers beyond public metadata.

## 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](https://docs.membit.ai/access-and-auth.md).

### 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](https://docs.membit.ai/access-and-auth.md))
* 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

**1. Clone the Repository**

```bash theme={null}
git clone https://github.com/bandprotocol/membit-mcp.git
cd membit-mcp
```

**2. 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
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.