x-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@x-mcppost a tweet saying 'Hello from MCP!'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
x-mcp
An MCP server and CLI for interacting with X/Twitter, built with @xdevplatform/xdk.
Tools
Tool | Description |
| Post a tweet |
| Search recent tweets (last 7 days) |
| Get user profile info by username(s) |
| Get your home timeline |
| Like a tweet by ID |
| Retweet a tweet by ID |
| Delete a tweet by ID |
Related MCP server: TwitterAPI MCP Server
Setup
Prerequisites
You need X/Twitter API credentials (OAuth 1.0a). Get them from the X Developer Portal:
API Key (Consumer Key)
API Secret (Consumer Secret)
Access Token
Access Token Secret
Authenticate
Either log in interactively (credentials are saved to ~/.x-mcp/credentials.json):
npx @kms_dev/x-mcp loginOr set environment variables:
export X_API_KEY=your_api_key
export X_API_SECRET=your_api_secret
export X_ACCESS_TOKEN=your_access_token
export X_ACCESS_TOKEN_SECRET=your_access_token_secretEnvironment variables take precedence over stored credentials.
Usage
MCP Server
Add to your MCP client config (e.g. Claude Desktop ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"x-mcp": {
"command": "npx",
"args": ["-y", "@kms_dev/x-mcp"],
"env": {
"X_API_KEY": "your_api_key",
"X_API_SECRET": "your_api_secret",
"X_ACCESS_TOKEN": "your_access_token",
"X_ACCESS_TOKEN_SECRET": "your_access_token_secret"
}
}
}
}If you've already run npx @kms_dev/x-mcp login, you can omit the env block:
{
"mcpServers": {
"x-mcp": {
"command": "npx",
"args": ["-y", "@kms_dev/x-mcp"]
}
}
}CLI
npx @kms_dev/x-mcp login
npx @kms_dev/x-mcp post-tweet "Hello world!"
npx @kms_dev/x-mcp search-tweets "typescript" --max-results 5
npx @kms_dev/x-mcp get-user-info XDevelopers
npx @kms_dev/x-mcp get-timeline --max-results 10
npx @kms_dev/x-mcp like-tweet 1234567890
npx @kms_dev/x-mcp retweet 1234567890
npx @kms_dev/x-mcp delete-tweet 1234567890Development
git clone https://github.com/khajaphysist/x-mcp.git
cd x-mcp
npm install
# Run tests
npm test
# Run CLI
npx tsx src/cli.ts search-tweets "test"
# Run MCP server
npx tsx src/mcp-server.ts
# Test MCP server with inspector
npx @modelcontextprotocol/inspector npx tsx src/mcp-server.tsAvailable Tools
7 toolsdelete_tweetA
Delete a tweet by its ID (must be owned by the authenticated user)
| Name | Required | Description | Default |
|---|---|---|---|
| tweet_id | Yes | The ID of the tweet to delete |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full burden of behavioral disclosure. It correctly identifies the operation as destructive (deletion). However, it does not mention that deletion is irreversible, nor does it specify whether the action is idempotent, what happens if the tweet is already deleted, or whether the authenticated user's permissions are validated. For a destructive tool with no annotations, this is a moderate disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence with no extraneous words. It front-loads the action and resource, immediately followed by the ownership constraint. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that there is no output schema and the tool is destructive, the description could be slightly more complete. It does not mention the result of a successful deletion (e.g., returns a confirmation object or void), nor does it address error cases (e.g., not found, not owned). However, for a single-parameter, straightforward delete operation, the description is nearly adequate. A small increment in completeness, such as noting irreversibility, would push it higher.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with a single 'tweet_id' parameter described generically. The description adds value by clarifying that the tweet must be owned by the authenticated user, which is a critical constraint not evident from the parameter description alone. This contextualizes the parameter meaningfully. No improvement needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Delete'), the resource ('a tweet'), and the identifier mechanism ('by its ID'). The parenthetical constraint ('must be owned by the authenticated user') distinguishes this from generic deletion context, making the tool's purpose precise and unmistakable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides an implicit usage constraint: the tweet must be owned by the authenticated user. It does not explicitly state when not to use this tool or suggest alternative tools (e.g., use unlike or undo for non-deletion actions). However, the constraint is clear enough to guide the agent away from inappropriate calls.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_timelineB
Get the authenticated user's home timeline (reverse chronological)
| Name | Required | Description | Default |
|---|---|---|---|
| max_results | No | Maximum number of results (1-100, default 20) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description must disclose behavioral traits. It only states it is a read operation and implies ordering, but it does not mention authentication, rate limits, pagination, error responses, or what happens if unauthorized. This is insufficient for a tool that requires authentication.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence, front-loaded with the key action. It is very concise, but it may be too brief, lacking any additional context. However, it earns a 4 for efficiency with no wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has no output schema and only one optional parameter, the description should compensate by explaining what the timeline contains (e.g., a list of tweets) and any limitations. It does not, leaving the agent with incomplete information about the return value or behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage for the single parameter 'max_results'. The description does not add any extra meaning beyond the schema's own description. Baseline 3 is appropriate since the schema already provides the necessary semantic detail.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Get' and the resource 'authenticated user's home timeline' with ordering detail 'reverse chronological'. It is specific and distinct from sibling tools like post_tweet, search_tweets, etc., which have different purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives (e.g., search_tweets for non-timeline tweet retrieval). There is no mention of prerequisites, exclusions, or context. The description is purely functional without any usage direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_user_infoB
Get profile information for one or more X/Twitter users by username
| Name | Required | Description | Default |
|---|---|---|---|
| usernames | Yes | One or more usernames (without @ prefix) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It implies a read operation but does not explicitly confirm idempotency, required permissions, rate limits, or potential side effects. Basic purpose is clear, but behavioral constraints are absent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence is efficient and front-loaded. Every word earns its place. Could be slightly improved by adding structure (e.g., listing what profile fields are returned), but not verbose or wasteful.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with one parameter and no output schema, the description is adequate but not comprehensive. It fails to specify what 'profile information' includes (bio, follower count, etc.) or error handling. While simple, an agent might need more detail to parse results effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and the parameter description in the schema already clarifies 'usernames (without @ prefix)'. The tool description adds no extra meaning beyond that. Baseline 3 is appropriate as no further enrichment is needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the verb 'Get' and resource 'profile information for one or more X/Twitter users by username'. This distinguishes it well from sibling tools which are all tweet-related (post, search, timeline, like, retweet, delete). No ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives (e.g., search_tweets for user lookup by other criteria). No mention of prerequisites, rate limits, or authentication requirements. The description simply states what it does, not when or how to decide.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
like_tweetB
Like a tweet by its ID
| Name | Required | Description | Default |
|---|---|---|---|
| tweet_id | Yes | The ID of the tweet to like |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must disclose behavioral traits. It only states the basic action without clarifying side effects (e.g., irreversibility, notification effects), rate limits, or authentication requirements. This is insufficient for an action that modifies state.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, 5-word sentence with no filler. Every word contributes to the core message, making it highly efficient and easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple 1-param tool with no output schema, the description covers the basic purpose and parameter. However, it lacks context such as user authentication requirements, success/error behavior, and differentiation from similar actions like retweet. It is adequate but leaves gaps in completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% (tweet_id has its own description). The description adds 'by its ID' which largely duplicates the schema's purpose. No additional parameter meaning or formatting details are provided, so it neither detracts nor significantly adds value beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Like a tweet by its ID' uses a specific verb ('like') and resource ('tweet'), clearly distinguishing it from sibling tools like retweet, delete_tweet, or post_tweet. The action and target are unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives (e.g., retweet or deleting a tweet). There is no mention of prerequisites, such as user authentication, or context about when liking is appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
post_tweetB
Post a tweet to X/Twitter
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text content of the tweet (max 280 characters) | |
| reply_to | No | Tweet ID to reply to |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry the full burden of behavioral disclosure. The description only states the action without revealing behaviors like authentication requirements, rate limits, idempotency, or whether the tweet is publicly visible. This is insufficient for a mutation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no extraneous words. It is efficient, though it could be slightly expanded for clarity without losing conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has no output schema and only 2 parameters, the description is too sparse. It lacks contextual details such as the nature of the response, whether the operation is reversible, or any platform-specific constraints. The sibling tools are present but the description does not leverage them.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so baseline is 3. The description adds no additional meaning beyond the schema; the schema already defines 'text' (max 280 chars) and 'reply_to' (tweet ID). The description does not elaborate on formatting, constraints, or usage patterns.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (post), the resource (a tweet), and the platform (X/Twitter). It distinguishes itself from sibling tools like search_tweets, like_tweet, and delete_tweet by specifying the create action.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It does not mention when not to use it, prerequisites, or context that would help an agent choose between post_tweet and other siblings like retweet or delete_tweet.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
retweetA
Retweet (repost) a tweet by its ID
| Name | Required | Description | Default |
|---|---|---|---|
| tweet_id | Yes | The ID of the tweet to retweet |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description must convey behavioral traits. It implies the action is non-destructive and creates a repost. However, it does not explain effects like visibility changes, rate limits, or whether the tweet must be from a different user. The description is adequate but lacks depth for a social media action.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise at one sentence with no wasted words. It front-loads the key action and resource, making it efficient for an agent to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simplicity of the tool (one parameter, no output schema), the description is minimally complete but lacks context about what the retweet action entails (e.g., visibility, error cases). It covers the basic purpose but leaves gaps in behavioral understanding.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema for tweet_id has 100% description coverage ('The ID of the tweet to retweet'), so the description adds no extra meaning beyond what the schema provides. Baseline score of 3 is appropriate since no further parameter details are needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action 'Retweet (repost) a tweet' and the resource 'by its ID'. It uses a direct verb and specific resource, which is unambiguous and distinguishes it from siblings like like_tweet (different action) and post_tweet (creating a new tweet).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not provide any guidance on when to use this tool versus alternatives, such as when to retweet vs. like a tweet or post a new tweet. No exclusions or prerequisites are mentioned, limiting its helpfulness for agent decision-making.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_tweetsB
Search recent tweets on X/Twitter (last 7 days)
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query (supports X search operators like from:, to:, is:retweet, etc.) | |
| max_results | No | Maximum number of results (10-100, default 10) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden but only states the time constraint (last 7 days). It does not disclose rate limits, authentication needs, result format, or error behavior, which are critical for a search tool without an output schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single concise sentence that is front-loaded with the core action and resource. Every word serves a purpose with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 2 parameters and no output schema, the description is adequate for the core purpose but lacks information on return values, pagination, or error states. It meets the minimum viability but leaves gaps for an agent to infer.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already covers both parameters with descriptions (100% coverage). The description adds no additional meaning beyond the schema, so baseline score 3 is applied. No param-specific enrichment is present.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool searches recent tweets and includes a time constraint (last 7 days). It differentiates from sibling tools like post_tweet by emphasizing search over creation, but does not explicitly contrast with get_timeline or get_user_info, leaving some ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus siblings like get_timeline or get_user_info. There is no mention of when not to use it or alternative tools, leaving the agent to infer usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
7 tool updates
v0.1.5- First observed
delete_tweet - First observed
get_timeline - First observed
get_user_info - First observed
like_tweet - First observed
post_tweet - First observed
retweet - First observed
search_tweets
TDQS
Scored across 7 tools
Each tool targets a distinct action (post, search, get user info, timeline, like, retweet, delete) with no overlap. An agent can easily distinguish them.
All tools follow a consistent verb_noun pattern in snake_case (e.g., post_tweet, search_tweets, get_user_info). No deviations or mixed conventions.
Seven tools cover the core Twitter operations without being excessive. The scope is well-balanced for a dedicated social media server.
The set covers posting, timeline, search, user info, likes, retweets, and deletion. However, fetching a specific tweet by ID is missing, which is a minor gap for workflows that need to retrieve a single tweet after a search.
Maintenance
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
Create, deploy, and operate MCP servers directly from your GitHub repositories.
MCP registry & directory: search, find & install 31k+ MCP servers & tools. Catalog and marketplace.
Publish and discover MCP servers via the official MCP Registry. Powered by HAPI MCP server.
Related MCP Servers
- AlicenseCqualityDmaintenanceAn MCP server for accessing the Twitter/X Api45 API, allowing users to retrieve user profiles, timelines, followers, and media. It supports searching communities, jobs, and trends, while also providing tools to monitor live broadcasts and Twitter Spaces.28MIT
- AlicenseBqualityDmaintenanceAn MCP server that provides access to Twitter data and write actions through TwitterAPI.io, bypassing the need for a standard Twitter developer account. It enables users to search tweets, retrieve profiles, and post content with support for pagination and enterprise proxy configurations.8 npmMIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server for interacting with the Twitter/X API v2, enabling AI assistants to retrieve tweets, post content, reply, quote, and more programmatically.1,020 npm13MIT
- AlicenseBqualityAmaintenanceAn MCP server for interacting with Twitter/X using browser cookies without an API key, enabling tweet management, user actions, and search via natural language.6273 PyPI11MIT