# X Intelligence Mcp (`constant_quadruped/x-intelligence-mcp`) Actor

Real-time Twitter/X intelligence with AI analysis. Search tweets, monitor brands, detect buying intent, compare competitors. Uses Apify scrapers + OpenAI. TOS-compliant alternative to xAI x\_search.

- **URL**: https://apify.com/constant\_quadruped/x-intelligence-mcp.md
- **Developed by:** [CQ](https://apify.com/constant_quadruped) (community)
- **Categories:** Social media, AI, Lead generation
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## X Intelligence MCP Server

Twitter/X content discovery via public search engines. Free demo tool for exploring social media mentions.

### Important Limitations

> **This is a free demo tool with significant limitations.**

| Feature | Status |
|---------|--------|
| Real-time data | No - uses search engine index (hours/days old) |
| Engagement metrics | No - likes, retweets, replies not available |
| Full tweet text | Partial - search engine snippets only |
| Rate limits | Subject to DuckDuckGo rate limits |
| Reliability | Best-effort, may return no results |

**For production use cases requiring real-time Twitter data with engagement metrics, you need:**
- Twitter API Pro ($5,000/month) - [developer.twitter.com](https://developer.twitter.com)
- Or a licensed data provider (Brandwatch, Sprinklr, etc.)

### How It Works

1. **Data Source**: Searches DuckDuckGo for `site:twitter.com` content
2. **AI Analysis**: Optional OpenAI sentiment analysis on results
3. **MCP Protocol**: Exposes tools via Apify's MCP infrastructure

This approach queries publicly indexed Twitter content through search engines - not Twitter's API directly.

### Tools

#### x_search
Search for Twitter content matching a query.

```json
{
  "name": "x_search",
  "arguments": {
    "query": "your search term",
    "max_tweets": 10,
    "analyze": false
  }
}
````

#### x\_monitor

Search for brand mentions with optional AI sentiment analysis.

```json
{
  "name": "x_monitor",
  "arguments": {
    "brand": "Brand Name",
    "max_tweets": 20
  }
}
```

#### x\_intent

Search for buying intent signals (recommendations, frustrations, comparisons).

```json
{
  "name": "x_intent",
  "arguments": {
    "product_category": "CRM software",
    "max_tweets": 15
  }
}
```

#### x\_compete

Compare mentions across 2-5 brands.

```json
{
  "name": "x_compete",
  "arguments": {
    "brands": ["Brand A", "Brand B"],
    "tweets_per_brand": 10
  }
}
```

#### x\_profile

Search for content from a specific Twitter user.

```json
{
  "name": "x_profile",
  "arguments": {
    "username": "username",
    "max_tweets": 10
  }
}
```

#### get\_stats

Get server usage statistics.

### Setup

#### 1. Optional: OpenAI Key for AI Analysis

Without an OpenAI key, you get raw search results only.
With a key, you get sentiment analysis and insights.

Get your key at [platform.openai.com/api-keys](https://platform.openai.com/api-keys)

#### 2. Connect to MCP Client

**Claude Desktop** (`claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "x-intelligence": {
      "url": "https://mcp.apify.com?actors=YOUR_USERNAME/x-intelligence-mcp"
    }
  }
}
```

#### 3. Use It

Ask Claude: "Search Twitter for mentions of Acme Corp"

### Example Output

```json
{
  "success": true,
  "tool": "x_search",
  "query": "Acme Corp",
  "tweet_count": 5,
  "tweets": [
    {
      "text": "Just tried Acme Corp's new product...",
      "author": "someuser",
      "likes": 0,
      "retweets": 0,
      "url": "https://twitter.com/someuser/status/123"
    }
  ]
}
```

Note: Engagement metrics (likes, retweets) are not available through this method.

### Pricing

**Free** - This actor uses public search engines, not paid APIs.

Optional: OpenAI API costs for sentiment analysis (~$0.01-0.05 per analysis).

### When to Use This vs. Alternatives

| Use Case | This Tool | Twitter API Pro |
|----------|-----------|-----------------|
| Quick brand mention check | Yes | Overkill |
| Demo/prototype | Yes | Overkill |
| Real-time monitoring | No | Yes |
| Engagement analytics | No | Yes |
| Historical analysis | No | Yes |
| Production SLA | No | Yes |

### Technical Details

**Data sources tried (in order):**

1. Nitter instances (open-source Twitter frontend) - mostly offline
2. Twitter syndication API - limited availability
3. DuckDuckGo site:twitter.com search - primary working method

**Why not use Twitter's API directly?**

- Free tier: 1,500 tweets/month (insufficient)
- Basic ($100/mo): No commercial redistribution
- Pro ($5,000/mo): Required for production use

### Support

This is a free demo tool provided as-is. For production needs, consider official Twitter API access.

# Actor input Schema

## `apifyToken` (type: `string`):

Your Apify API token for running Twitter scrapers. Leave empty to use platform token (APIFY\_TOKEN). Get your own from Settings > Integrations in Apify Console.

## `openaiApiKey` (type: `string`):

OpenAI API key for AI-powered sentiment analysis and insights. Without this, you get raw tweet data only.

## `openaiModel` (type: `string`):

Which OpenAI model to use for analysis

## `scraperTimeout` (type: `integer`):

Maximum time to wait for Twitter scraper to complete

## `toolCall` (type: `object`):

MCP tool to execute. Leave empty to just get server info, or specify a tool to run.

## Actor input object example

```json
{
  "openaiModel": "gpt-4o-mini",
  "scraperTimeout": 120,
  "toolCall": {
    "name": "x_search",
    "arguments": {
      "query": "AI tools",
      "max_tweets": 5,
      "analyze": false
    }
  }
}
```

# Actor output Schema

## `results` (type: `string`):

MCP tool execution results including tweets, analysis, and statistics

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("constant_quadruped/x-intelligence-mcp").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("constant_quadruped/x-intelligence-mcp").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call constant_quadruped/x-intelligence-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=constant_quadruped/x-intelligence-mcp",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "X Intelligence Mcp",
        "description": "Real-time Twitter/X intelligence with AI analysis. Search tweets, monitor brands, detect buying intent, compare competitors. Uses Apify scrapers + OpenAI. TOS-compliant alternative to xAI x_search.",
        "version": "1.0",
        "x-build-id": "qwXCskYFrgwNctxvz"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/constant_quadruped~x-intelligence-mcp/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-constant_quadruped-x-intelligence-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/constant_quadruped~x-intelligence-mcp/runs": {
            "post": {
                "operationId": "runs-sync-constant_quadruped-x-intelligence-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/constant_quadruped~x-intelligence-mcp/run-sync": {
            "post": {
                "operationId": "run-sync-constant_quadruped-x-intelligence-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "apifyToken": {
                        "title": "Apify API Token",
                        "type": "string",
                        "description": "Your Apify API token for running Twitter scrapers. Leave empty to use platform token (APIFY_TOKEN). Get your own from Settings > Integrations in Apify Console."
                    },
                    "openaiApiKey": {
                        "title": "OpenAI API Key (Optional)",
                        "type": "string",
                        "description": "OpenAI API key for AI-powered sentiment analysis and insights. Without this, you get raw tweet data only."
                    },
                    "openaiModel": {
                        "title": "OpenAI Model",
                        "enum": [
                            "gpt-4o-mini",
                            "gpt-4o",
                            "gpt-4-turbo",
                            "gpt-3.5-turbo"
                        ],
                        "type": "string",
                        "description": "Which OpenAI model to use for analysis",
                        "default": "gpt-4o-mini"
                    },
                    "scraperTimeout": {
                        "title": "Scraper Timeout (seconds)",
                        "minimum": 30,
                        "maximum": 300,
                        "type": "integer",
                        "description": "Maximum time to wait for Twitter scraper to complete",
                        "default": 120
                    },
                    "toolCall": {
                        "title": "Tool Call",
                        "type": "object",
                        "description": "MCP tool to execute. Leave empty to just get server info, or specify a tool to run.",
                        "properties": {
                            "name": {
                                "title": "Tool Name",
                                "type": "string",
                                "description": "Name of the MCP tool to call",
                                "enum": [
                                    "x_search",
                                    "x_monitor",
                                    "x_intent",
                                    "x_compete",
                                    "x_profile",
                                    "get_stats"
                                ]
                            },
                            "arguments": {
                                "title": "Tool Arguments",
                                "type": "object",
                                "description": "Arguments to pass to the tool"
                            }
                        },
                        "default": {
                            "name": "x_search",
                            "arguments": {
                                "query": "AI tools",
                                "max_tweets": 5,
                                "analyze": false
                            }
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
