Twitter MCP Server
Twitter MCP 服务器
为 AI 代理提供强大的 Twitter 集成,利用模型上下文协议 (MCP) 标准,通过干净一致的界面提供全面的 Twitter 功能。
概述
该服务器通过 MCP 工具提供对 Twitter 功能的访问,从而实现与 AI 助手和其他兼容 MCP 的客户端的无缝集成。它基于agent-twitter-client库构建,并提供强大的错误处理、速率限制和一致的响应格式。
Related MCP server: MCP Twitter
特征
基础阅读
获取具有媒体支持的用户的推文
获取包含详细信息的用户资料
通过主题标签或关键词搜索推文
按最新/热门筛选搜索结果
速率限制(每个请求最多 50 条推文)
用户交互
喜欢/不喜欢推文
转发/撤销转发
发布推文:
文本内容
媒体附件(图片、视频)
回复功能
引用推文功能
高级功能
获取用户关系(关注者/关注者)
获取热门话题
访问不同的时间线类型:
主页时间线
遵循时间线
用户时间线
列表管理(获取列表推文)
媒体与高级交互
媒体处理:
图像上传(JPEG、PNG、GIF)
视频上传 (MP4)
替代文本支持
线程创建
关注/取消关注用户
工具
阅读工具
get_tweets- 获取用户最近的推文get_profile获取用户的个人资料信息search_tweets- 通过标签或关键词搜索推文
交互工具
like_tweet- 喜欢或不喜欢一条推文retweet- 转发或撤消转发post_tweet- 发布带有可选媒体的新推文create_thread- 创建 Twitter 线程
时间线工具
get_timeline- 从不同的时间线类型获取推文get_list_tweets- 从 Twitter 列表中获取推文get_trends- 获取当前热门话题
用户管理工具
get_user_relationships- 获取关注者或关注者列表follow_user- 关注或取消关注用户
安装
安装依赖项:
npm install构建服务器:
npm run build配置环境变量:
# Required: Twitter Account Credentials (for user authentication)
TWITTER_USERNAME=your_username
TWITTER_PASSWORD=your_password
TWITTER_EMAIL=your_email
# Twitter API Authentication (Optional)
TWITTER_API_KEY=your_api_key
TWITTER_API_SECRET_KEY=your_api_secret_key
TWITTER_ACCESS_TOKEN=your_access_token
TWITTER_ACCESS_TOKEN_SECRET=your_access_token_secret将服务器配置添加到您的 MCP 客户端:
在 MacOS 上:
~/Library/Application Support/Claude/claude_desktop_config.json在 Windows 上:
%APPDATA%/Claude/claude_desktop_config.json配置:
{
"mcpServers": {
"twitter-mcp-server": {
"command": "/path/to/twitter-mcp-server/build/index.js"
}
}
}发展
对于使用自动重建的开发:
npm run watch调试
由于 MCP 服务器通过 stdio 进行通信,因此您可以使用 MCP Inspector 进行调试:
npm run inspector检查器将提供一个 URL 来访问浏览器中的调试工具。
错误处理
服务器实现了全面的错误处理:
所有参数的输入验证
速率限制保护
详细错误消息
适当的错误传播
用于调试的日志记录
响应格式
所有工具都以一致的格式返回响应:
{
content: [{
type: "text",
text: string // JSON stringified response or error message
}]
}贡献
欢迎贡献代码!欢迎提交 Pull 请求。
执照
MIT 许可证 - 详情请参阅许可证文件
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables interaction with Twitter through a Model Context Protocol, allowing large language models to post tweets, search for tweets, and reply to tweets.532425MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI models and applications to interact directly with Twitter/X, providing capabilities to create posts, reply to tweets, retrieve user data, and manage account actions.1411MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables AI agents to interact with Twitter without direct API access, supporting tweet operations, user interactions, and Grok AI integration.141,63632MIT
- FlicenseNot gradedqualityCmaintenanceA Model Context Protocol server that enables AI assistants to interact with Twitter functionality using cookie-based authentication, allowing for timeline access, tweet management, user information retrieval, and search capabilities.16
Related MCP Connectors
X (formerly Twitter) posts, profiles, and search for AI agents. Free key, self-minted, no signup.
Give your agent live data from Twitter, Reddit, the web and GitHub. No API keys, no scraping stack.
Connect any AI agent to 11+ social platforms: schedule, publish & track posts via hosted MCP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/taazkareem/twitter-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server