
一个非正式的Twitter MCP 有饼干认证的服务器 .
概览
一个模型背景协议(MCP)服务器,使用twikit库提供Twitter功能. 这个服务器允许AI助手通过一个标准化的协议与Twitter交互 - LLM模型在工具调用中直接提供ct0和auth token cookie. - : LLM模型直接在工具调用中提供ct0和auth token cookie - :自动缓存认证会议效率 - :从您的时间表中获取微博 - 检索用户概况和统计数据 - :搜索有特定查询的微博 - 邮递,类似,并重接微博 - :从特定用户获取微博 - 发送DM,获取DM历史,对消息作出反应,并删除消息 - 使用前测试cookie - :张贴微博,类似/类似微博,重接/删除retweets,书签微博 - :通过ID获取微博,搜索微博,获取用户时间表,获得微博回复 - 跟踪/不跟踪用户信息,搜索用户 - 搜索用户 - 从不同类别获取趋势话题(发送,新闻,体育,...).
概述(AI 翻译)
一个模型背景协议(MCP)服务器,使用twikit库提供Twitter功能. 这个服务器允许AI助手通过基于cookie的认证的标准化协议与Twitter交互——LLM模型在工具调用中直接提供[[T1]和[T2]饼干.
□ 特性
- Cookie认证:LLM模型在工具调用中直接提供[[T3]和
auth_token饼干 - ** 会议缓存**:自动缓存
- ** Timeline Access**:从您的时间表中获取微博
- 用户信息: 检索用户简介和统计数据
- Tweet Search:搜索有具体查询的微博
- ** 电信管理**: 贴出一些微博
- 用户Tweets: 获取特定用户的微博
- ** Direct Message **:发送DMs,获取DM历史,对消息作出反应并删除消息
- 核证测试: 使用前测试 cookie
- ** 调试操作**: 贴出类似/类似推特的推文,再贴出/删除回帖,书签推文
- Tweet检索:通过ID获取微博,搜索微博,获得用户时间表,获得微博回复
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Twitter MCP Server
A Model Context Protocol (MCP) server that provides Twitter functionality using the twikit library. This server allows AI assistants to interact with Twitter through a standardized protocol with cookie-based authentication - the LLM model provides ct0 and auth_token cookies directly in tool calls.
Features
- Cookie Authentication: LLM model provides
ct0andauth_tokencookies directly in tool calls - Session Caching: Automatically caches authenticated sessions for efficiency
- Timeline Access: Get tweets from your timeline
- User Information: Retrieve user profiles and statistics
- Tweet Search: Search for tweets with specific queries
- Tweet Management: Post, like, and retweet tweets
- User Tweets: Get tweets from specific users
- Direct Messaging: Send DMs, get DM history, react to messages, and delete messages
- Authentication Testing: Test cookies before use
- Tweet Operations: Post tweets, like/unlike tweets, retweet/delete retweets, bookmark tweets
- Tweet Retrieval: Get tweets by ID, search tweets, get user timelines, get tweet replies
- User Operations: Follow/unfollow users, get user information, search users
- Trending Topics: Get trending topics across different categories (trending, news, sports, entertainment, for-you)
Disclaimer
This project utilizes an unofficial API to interact with X (formerly Twitter) through the twikit library. The methods employed for authentication and data retrieval are not officially endorsed by X/Twitter and may be subject to change or discontinuation without notice.
This tool is intended for educational and experimental purposes only. Users should be aware of the potential risks associated with using unofficial APIs, including but not limited to account restrictions or suspension. The developers of this project are not responsible for any misuse or consequences arising from the use of this tool.
Installation
- Clone this repository:
git clone
cd twitter-mcp
- Install dependencies:
pip install -r requirements.txt
- Run the server:
python server.py
Authentication
The server expects the LLM model to provide Twitter cookies directly in each tool call via the ct0 and auth_token parameters. No pre-configuration is required!
Getting Twitter Cookies
The LLM model will need to provide both Twitter cookies. Here’s how to obtain them:
- Open your browser and go to Twitter/X
- Log in to your account
- Open Developer Tools (F12)
- Go to Application/Storage → Cookies → twitter.com (or x.com)
- Find and copy these cookie values:
ct0- CSRF token cookieauth_token- Authentication token cookie
Both cookies are required for all operations.
Usage
Available Tools
1. Authenticate
Test authentication with cookies:
{
"tool": "authenticate",
"arguments": {
"ct0": "your_ct0_cookie_here",
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →