X Algorithm Toolkit

X Algorithm Toolkit

Tweet scoring using X's actual algorithm weights - 22 signals, 18 filters, 11 tools

Category
Visit Server

README

⚔ X Algorithm Toolkit

Score, optimize, and generate tweets using the actual signal weights from X's open-source recommendation algorithm.

npm Built with React TypeScript License: MIT

🧠 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 dev

Open 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-mcp

Option 3: From Source

cd mcp && npm install && npm run build

11 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.md

What'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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured