# X MCP Ai

> X MCP Ai is an open-source MCP server. Safety-first X (Twitter) API v2 MCP server: 41 typed tools across 12 packages, policy-gated. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Repository:** https://github.com/ivanbbaev/x-mcp
- **MCP Registry name:** io.github.IvanBBaev/x-mcp-ai
- **Listing updated:** 2026-11-13

## About

Safety-first X (Twitter) API v2 MCP server: 41 typed tools across 12 packages, policy-gated.

## Install

### Claude Code (Terminal)

```sh
claude mcp add x-mcp-ai --env X_MCP_CLIENT_SECRET='<X_MCP_CLIENT_SECRET>' --env X_MCP_BEARER_TOKEN='<X_MCP_BEARER_TOKEN>' -- npx -y x-mcp-ai
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "x-mcp-ai": {
      "command": "npx",
      "args": [
        "-y",
        "x-mcp-ai"
      ],
      "env": {
        "X_MCP_CLIENT_SECRET": "<X_MCP_CLIENT_SECRET>",
        "X_MCP_BEARER_TOKEN": "<X_MCP_BEARER_TOKEN>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "x-mcp-ai": {
      "command": "npx",
      "args": [
        "-y",
        "x-mcp-ai"
      ],
      "env": {
        "X_MCP_CLIENT_SECRET": "<X_MCP_CLIENT_SECRET>",
        "X_MCP_BEARER_TOKEN": "<X_MCP_BEARER_TOKEN>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "x-mcp-ai": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "x-mcp-ai"
      ],
      "env": {
        "X_MCP_CLIENT_SECRET": "<X_MCP_CLIENT_SECRET>",
        "X_MCP_BEARER_TOKEN": "<X_MCP_BEARER_TOKEN>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "x-mcp-ai": {
      "command": "npx",
      "args": [
        "-y",
        "x-mcp-ai"
      ],
      "env": {
        "X_MCP_CLIENT_SECRET": "<X_MCP_CLIENT_SECRET>",
        "X_MCP_BEARER_TOKEN": "<X_MCP_BEARER_TOKEN>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "x-mcp-ai": {
      "command": "npx",
      "args": [
        "-y",
        "x-mcp-ai"
      ],
      "env": {
        "X_MCP_CLIENT_SECRET": "<X_MCP_CLIENT_SECRET>",
        "X_MCP_BEARER_TOKEN": "<X_MCP_BEARER_TOKEN>"
      }
    }
  }
}
```

## FAQ

### Is X MCP Ai free?

Yes. X MCP Ai is open source, so you can use and self-host it for free.

### How do I add X MCP Ai to Claude Code?

Run this command in your terminal: claude mcp add x-mcp-ai --env X_MCP_CLIENT_SECRET='<X_MCP_CLIENT_SECRET>' --env X_MCP_BEARER_TOKEN='<X_MCP_BEARER_TOKEN>' -- npx -y x-mcp-ai

## Where this comes from

- Description: from the official MCP Registry entry.
- Install steps: from the official MCP Registry entry.

---
Source: https://ai-powered.com/mcp/x-mcp-ai
