Agent Twitter Client

v0.1.0Communicationstable

A Model Context Protocol (MCP) server that integrates with X using the @elizaOS 'agent-twitter-client' package, allowing AI models to interact with Twitter without direct API access.

agent-twitter-clientgrokgrok-apigrok3mcp
Share:
28
Stars
0
Downloads
0
Weekly
0/5

What is Agent Twitter Client?

Agent Twitter Client is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol (mcp) server that integrates with x using the @elizaos 'agent-twitter-client' package, allowing ai models to interact with twitter without direct api access.

A Model Context Protocol (MCP) server that integrates with X using the @elizaOS 'agent-twitter-client' package, allowing AI models to interact with Twitter without direct API access.

This server falls under the Communication category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A Model Context Protocol (MCP) server that integrates with X

Use Cases

Interact with X/Twitter through the elizaOS agent-twitter-client.
Enable AI agents to compose and publish tweets without direct API access.
Access Grok API integration for advanced social media automation.
ryanmac

Maintainer

LicenseMIT License
Languagetypescript
Versionv0.1.0
UpdatedApr 29, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y agent-twitter-client-mcp

Manual Installation

npx -y agent-twitter-client-mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Agent Twitter Client

Agent Twitter Client MCP is an MCP server that enables AI agents to interact with X (Twitter) without requiring official Twitter API access, using the elizaOS agent-twitter-client package which authenticates via browser cookies or credentials. It exposes tools for searching and posting tweets, fetching user profiles, following accounts, liking and retweeting, creating polls, and chatting with Grok using real-time Twitter data. This is useful for social media automation, monitoring, and AI-driven content workflows where API access is unavailable or too expensive.

Prerequisites

  • Node.js 18+ installed
  • A Twitter/X account with valid credentials (username/password) or browser cookies (auth_token and ct0)
  • npm installed
  • An MCP-compatible client such as Claude Desktop or Claude Code
1

Install the package globally or locally

Install agent-twitter-client-mcp via npm. Global install makes it available as a direct command; local install uses npx.

npm install -g agent-twitter-client-mcp
# or use npx without installing:
npx -y agent-twitter-client-mcp
2

Obtain your Twitter authentication credentials

Choose an authentication method. Cookie-based auth is most reliable: log into Twitter in your browser and extract the auth_token, ct0, and twid cookies from developer tools (Application > Cookies tab).

3

Add the server to your MCP client config with cookie-based auth

Configure your claude_desktop_config.json using cookie authentication. Replace the cookie values with your actual browser cookies.

{
  "mcpServers": {
    "twitter": {
      "command": "npx",
      "args": ["-y", "agent-twitter-client-mcp"],
      "env": {
        "AUTH_METHOD": "cookies",
        "TWITTER_COOKIES": "[{\"key\":\"auth_token\",\"value\":\"YOUR_AUTH_TOKEN\"},{\"key\":\"ct0\",\"value\":\"YOUR_CT0\"},{\"key\":\"twid\",\"value\":\"YOUR_TWID\"}]"
      }
    }
  }
}
4

Alternative: use username/password auth

If you prefer credential-based auth, set AUTH_METHOD to 'credentials' and provide your Twitter username and password. Add TWITTER_2FA_SECRET if your account uses two-factor authentication.

{
  "mcpServers": {
    "twitter": {
      "command": "npx",
      "args": ["-y", "agent-twitter-client-mcp"],
      "env": {
        "AUTH_METHOD": "credentials",
        "TWITTER_USERNAME": "your_username",
        "TWITTER_PASSWORD": "your_password",
        "TWITTER_EMAIL": "[email protected]"
      }
    }
  }
}
5

Restart your client and test

Restart Claude Desktop and ask it to search Twitter or fetch a user's profile to verify the connection works.

Agent Twitter Client Examples

Client configuration

Claude Desktop config using cookie-based Twitter authentication (most reliable method).

{
  "mcpServers": {
    "twitter": {
      "command": "npx",
      "args": ["-y", "agent-twitter-client-mcp"],
      "env": {
        "AUTH_METHOD": "cookies",
        "TWITTER_COOKIES": "[{\"key\":\"auth_token\",\"value\":\"YOUR_AUTH_TOKEN\"},{\"key\":\"ct0\",\"value\":\"YOUR_CT0\"},{\"key\":\"twid\",\"value\":\"YOUR_TWID\"}]"
      }
    }
  }
}

Prompts to try

Example prompts to use once the server is connected in Claude Desktop.

- "Search Twitter for recent tweets about Model Context Protocol"
- "Post a tweet: 'Just set up an AI agent that can read my Twitter feed!'"
- "Get the latest 10 tweets from @AnthropicAI"
- "Create a poll asking 'Which AI model do you prefer?' with options Claude, GPT-4, and Gemini"
- "Chat with Grok: what are the trending topics on Twitter right now?"

Troubleshooting Agent Twitter Client

Authentication fails with cookie-based auth

Twitter cookies expire frequently. Re-extract fresh auth_token, ct0, and twid cookies from your browser's developer tools after a fresh login. Make sure the JSON array in TWITTER_COOKIES is properly escaped in the config.

Username/password login is blocked or triggers CAPTCHA

Switch to cookie-based authentication (AUTH_METHOD=cookies) which is more reliable and less likely to trigger security checks. Extract cookies from your browser after logging in manually.

Rate limiting errors when posting or searching

X/Twitter enforces rate limits even for cookie-based sessions. Space out automated actions and avoid high-frequency polling. The LOG_LEVEL environment variable can be set to 'debug' for detailed error information.

Frequently Asked Questions about Agent Twitter Client

What is Agent Twitter Client?

Agent Twitter Client is a Model Context Protocol (MCP) server that model context protocol (mcp) server that integrates with x using the @elizaos 'agent-twitter-client' package, allowing ai models to interact with twitter without direct api access. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Agent Twitter Client?

Install via npm with the command: npx -y agent-twitter-client-mcp. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with Agent Twitter Client?

Agent Twitter Client works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Agent Twitter Client free to use?

Yes, Agent Twitter Client is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Communication MCP Servers

Explore all communication servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "agent-twitter-client-mcp": { "command": "npx", "args": ["-y", "agent-twitter-client-mcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Agent Twitter Client?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides