# docs / mcp

git-to-x MCP — post to X from Cursor & Claude Code

Post to X without leaving your AI editor. Say “tweet this: shipped dark mode 🌙” in chat — the MCP server handles authentication, quota, and posting.

Claude Code

claude mcp add git-to-x -- npx -y git-to-x-mcp

Cursor / VS Code

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "git-to-x": {
      "command": "npx",
      "args": ["-y", "git-to-x-mcp"]
    }
  }
}

Log in once

In chat, say “log in to git-to-x” → a browser tab opens → click Approve. Your editor is now linked to your git-to-x account. No X API keys required.

Already ran g2x login? You're ready — MCP shares auth with the CLI.

Use it

In chat, tell the AI what to post:

tweet this: shipped dark mode 🌙

Pro quota applies: 50 text + 5 link tweets per month, enforced server-side before posting. Remaining counts are shown after each post.

Headless / remote (SSH, Codespaces)

No browser available for the OAuth flow? Generate an editor token in Settings and paste it into your MCP config as an env var:

{
  "mcpServers": {
    "git-to-x": {
      "command": "npx",
      "args": ["-y", "git-to-x-mcp"],
      "env": {
        "GIT_TO_X_TOKEN": "your-editor-token-here"
      }
    }
  }
}

Generate the token in Settings → Connected terminals. Copy it once — it won't be shown again.

Prefer a plain terminal instead of your editor? Use the g2x CLI →

Start free →