Click on "Install 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., "@TwitterAPI MCP ServerSearch for the latest tweets mentioning Model Context Protocol"
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.
TwitterAPI MCP Server
A Model Context Protocol (MCP) server that provides access to Twitter data through the TwitterAPI.io service. This server enables Claude and other MCP clients to interact with Twitter's ecosystem without requiring Twitter developer account approval.
Attribution: This project is a fork of kinhunt/twitterapi-mcp with bug fixes and improvements to match the official TwitterAPI.io documentation.
Features
User Information: Get detailed user profiles, followers, and following lists
Tweet Operations: Search tweets, get tweet details, replies, and user timelines
Search Capabilities: Advanced search for both tweets and users
Write Actions: Post tweets and interact with content (requires login)
Pagination Support: All list endpoints support cursor-based pagination
Enterprise Ready: Proxy support and robust error handling
No Twitter Auth: Uses TwitterAPI.io which doesn't require Twitter developer approval
Installation
Quick Start with npx (Recommended)
Global Installation
Local Installation
Configuration
Getting an API Key
Visit TwitterAPI.io
Create an account and log in
Get your API key from the dashboard
The API key format looks like:
new1_xxxxxxxxxxxxxxxxxxxxx
Environment Variables
Variable | Required | Description |
| Yes | Your TwitterAPI.io API key |
| No | Proxy URL for enterprise environments |
| No | Alternative proxy configuration |
| No | Alternative proxy configuration |
MCP Client Configuration
Claude Desktop
Add this to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Claude Desktop with Proxy
Cursor IDE
Add to your Cursor MCP settings (.cursor/mcp.json):
Claude Code
Add to your Claude Code MCP settings (~/.claude/settings.json):
Using with Node directly
If you prefer to run with Node directly instead of npx:
Available Tools
User Information
Tool | Description | Required Params | Optional Params |
| Get user details by username |
| - |
| Get user details by user ID |
| - |
| Get user's followers (200/page) |
|
|
| Get users someone follows (200/page) |
|
|
| Search for users by keyword |
|
|
Tweet Operations
Tool | Description | Required Params | Optional Params |
| Get tweets from a user (20/page) |
|
|
| Search tweets by keywords |
|
|
| Get tweets by IDs |
| - |
| Get replies to a tweet (20/page) |
|
|
Write Actions (Requires Login)
Tool | Description | Required Params | Optional Params |
| Login to Twitter account |
|
|
| Post new tweets |
|
|
Examples
Get User Information
Search and Retrieve Tweets
Create Content (Requires Login)
Pagination
All list endpoints return paginated results with cursor-based navigation:
To get the next page, pass the next_cursor value as the cursor parameter in your next request.
API Pricing
TwitterAPI.io offers pay-as-you-go pricing:
Operation | Price |
Tweets | $0.15 per 1,000 |
User profiles | $0.18 per 1,000 |
Followers/Following | $0.15 per 1,000 |
Login | $0.003 per call |
Create tweet | $0.003 per call |
Minimum charge: $0.00015 per request
No monthly fees
Free trial credits available
Discounted rates for students and research institutions
Development
Building from Source
Running Tests
Testing the Server Manually
Project Structure
Error Handling
The server handles common errors:
Error | Cause | Solution |
401 Unauthorized | Invalid API key | Check your |
402 Payment Required | Insufficient credits | Add credits at TwitterAPI.io dashboard |
429 Rate Limited | Too many requests | Wait and retry, or reduce request rate |
400 Bad Request | Invalid parameters | Check parameter names and formats |
Security Considerations
Store API keys as environment variables, never in code
Login credentials are used only for authentication, not stored persistently
All API requests use HTTPS
Proxy support available for enterprise security requirements
The
login_cookiefrom login is stored in memory only for the session
Troubleshooting
"Unauthorized" error
Verify your API key is correct
Check that
TWITTERAPI_API_KEYenvironment variable is set
"Credits not enough" error
Add credits to your TwitterAPI.io account
Check your usage at the dashboard
Server not starting
Ensure Node.js >= 18.0.0 is installed
Run
npm run buildto compile TypeScriptCheck for error messages in stderr
Proxy issues
Verify proxy URL format:
http://user:pass@host:portTest proxy connectivity independently
For HTTPS proxies, use
HTTPS_PROXYvariable
Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
API Documentation: docs.twitterapi.io
Issues: GitHub Issues
TwitterAPI.io Support: twitterapi.io
Acknowledgments
Originally forked from kinhunt/twitterapi-mcp
Built on TwitterAPI.io service
Uses the Model Context Protocol
Part of the growing MCP ecosystem
Note: This is an unofficial MCP server for TwitterAPI.io. Make sure to comply with Twitter's Terms of Service when using this tool.