x-algorithm-toolkit
Score, optimize & generate tweets using X's actual algorithm weights. 13-tab React app + MCP server + AI Skill.
Documentation
โก X Algorithm Toolkit
> Score, optimize, and generate tweets using the actual signal weights from X's open-source recommendation algorithm.
๐ง What This Does
This toolkit reverse-engineers X's recommendation algorithm from the open-source codebase and gives you:
- Tweet Scorer โ Score any draft (0-100) against the actual algorithm weights
- Hook Analyzer โ Test your opening line against the -11ร `not_dwelled` penalty
- Diversity Calculator โ Plan posting cadence using the decay formula from `author_diversity_scorer.rs`
- 18 Filter Checker โ Run tweets through quality/safety gates
- AI Rewrite, Generate & Thread Builder โ Multi-provider AI (Groq, Gemini, OpenAI, Claude)
- Draft Manager, Compare Mode, Score History โ Full workflow tools
- Export Scorecard โ Branded PNG downloads
๐ The 22 Algorithm Signals
From `weighted_scorer.rs` + `ranking_scorer.rs`:
| Signal | Weight | What It Means |
|---|---|---|
| Reply | 27.0ร | #1 signal โ end every post with a question |
| Bookmark | 10.0ร | Save-worthy content gets massive boost |
| Follow | 4.0ร | "I want more" โ the career signal |
| Dwell (Binary) | 2.0ร | Multi-line posts earn more read time |
| Cont. Dwell Time | 1.5ร | Longer reads score higher |
| Click-Dwell Time | 1.5ร | Deep interest after expanding |
| Report | -369ร | Nuclear penalty โ content becomes invisible |
| Not Interested | -74ร | Off-topic = algorithmic death |
| Scrolled Past | -11ร | Weak hooks trigger this |
*+ 13 more signals (Like, Repost, Quote, Quoted Click, Share, DM Share, Copy Link, Click, Profile Click, Photo Expand, Video Quality View)*
๐ Quick Start
# Clone
git clone https://github.com/MrChartist/x-algorithm-toolkit.git
cd x-algorithm-toolkit
# Install & Run
npm install
npm run devOpen `http://localhost:5173` โ no API key needed for scoring, filters, and analysis.
For AI features (Rewrite, Generate, Thread), add an API key in Settings (Groq free tier recommended).
๐ง MCP Server (npm)
Install the MCP server to connect the algorithm engine to any AI assistant:
Option 1: Via npx (Recommended)
Add to `claude_desktop_config.json`:
{
"mcpServers": {
"x-algorithm": {
"command": "npx",
"args": ["-y", "x-algorithm-mcp"]
}
}
}Option 2: Global Install
npm install -g x-algorithm-mcpOption 3: From Source
cd mcp && npm install && npm run build11 Tools: `score_tweet`, `check_filters`, `analyze_hook`, `get_signals`, `get_optimal_schedule`, `compare_tweets`, `detect_spam_patterns`, `diversity_penalty`, `classify_niche`, `get_thread_strategy`, `full_audit`
3 Resources: `x-algorithm://weights`, `x-algorithm://filters`, `x-algorithm://niches`
๐ฏ AI Skill (Antigravity / Gemini CLI)
400+ lines of domain expertise that makes any AI an X algorithm expert:
Install Globally
mkdir -p ~/.gemini/antigravity/skills/x-algorithm-expert
curl -o ~/.gemini/antigravity/skills/x-algorithm-expert/SKILL.md \
https://raw.githubusercontent.com/MrChartist/x-algorithm-toolkit/master/skill/SKILL.mdWhat's Covered:
- All 22 signal weights with optimization strategies
- Phoenix Grok-based transformer architecture
- 77+ topic categories from `topic_ids_filter.rs`
- 10-point scoring system with letter grades
- Hook writing rules and 7 templates
- Author diversity decay formula
- OON viral mechanics
- Thread building strategy (6 templates)
- 18 safety filter checklist
- Niche-specific optimization (7 niches)
๐ Architecture
x-algo-toolkit/
โโโ src/ # React Web App (13 tabs)
โ โโโ engine/ # Scoring engine + AI abstraction
โ โโโ components/ # 15 UI components
โโโ mcp/ # MCP Server (11 tools, 3 resources)
โ โโโ src/ # TypeScript source
โ โโโ dist/ # Compiled output
โ โโโ package.json # npm: x-algorithm-mcp
โโโ skill/ # AI Skill
โ โโโ SKILL.md # 400+ line expertise file
โโโ public/ # Static assets๐ ๏ธ Tech Stack
- Frontend: React 19, TypeScript, Vite
- Animations: Framer Motion
- AI: Multi-provider (Groq/Gemini/OpenAI/Claude)
- MCP: `@modelcontextprotocol/sdk` v1.12+
- Storage: localStorage (no backend needed)
๐ License
MIT โ Built by @Mr_Chartist
*Data sourced from X's open-source algorithm: `weighted_scorer.rs`, `ranking_scorer.rs`, `author_diversity_scorer.rs`, `oon_scorer.rs`, `topic_ids_filter.rs`, `recsys_model.py`*
Frequently asked questions
What is x-algorithm-toolkit?
x-algorithm-toolkit is Score, optimize & generate tweets using X's actual algorithm weights. 13-tab React app + MCP server + AI Skill.
How do I install x-algorithm-toolkit?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is x-algorithm-toolkit open source?
Yes โ it is hosted on GitHub at https://github.com/MrChartist/x-algorithm-toolkit.
Related MCP tools
Model Context Protocol Servers
The Open-Source Multimodal AI Agent Stack: Connecting Cutting-Edge AI Models and Agent Infra
A MCP for Claude Desktop / Claude Code / Windsurf / Cursor to build n8n workflows for you
MCP server to provide Figma layout information to AI coding agents like Cursor
The world's best AI personal assistant for email. Open source app to help you reach inbox zero fast.
Instant is the best backend for AI-coded apps. You get auth, permissions, storage, presence, and streams โ everything you need to ship apps your users will love.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP