x-agent MCP Server
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., "@x-agent MCP Serversearch tweets about open source AI"
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.
@talocode/x-agent
Open-source X research and human-approved publishing assistant — CLI, SDK, MCP, REST API, and AI agent skill packs.
npm install -g @talocode/x-agent
# Real "click Authorize on X" (OAuth 2.0 PKCE)
x-agent auth oauth --client-id YOUR_CLIENT_ID
# Or paste an existing token
x-agent auth login --bearer YOUR_X_BEARER_TOKENFeatures
Search — tweets, users, trends, conversations
Post — tweets, replies, threads with AI drafting
Analyze — Phoenix algorithm scoring (19 engagement signals)
Monitor — watch keywords, accounts, trends
Safety gate — posting and replies require
X_AGENT_ALLOW_WRITE=trueat execution timeAnalytics — query owned-post impressions, engagement, media views, clicks, and follows
Video primitives — initialize, append, and finalize an explicit user-approved chunked upload
CLI — full terminal interface
SDK —
XAgentClientfor programmatic useMCP — 19+ tools for any MCP-compatible agent
REST API — HTTP server for remote integrations
Skills — agent skill packs for Claude Code, OpenCode, Cursor
Related MCP server: Twitter/X MCP Server
Quick Start
# Install
npm install -g @talocode/x-agent
# Sign in with X (browser Authorize + local callback)
# Register callback in the X developer portal: http://127.0.0.1:8787/callback
x-agent auth oauth --client-id YOUR_CLIENT_ID
# Headless / remote: print URL and paste the redirect after authorizing
x-agent auth oauth --client-id YOUR_CLIENT_ID --manual
# Search tweets
x-agent search tweets "open source AI"
# Draft content
x-agent post draft --topic "building with MCP" --tone educational
# Score against Phoenix algorithm
x-agent analyze score "Your tweet text here"
# Start MCP server
x-agent mcp
# Start REST API
x-agent serveOAuth 2.0 (click Authorize on X)
x-agent implements OAuth 2.0 with PKCE for user-context access (post as the account that clicks Authorize).
In the X developer portal, create/select an app and enable OAuth 2.0.
Set Type of App to a type that supports the Authorization Code + PKCE flow.
Add an exact Callback URI / Redirect URL, for example:
http://127.0.0.1:8787/callbackCopy the Client ID (and Client Secret if the app is confidential).
Run:
x-agent auth oauth --client-id YOUR_CLIENT_ID # confidential apps: x-agent auth oauth --client-id YOUR_CLIENT_ID --client-secret YOUR_SECRETA browser opens X’s Authorize screen. Approve as @yourhandle (e.g. @AbdMuizAdeyemo).
The local callback saves tokens to
~/.config/x-agent/tokens.json(mode600).Verify:
x-agent auth statusthenx-agent profile get --username yourhandle.
Default scopes: tweet.read tweet.write users.read offline.access.
Override with --scope "tweet.read tweet.write users.read offline.access like.write media.write".
If the browser cannot reach localhost (remote shell, Termux without loopback), use:
x-agent auth oauth --client-id YOUR_CLIENT_ID --manualThen paste the full redirect URL from the address bar after authorizing.
Refresh when the access token expires:
x-agent auth refreshEnvironment variable alternatives: X_CLIENT_ID, X_CLIENT_SECRET, X_REDIRECT_URI, X_BEARER_TOKEN, X_REFRESH_TOKEN.
Automation Boundaries
Use read-only tools for research, trends, and analysis. Posting and replying are explicit human-approved actions and require X_AGENT_ALLOW_WRITE=true at execution time. Do not use this package for automated likes, follows, unsolicited replies, bulk direct messages, or trend-targeting.
Video publishing requires OAuth user authorization with media and post write permissions. The SDK exposes upload primitives but does not schedule or automatically publish content.
CLI Reference
Command | Description |
| OAuth 2.0 PKCE — open Authorize on X, capture callback |
| Paste / save API tokens manually |
| Refresh OAuth 2.0 access token |
| Check auth status |
| Remove stored credentials |
| Search tweets by keyword |
| Search X users |
| Get tweet by ID |
| Get user profile |
| Get user's recent tweets |
| Get user's followers |
| Get user's mentions |
| View trending topics |
| Post a tweet |
| Generate AI drafts |
| Reply to a tweet |
| Improve tweet engagement |
| Phoenix algorithm scoring |
| Full AI analysis |
| Add a watch target |
| List watch targets |
| Check watch targets |
| Start MCP server |
| Start REST API server |
SDK Usage
import { XAgentClient } from '@talocode/x-agent'
const client = new XAgentClient({
tokens: { bearerToken: 'YOUR_TOKEN' }
})
const user = await client.getUser('talocode')
const score = client.scoreTweet('Your tweet text')
const drafts = await client.generateDrafts({ topic: 'AI', tone: 'educational' })MCP Tools
19 tools for AI agents: get_user, search_tweets, post_tweet, score_tweet, generate_drafts, improve_tweet, analyze_post, and more.
REST API
x-agent serve --port 4173
curl http://localhost:4173/v1/health
curl http://localhost:4173/v1/trends
curl -X POST http://localhost:4173/v1/analyze/score -H 'Content-Type: application/json' -d '{"text":"your tweet"}'Phoenix Algorithm
Scores posts against X's 19 engagement signals (favorite, reply, retweet, dwell, click, etc.) with weighted predictions and actionable recommendations.
Talocode ecosystem
Part of Talocode — open-source workflow layers for builders. Explore sibling projects:
Project | What it is |
Screen-aware voice command layer | |
AI chat & assistant | |
Local coding agent | |
MCP gateway & agent tool control plane | |
Context ingestion for persistent agents | |
Persistent agent memory | |
X growth intelligence | |
X reply opportunity intelligence | |
Crawler / SEO intelligence | |
Web extraction to structured data | |
Search layer for agents | |
Invoicing tools | |
Geo intelligence | |
UGC workflows | |
Open-source distribution tools | |
Builder stack platform | |
Trading intelligence | |
Browser automation for agents | |
Org home & control plane | |
Shared agent skills | |
X automation agent (this repo) | |
Launch tooling | |
CAD workflows | |
Work automation | |
Clip / video loops |
MCP-compatible agents integrate via each product's MCP server where available (Model Context Protocol).
More: github.com/talocode · talocode.site · docs.talocode.site
License
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
- FlicenseNot gradedqualityDmaintenanceEnables LLM agents to interact with Twitter (X) for searching tweets, posting content with images, analyzing engagement, and extracting topics using the Twitter API.
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with Twitter/X through Playwright browser automation without requiring an official API key. It provides tools for posting content, searching tweets, reading feeds, and managing social interactions like follows and likes.2MIT
- AlicenseNot gradedqualityDmaintenanceProvides AI agents and coding assistants with Twitter data access including tweets, user profiles, followers, and search functionality.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to interact with X (Twitter) API v2 for posting tweets, searching, liking, retweeting, and more through natural language.MIT
Related MCP Connectors
X (formerly Twitter) posts, profiles, and search for AI agents. Free key, self-minted, no signup.
Twitter/X, Instagram, Reddit & TikTok data for AI agents. Billions of posts. No API keys.
Give your agent live data from Twitter, Reddit, the web and GitHub. No API keys, no scraping stack.
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/talocode/x-agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server