Skip to main content
Glama
XCROP MCP server

XCROP MCP server

Official
by xcrop-io
README.md
# XCROP MCP server for X (Twitter) data

[![npm](https://img.shields.io/npm/v/@xcrop/mcp)](https://www.npmjs.com/package/@xcrop/mcp) [![license](https://img.shields.io/badge/license-MIT-blue)](LICENSE)

An [MCP](https://modelcontextprotocol.io) server that gives Claude, Cursor, VS Code and other MCP clients read access to public X (Twitter) data through the [XCROP API](https://xcrop.io): profiles, posts, search, followers, trends, and checks for follows, reposts, replies and quotes.

- 14 read-only tools, nothing is ever posted
- Runs on your own XCROP API key, free plan included (10,000 credits a month)
- Zero dependencies, Node.js 18.17 or newer

There are two ways to connect:

| | When to use |
|---|---|
| **Hosted server** `https://xcrop.io/api/mcp` | Your client supports remote MCP servers over HTTP (Claude Code, Claude, ChatGPT, Cursor, VS Code). Nothing to install. Setup: [xcrop.io/mcp](https://xcrop.io/mcp) |
| **This package** `npx -y @xcrop/mcp` | Your client only runs local (stdio) servers, or you prefer the key in an environment variable |

This package is a thin stdio bridge to the hosted server: each message goes to `https://xcrop.io/api/mcp` with your key, so both ways expose the same tools and the tool list is always current.

## Get an API key

Sign up at [xcrop.io](https://xcrop.io) and create a key in the [dashboard](https://xcrop.io/dashboard). Keys start with `xc_live_`.

## Setup

### Claude Code

```bash
claude mcp add xcrop -e XCROP_API_KEY=xc_live_YOUR_KEY -- npx -y @xcrop/mcp
```

### Claude Desktop

Add to `claude_desktop_config.json` (Settings, Developer, Edit Config), then restart Claude:

```json
{
  "mcpServers": {
    "xcrop": {
      "command": "npx",
      "args": ["-y", "@xcrop/mcp"],
      "env": { "XCROP_API_KEY": "xc_live_YOUR_KEY" }
    }
  }
}
```

### Cursor

Add to `~/.cursor/mcp.json` (or `.cursor/mcp.json` in a project):

```json
{
  "mcpServers": {
    "xcrop": {
      "command": "npx",
      "args": ["-y", "@xcrop/mcp"],
      "env": { "XCROP_API_KEY": "xc_live_YOUR_KEY" }
    }
  }
}
```

### VS Code

Add to `.vscode/mcp.json`, then use Copilot Chat in agent mode:

```json
{
  "servers": {
    "xcrop": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@xcrop/mcp"],
      "env": { "XCROP_API_KEY": "xc_live_YOUR_KEY" }
    }
  }
}
```

On Windows, if the client cannot start `npx`, use `"command": "cmd"` with `"args": ["/c", "npx", "-y", "@xcrop/mcp"]`.

## Tools

Every call spends credits from your key; the cost is in each tool's description, so the model sees it too.

| Tool | What it returns | Credits |
|---|---|---|
| `get_user` | Profile: name, bio, followers, following, post count, verification, creation date | 18 |
| `get_user_tweets` | Latest posts of an account | 15 per post |
| `search_tweets` | Post search with X operators (`from:`, `lang:`, `min_faves:`, `since:` ...) | 15 per post |
| `search_users` | Accounts matching a name or keyword | 18 per account |
| `get_tweet` | One post with author, counts and media | 15 |
| `get_tweet_replies` | Replies under a post | 15 per reply |
| `get_tweet_quotes` | Posts quoting a post | 15 per quote |
| `get_tweet_retweeters` | Accounts that reposted a post | 1 per account |
| `get_followers` | Followers of an account | 1 per follower |
| `get_following` | Accounts an account follows | 1 per account |
| `check_follow` | Does account A follow account B (both directions) | 50 |
| `check_interaction` | Did an account repost, reply to or quote a post | 50 |
| `get_trending` | Trending topics, worldwide or by country | 100 |
| `get_credits` | Credits left on your key | free |

List tools take `count` and return `next_cursor`; the model asks for the next page only when it needs it. Prices can change: the server's tool list and [xcrop.io/pricing](https://xcrop.io/pricing) are the reference.

## Example prompts

- "Get the profile of @nasa and its 20 latest posts"
- "Did @alice repost https://x.com/xcropio/status/123... ?"
- "Search posts about 'MCP server' from the last week with at least 50 likes"
- "What is trending in Japan right now?"

## Configuration

| Variable | Default | Meaning |
|---|---|---|
| `XCROP_API_KEY` | none | Your key (`xc_live_...`). Without it the tools answer with setup instructions |
| `XCROP_MCP_URL` | `https://xcrop.io/api/mcp` | Server to forward to |

The key is sent only to `XCROP_MCP_URL`, as an `Authorization: Bearer` header, and is never printed. A URL carrying `?key=xc_live_...` also works: the key is taken out of the URL and sent as the header instead.

## Development

```bash
npm test                      # unit tests, no network
node bin/xcrop-mcp.js         # run the bridge; type JSON-RPC lines on stdin
```

## Links

- MCP setup guide: [xcrop.io/mcp](https://xcrop.io/mcp) and [xcrop.io/docs/mcp-server](https://xcrop.io/docs/mcp-server)
- REST API docs: [xcrop.io/docs](https://xcrop.io/docs)
- SDKs: [JavaScript](https://github.com/xcrop-io/xcrop-js), [Python](https://github.com/xcrop-io/xcrop-python), [Go](https://github.com/xcrop-io/xcrop-go)
- MCP Registry: `io.xcrop/x-data`

## License

MIT