home / mcp / x(twitter) mcp server

X(Twitter) MCP Server

Provides an MCP endpoint to create, manage, and publish X/Twitter posts via Claude chat.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "vidhupv-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"
      }
    }
  }
}

You can run the X(Twitter) MCP Server to create, manage, and publish X/Twitter posts directly from Claude chat. It exposes a simple local MCP endpoint that your Claude client can talk to, enabling seamless social media actions from conversation flows.

How to use

Use this MCP server by starting it locally and connecting it to your Claude client. Once running, you can draft posts, create threads, view drafts, publish, or delete drafts all from your chat prompts. The server runs as a local process and communicates with Claude via the MCP protocol, allowing you to perform social posting actions without leaving the chat interface.

How to install

Prerequisites you need before installing: a working Node.js/npm setup for CLI tools, and a system where you can install system packages (macOS or Linux). You also need UV installed globally to run the local MCP server process.

Step 1. Install via Smithery (preferred automated setup)

Run the following command to install the X(Twitter) MCP Server for Claude Desktop automatically via Smithery:

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

Manual installation

If you install manually, follow these steps to set up the MCP server and Claude desktop integration.

Step 1. Clone the repository

git clone https://github.com/yourusername/x-mcp.git

Step 2. Create a global UV installation (if not already present)

brew install uv

Step 3. CreateClaude desktop config file

MacOS: create claude_desktop_config.json inside ~/Library/Application Support/Claude/

Windows: create claude_desktop_config.json inside %APPDATA%/Claude/

Step 4. Add the MCP server configuration to claude_desktop_config.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"
      }
    }
  }
}

Step 5. Obtain X/Twitter API credentials

Go to the X API Developer Portal, create a project, set up User Authentication with Read and Write permissions (Web App type), and set the Callback URL to http://localhost/ with Website URL to http://example.com/. Generate and copy all keys and tokens from the Keys and Tokens section.

Step 6. Update the config file with your repository path and API credentials

Step 7. Quit Claude completely and reopen it to apply the new MCP configuration.

Troubleshooting

If things aren’t working as expected, try these checks:

  • Verify UV is installed globally and available in your shell with which uv.

If you still have issues, verify that your MCP command path and repository location match the values in claude_desktop_config.json.