
gkydev/twitter-mcp-server
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
非公式 Twitter MCP クッキーのauthとサーバー.
概要
Twikit ライブラリを使用して Twitter の機能を提供するモデルコンテキストプロトコル (MCP) サーバー。 このサーバーは、AIアシスタントが標準化されたプロトコルを使用してTwitterと対話することができます。LMモデルは、ツールコールで直接ct0とauth tokenクッキーを提供します。 - : LLMモデルは、直接ツールコールでct0とauth tokenクッキーを提供します - : 自動的に効率のための認証されたセッションをキャッシュします - : タイムラインからツイートを取得する - : ユーザーのプロファイルと統計を取得 - 特定のクエリでツイートを検索 - : 投稿、いいね、およびリツイートツイート - : 特定のユーザーからツイートを取得する - : DMsfollowを送信、DM履歴を取得、メッセージに反応し、メッセージを削除します - 投稿の削除 - ユーザーのツイートをフォロー解除する - ツイートをフォロー解除する、ユーザーをフォロー解除する.
概要(AI 翻訳)
twikitライブラリを使用してTwitter機能を提供するモデルコンテキストプロトコル(MCP)サーバー。 このサーバーでは、AI アシスタントは、cookie ベースの認証で標準化されたプロトコルを使用して Twitter とやり取りすることができます - LLM モデルは ct0 と auth_token] を直接ツール呼び出しで提供します。
##特徴
- クッキー認証:LLMモデルは[
ct0および[[auth_token]クッキーを直接ツールコールで提供する -Session Caching: 効率性のための認証セッションを自動的にキャッシュする -Timeline Access:タイムラインからツイートを取得する - ユーザー情報: ユーザープロファイルと統計の取得
- ツイート検索:特定のクエリでツイートを検索
- ツイート管理: 投稿、いいね、リツイート
- ユーザーツイート: 特定のユーザーからツイートを取得する -Direct Messaging:DMを送って下さい、DMの履歴を得て下さい、メッセージに反応し、メッセージを削除して下さい -認証テスト: 使用前にクッキーをテストして下さい
- ツイート操作: ツイートを投稿する、いいね/unlike ツイート、リツイート/削除、ブックマークツイート -Tweet Retrieval: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 MCP 初心者?mcpskill.org のガイドから始めましょう →