X MCP Server: Connect AI to Twitter Research and Publishing
An X MCP server connects an AI assistant to the X platform for searching public posts, reading timelines, and publishing content through a standard tool call. Here is how to set it up, where the line between reading and publishing sits, and how to keep research links and approved campaign decisions separate from live posts.
Updated 4 min read
An X MCP server connects an AI assistant to the X platform through the X API (opens in a new tab), letting it search public posts, read user timelines, look up trending topics, and publish tweets on your behalf. The read side is straightforward for research and monitoring tasks; the publish side requires a clear rule about what the AI is allowed to post without a human reviewing it first. Tools like fenbs keep the research links you want to preserve and the campaign decisions that only a person should make.
X API access requires a developer account and an approved project. Free and paid tiers have different rate limits and allowed operations. Check the X developer platform (opens in a new tab) for current plan details before building a workflow that depends on specific rate limits. Check the MCP server directory for available X MCP packages.
Connect an AI assistant to X
- Create an X developer account and a project in the X developer portal (opens in a new tab). Generate API keys, API secret, access token, and access token secret for OAuth 1.0a, or a bearer token for read-only OAuth 2.0 access.
- Install an X MCP server package. Configure it with the credentials as environment variables, not in the config file directly.
- Add the server to your AI client's MCP config. See MCP server configuration for the format. For read-only use, set up OAuth 2.0 with a bearer token and do not provide write credentials.
- Restart the AI client and ask the assistant to search for a keyword you know well. Verify the results match what you see when searching X directly.
- Test publishing only in a test account or with a post you would be comfortable leaving live before trusting the assistant with your main account.
Read access: research and monitoring
Read-only X access lets an AI assistant search public posts, retrieve a user's timeline, pull replies to a specific tweet, check follower counts, and look up trending topics in a given location. This covers the research and monitoring use cases: competitive analysis, topic research, audience questions, and media monitoring.
Rate limits on the X API vary by plan and endpoint. The assistant may need to space out search calls or work in batches if you are processing a large volume of posts. Check the current limits in the X developer documentation rather than assuming they are the same as in a previous plan.
Write access: publishing boundaries
Write access lets the assistant post tweets, reply, like, retweet, and follow accounts. Any of these actions are public and immediate. A tweet posted by mistake, a reply with the wrong tone, or a follow on a sensitive account can cause real consequences. The rule for write access should be simple: a human reviews every post before it goes live.
If the assistant is drafting posts for you to review, it does not need write access. Use it to generate the draft text, then post it yourself. Reserve write access for supervised publishing workflows where the assistant is a scheduling or formatting assistant and a human has approved each post.
For server architecture and transport options, see MCP server architecture.
Keep research links and campaign decisions
Research sessions on X produce links worth keeping: the post that surfaced a key insight, the thread that explained a trend, the account worth monitoring. Without saving them, the next session starts from a cold search.
fenbs keeps those links as Links in the project. Campaign decisions — the approved messaging for this campaign, which topics to avoid, who must approve before anything is posted — go in Decisions and rules where every assistant that works on the campaign reads them before acting.
The X developer program has different tiers with different levels of API access. The free tier allows reading public posts but imposes strict rate limits and excludes some endpoints. Paid tiers increase call volume and unlock fuller search and timeline access. Before designing a workflow around a specific X API capability, check the current tier requirements on the X developer platform (opens in a new tab) rather than assuming the endpoint is available. X's developer policy also restricts certain uses, including bulk downloading, automated following, and redistribution of content. Review the current policy before building a workflow that processes large volumes of posts, since a policy violation can result in the developer account being suspended. Document the specific policy sections relevant to your use case and the date you reviewed them as a context note, since the developer policy can change independently of the API itself.
Preserve research links and keep campaign decisions in one place
Add X posts and threads that matter to your research as Links in fenbs. Record campaign rules — approved messaging, topics to avoid, the requirement that a human approves every post — as Decisions and rules. Every assistant that works on the campaign reads those rules before drafting or publishing anything.
Create a free accountFree for one person · No credit card · Works with Claude, ChatGPT, Cursor and more
How to do this with fenbs
- Create a free account and add a project for the X research or campaign work.
- Add notable X posts, threads, and accounts as Links in the project with a note on why each matters.
- Record campaign rules as Decisions and rules: voice guidelines, approved topics, prohibited content, and the requirement that a human reviews every post before publishing.
- Connect your AI app to fenbs at Integrations. It reads the campaign rules before drafting any content.
- Before each session ends, save any new links found and update the current campaign status.
fenbs does not connect to X directly. It holds the research links and campaign decisions; the X MCP server handles the live API calls.