git-to-x-mcp
v0.2.0
Published
MCP server for git-to-x — post to X from Claude Code, Cursor, or any MCP-enabled AI editor
Maintainers
Readme
git-to-x-mcp
MCP server for git-to-x — post tweets to X directly from Claude Code, Cursor, or any MCP-enabled AI editor. No terminal switching, no copy-pasting — just say "tweet this" and the agent posts it via a tool call.
Install
Claude Code
claude mcp add git-to-x -- npx -y git-to-x-mcpCursor / VS Code
Add to ~/.cursor/mcp.json (Cursor) or your editor's MCP config:
{
"mcpServers": {
"git-to-x": {
"command": "npx",
"args": ["-y", "git-to-x-mcp"]
}
}
}Usage
1. Log in (one-time)
In the AI chat panel, run the login tool:
"Log in to git-to-x"
A browser tab opens. Approve the request. Done — token is saved to ~/.config/g2x/token (shared with the g2x CLI, so if you already ran g2x login, you're ready with no extra steps).
2. Tweet from chat
"tweet this: shipped dark mode today — link: https://git-to-x.com"
"post to X: Day 42 of building in public — closed 8 issues, 3 PRs merged"
The agent calls post_tweet and shows you the tweet ID plus remaining quota.
3. Check quota
"how many tweets do I have left this month?"
The agent calls check_quota and shows text/link posts remaining in the current 30-day window.
Tools
| Tool | Description |
|------|-------------|
| post_tweet | Post a text tweet (up to 280 chars). Returns tweet ID + remaining quota. |
| check_quota | Show remaining text/link post quota for this 30-day period. Read-only. |
| login | Browser-based auth (device flow). Saves token to ~/.config/g2x/token. |
Headless / remote environments
For SSH, Codespaces, or any browserless setup:
- Go to git-to-x.com/settings and generate an editor token under "Connected terminals".
- Set it as an env var in your editor's MCP config:
{
"mcpServers": {
"git-to-x": {
"command": "npx",
"args": ["-y", "git-to-x-mcp"],
"env": {
"GIT_TO_X_TOKEN": "your-token-here"
}
}
}
}The GIT_TO_X_TOKEN env var takes precedence over the token file.
Requirements
- Node.js 18+
- A git-to-x account (free or paid) at git-to-x.com
- Paid/trial plan for
post_tweet(free tier: dashboard posts only; CLI/MCP is a paid feature)
License
MIT
