GW X Research MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@GW X Research MCPResearch @sama's threads on AGI from last month"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
GW X Research MCP
This is a read-only ChatGPT MCP tool: GPT handles the conversation with you and does secondary analysis, while Grok retrieves posts and threads from specified X authors via xAI's x_search.
One-click install for macOS + Codex
You need Node.js 20.6+, the Codex CLI, and a valid xAI API Key. Run the single command below; the installer will hide your input, validate the Key, install the service, set up auto-start at login, and register with Codex:
(tmp="$(mktemp)" && trap 'rm -f "$tmp"' EXIT && curl -fsSL --retry 3 -o "$tmp" https://raw.githubusercontent.com/wzh605574547gin/gw-x-research-mcp/a7606e567a8fedfb64126db3554ffdb4279ef2a7/install.sh && echo "b77d2ea593ab97496b00732d78b1877f2e9fd0970f11830e9a298f79a0cef7cb $tmp" | shasum -a 256 -c - && bash "$tmp")The installer verifies its own SHA-256 and validates the source commit corresponding to v1.0.0. After installation, restart Codex and check for gw_x_research with /mcp. It listens on 127.0.0.1 only by default, and the API Key is stored in a local .env file with 0600 permissions — it is never written into the Codex configuration.
If you prefer to review the script first, open install.sh and run the command above after confirming. The v1.0.0 one-click installer supports fresh installs only; it exits safely if an installation directory already exists.
Related MCP server: mcp-x-intelligence
What it can do
Restricts results to 1–20 X accounts, without mixing in posts from other authors.
Searches by topic and start/end dates.
Can analyze images in tweets.
Returns Chinese research reports, links to original posts, and the search scope.
Does not log into your X account, and does not post, like, or follow.
Note:
x_searchis a research-oriented search and is not equivalent to a full export of an account's history. The tool explicitly marks results as not being an exhaustive archive.
Step 1: Prepare an xAI API Key
Open https://console.x.ai/.
Create an API Key and add credits to the API account.
Do not send the Key in chat.
Step 2: Start locally on your Mac
You need Node.js 20.6 or newer. In the terminal, enter this directory and run:
npm install
cp .env.example .envOpen .env and change the line below to your real Key:
XAI_API_KEY=xai-your-api-keyFor your first local test, it is recommended to temporarily delete or comment out MCP_ACCESS_TOKEN in .env, then run:
set -a
source .env
set +a
npm startOpen http://localhost:3000/health in your browser; seeing "ok":true means the service has started.
Step 3: Connect to ChatGPT
For personal use, we recommend the Secure MCP Tunnel, so your xAI Key stays on your Mac and no public server is needed:
In the ChatGPT web version, open "Settings → Security & Login → Developer mode".
Go to ChatGPT Plugins and click the plus sign to create a connection.
Set Connection to Tunnel, and point the Tunnel at your local
http://localhost:3000/mcp.Name it
GW X Research, and after creating it, check whetherresearch_x_authorappears in the tool list.Start a new conversation and select
GW X Researchfrom "+ → Developer mode".
If your account does not have Secure MCP Tunnel yet, you can also deploy the Docker container to an HTTPS-capable platform; however, public deployments must add reliable authentication and rate limiting. Do not expose an unauthenticated /mcp to the public internet, and do not write XAI_API_KEY into code or Docker images.
Ready-to-use question templates
只使用 GW X Research 的 research_x_author 工具。
检索 @博主账号 从 2026-01-01 到今天关于 AVGO 的原创分析推文和线程,深度选择 deep,最多20条。
然后由你做二次分析:
1. 按时间线还原观点变化;
2. 区分事实、推断和预测;
3. 提取最重要的多头与空头论据;
4. 检查前后矛盾;
5. 每项结论附原帖链接;
6. 明确说明搜索是否可能遗漏内容。Tool inputs
Field | Description |
| Array of X accounts, up to 20, with or without |
| Research topic, company, asset, or specific question |
| Optional, format |
| 1–50, default 20 |
|
|
| Simplified Chinese by default |
| Image understanding enabled by default |
Docker
docker build -t gw-x-research-mcp .
export MCP_ACCESS_TOKEN="$(openssl rand -hex 32)"
docker run --rm -p 3000:3000 \
-e XAI_API_KEY="$XAI_API_KEY" \
-e HOST=0.0.0.0 \
-e MCP_ACCESS_TOKEN="$MCP_ACCESS_TOKEN" \
gw-x-research-mcpWhen the container listens on a non-loopback address, the service requires MCP_ACCESS_TOKEN. If you map ports, further control reachability with a firewall, HTTPS reverse proxy, or OAuth; do not expose an unauthenticated endpoint to the public internet.
Local checks
npm run check
npm testUninstall
To uninstall, first remove gw_x_research from Codex, then unload the com.gwcapital.gw-x-research-mcp LaunchAgent; finally delete ~/.local/share/gw-x-research-mcp as needed. .env contains the API Key, so confirm you no longer need it before deleting.
Cost and security
xAI bills Grok tokens and
x_searchtool calls separately.The server reads the Key from environment variables only.
The MCP tool is marked read-only, but content on X may still contain prompt injection; always treat links to original posts as the source of truth for final conclusions.
If deploying to the public internet, use standard OAuth, the ChatGPT Secure MCP Tunnel, or a trusted authentication proxy.
MCP_ACCESS_TOKENis only for clients or proxy tests that support Bearer Token and does not represent a complete multi-user authentication scheme.
This server cannot be deployed
Maintenance
Related MCP Connectors
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
MCP server: AI-agent access to Chinese social & trend signals — Douyin, Weibo, Xiaohongshu/RedNote,
MCP server for GLM chat completions using Zhipu AI models via AceDataCloud
Related MCP Servers
- FlicenseAqualityNot gradedmaintenanceAn MCP server that integrates X (Twitter) API access with Grok-powered intelligence for real-time social media analysis and account management. It provides tools for reading and writing tweets, managing direct messages, and generating AI-powered topic summaries or daily briefings.23-
- FlicenseNot gradedqualityBmaintenanceRead-only X/Twitter research MCP server allowing AI assistants to search viral content, analyze accounts, track trends, and discover niche leaders without requiring the official X API.48-
- AlicenseAqualityDmaintenanceAn MCP server that provides real-time web search and X (Twitter) search capabilities via the xAI API.228MIT
- AlicenseNot gradedqualityFmaintenanceRead-only MCP server for Kan's FxTwitter API proxy, enabling public X/Twitter search and retrieval.MIT