x-mcp

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.

52
11

X(Twitter) MCP server

smithery badge

An MCP server designed to enable users to create, manage, and publish X/Twitter posts directly through Claude chat.

<a href="https://glama.ai/mcp/servers/jsxr09dktf"> <img width="380" height="200" src="https://glama.ai/mcp/servers/jsxr09dktf/badge" alt="X(Twitter) Server MCP server" /> </a>

Quick Setup

Installing via Smithery

To install X(Twitter) MCP Server for Claude Desktop automatically via Smithery:

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

Manual Installation

  1. Clone the repository:
git clone https://github.com/yourusername/x-mcp.git
  1. Install UV globally using Homebrew in Terminal:
brew install uv
  1. Create claude_desktop_config.json:
    • MacOS: Open ~/Library/Application Support/Claude/ and create the file.
    • Windows: Open %APPDATA%/Claude/ and create the file.
  2. Add this 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"
      }
    }
  }
}
  1. Obtain X/Twitter API credentials:
    • Navigate to the X API Developer Portal.
    • Create a project with Read and Write permissions, Web App type.
    • Set Callback URL to http://localhost/ and Website URL to http://example.com/.
    • Generate and copy API keys and tokens.
  2. Configure the claude_desktop_config.json file:
    • Replace /path/to/x-mcp with the repository path.
    • Input your X/Twitter API credentials.
  3. Restart Claude.

Usage Examples

  • "Tweet 'Just learned how to tweet through AI - mind blown! 🤖⌘œ¨'"
  • "Create a thread about the history of pizza"
  • "Show me my draft tweets"
  • "Publish this draft!"
  • "Delete that draft"

Troubleshooting

If not working:

  • Ensure UV is installed globally (reinstall with brew install uv if needed).
  • Alternatively, use which uv to find UV's path and update the "command" in the config.
  • Verify the accuracy of X/Twitter credentials and the repository path in the configuration.

Repository

VI
vidhupv

vidhupv/x-mcp

Created

December 4, 2024

Updated

March 28, 2025

Language

Python

Category

Communication