mcp_social_media_platform_access_utility
This server component furnishes AI agents with streamlined mechanisms for interacting with the X (formerly Twitter) platform, facilitating activities like composing outbound status updates, subscribing to other accounts, and retrieving historical posts via a uniform interface.
Author

0xhijo
Quick Info
Actions
Tags
Model Context Protocol - X/Twitter Interfacing Module
Synopsis
This MCP server instance grants direct programmatic access to the X (Twitter) microblogging ecosystem. It abstracts complex platform APIs into a consistent suite of callable functions, empowering large language models and associated applications to execute specific actions on X.
Capabilities
This utility exposes the following operations:
create_twitter_post: Publish a fresh microblog entry to X.reply_twitter_tweet: Generate a response directed at an existing X post, identified by its unique identifier.get_last_tweet: Fetch the most recent published item from a designated user profile.get_last_tweets_options: Retrieve a collection of recent posts matching specific search criteria.create_and_post_twitter_thread: Author and deploy a sequential series of interconnected X posts.follow_twitter_from_username: Initiate a follow action targeting an account specified by its handle.get_twitter_profile_from_username: Acquire the full profile metadata associated with a given X user handle.get_twitter_user_id_from_username: Resolve the numerical internal identifier for an X account from its textual handle.get_last_tweet_and_replies_from_user: Fetch recent content, including replies, made by a specific account holder.get_last_tweet_from_user: Retrieve recent independent posts published by a user.get_own_twitter_account_info: Obtain the configuration and profile details for the currently authenticated system account.
Deployment Guide
Local Machine Setup
# Obtain the source repository
git clone https://github.com/0xhijo/mcp_twitter.git
# Install necessary packages and compile
pnpm build
# Initiate the service listener
node ./build/index.js
Deployment via NPX
npx mcp_twitter
Configuration Parameters
Authentication Method 1: Utilizing Direct Credentials (Scraping Mode)
- Populate the
.envconfiguration file:
TWITTER_AUTH_MODE = "CREDENTIALS" # Indicates credential-based access
# Required login credentials
TWITTER_USERNAME="ACCOUNT_HANDLE"
TWITTER_PASSWORD="SECRET_KEY"
TWITTER_EMAIL="CONTACT_EMAIL"
Authentication setup mandates defining these variables either within a .env file in the execution directory or setting them as system environment variables.
Authentication Method 2: Utilizing Official API Keys
-
Establish a Twitter Developer Entity:
-
Possess an active Twitter account.
- Navigate to the Developer Portal.
- Secure your requisite API key credentials.
-
Consult the official documentation for developer account creation assistance.
-
Configure the
.envfile with API artifacts:
TWITTER_AUTH_MODE = "API" # Indicates API key access
# Keys obtained from the Developer Console
TWITTER_API="CONSUMER_KEY"
TWITTER_API_SECRET="CONSUMER_SECRET_KEY"
TWITTER_ACCESS_TOKEN="ACCESS_TOKEN_VALUE"
TWITTER_ACCESS_TOKEN_SECRET="ACCESS_TOKEN_SECRET_VALUE"
Integration with Claude Environment
To enable Claude (or similar LLM orchestrators) to invoke this service, it must be cataloged within the claude_mcp_config.json manifest.
Updating the MCP Configuration File
Incorporate the following JSON structure into your configuration file:
"mcp_twitter": {
"command": "npx",
"args": ["mcp_twitter"],
"env": {
"TWITTER_AUTH_MODE": "CREDENTIALS",
"TWITTER_USERNAME": "YOUR_TWITTER_USERNAME",
"TWITTER_PASSWORD": "YOUR_TWITTER_PASSWORD",
"TWITTER_EMAIL": "YOUR_TWITTER_EMAIL"
}
}
Ensure that the placeholder values reflect the chosen authentication method and actual account details. This entry instructs the orchestrator to initiate the utility server via npx upon the requirement for X platform interaction.
Operational Use with Claude
Upon successful configuration, Claude gains the capability to issue commands pertaining to social media management (posting, querying records, etc.), delegating the execution to this active MCP server instance.
Critical Considerations
- Select the authentication pathway (
APIorCREDENTIALS) that aligns best with operational security policies. - Rigorously confirm that environment variables specified in
.envare correct. - Review the official platform documentation for current rate limits and operational constraints.
