# x-mcp

> MCP Server

This repository provides an MCP server that enables users to create, manage, and publish posts directly to X/Twitter through Claude chat. It offers both automated and manual installation options for seamless integration.

## Overview

- **Category:** Communication
- **Language:** Python
- **Stars:** 61
- **Forks:** 11
- **Owner:** vidhupv
- **GitHub:** https://github.com/vidhupv/x-mcp
- **Created:** 2024-12-04T21:38:39+00:00
- **Updated:** 2025-03-28T17:27:59+00:00
- **Source:** https://model-context-protocol.com/servers/x-twitter-post-server-claude-integration

## Setup

## Setup

### Installing via Smithery

To install X(Twitter) MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/x-mcp):

```bash
npx -y @smithery/cli install x-mcp --client claude
```

### Manual Installation
1. Clone the repository:
```bash
git clone https://github.com/yourusername/x-mcp.git
```

2. Install UV globally using Homebrew in Terminal:
```bash
brew install uv
```

3. Create claude_desktop_config.json:
   - For MacOS: Open directory `~/Library/Application Support/Claude/` and create the file inside it
   - For Windows: Open directory `%APPDATA%/Claude/` and create the file inside it

4. Add this configuration to claude_desktop_config.json:
```json
{
  "mcpServers": {
    "x_mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/x-mcp",
        "run",
        "x-mcp"
      ],
      "env": {
        "TWITTER_API_KEY": "your_api_key",
        "TWITTER_API_SECRET": "your_api_secret",
        "TWITTER_ACCESS_TOKEN": "your_access_token",
        "TWITTER_ACCESS_TOKEN_SECRET": "your_access_token_secret"
      }
    }
  }
}
```

5. Get your X/Twitter API credentials:
   - Go to [X API Developer Portal](https://developer.x.com/en/products/x-api)
   - Create a project
   - In User Authentication Settings: Set up with Read and Write permissions, Web App type
   - Set Callback URL to `http://localhost/` and Website URL to `http://example.com/`
   - Generate and copy all keys and tokens from Keys and Tokens section

6. Update the config file:
   - Replace `/path/to/x-mcp` with your actual repository path
   - Add your X/Twitter API credentials

7. Quit Claude completely and reopen it

## Tools

## Available Tools

1.  Create X/Twitter posts directly through Claude chat (Allows users to compose tweets using Claude).
2.  Manage X/Twitter posts directly through Claude chat (Enables users to organize and handle their tweets).
3.  Publish X/Twitter posts directly through Claude chat (Facilitates the direct posting of tweets via Claude).
4.  Create a thread about a topic (Allows users to create tweet threads).
5.  Show draft tweets (Allows users to view their saved drafts).
6.  Publish a draft (Allows users to publish a saved draft).
7.  Delete a draft (Allows users to delete a saved draft).
