MCP setup
Connect the OpenTweet MCP server to your AI agent and it gets all 36 tools to post, schedule, thread, and analyze on X (Twitter). This is the config reference. Works with Claude Code, Codex, Cursor, Windsurf, ChatGPT, OpenClaw, Hermes, and any MCP client. Grab an ot_ key from your developer dashboard first.
Two ways to run it
The hosted server is a URL you paste in, nothing to install. The local server runs on your machine over stdio throughnpx. Both expose the same 36 tools. Use the hosted one unless you need to run offline or self-host.1. Hosted server (recommended)
Point any MCP client at the hosted endpoint over the streamable-http transport and send your key in the Authorization header. No install, no local process to keep running.
{
"mcpServers": {
"opentweet": {
"type": "streamable-http",
"url": "https://mcp.opentweet.io/mcp",
"headers": { "Authorization": "Bearer ot_your_key" }
}
}
}Replace ot_your_key with your real key. That is the only value you change.
2. Local server
Prefer to run it yourself? The local server launches over stdio with npx. Pass your key as the OPENTWEET_API_KEY env var instead of a header.
{
"mcpServers": {
"opentweet": {
"command": "npx",
"args": ["-y", "@opentweet/mcp-server"],
"env": { "OPENTWEET_API_KEY": "ot_your_key" }
}
}
}The -y flag lets npx fetch @opentweet/mcp-server without a prompt. Node 18 or newer is required.
3. Per-client config
Each client keeps its MCP config in a slightly different place with a slightly different key name. Drop the matching block below into that file.
Claude Desktop and Claude Code
Add it to claude_desktop_config.json (Desktop) or run claude mcp add (Claude Code), then restart the app.
{
"mcpServers": {
"opentweet": {
"type": "streamable-http",
"url": "https://mcp.opentweet.io/mcp",
"headers": { "Authorization": "Bearer ot_your_key" }
}
}
}Cursor
Add it to ~/.cursor/mcp.json (global) or .cursor/mcp.json in your project, then reload the window.
{
"mcpServers": {
"opentweet": {
"url": "https://mcp.opentweet.io/mcp",
"headers": { "Authorization": "Bearer ot_your_key" }
}
}
}Windsurf
Add it to ~/.codeium/windsurf/mcp_config.json, then refresh servers in Cascade. Windsurf uses serverUrl for the endpoint.
{
"mcpServers": {
"opentweet": {
"serverUrl": "https://mcp.opentweet.io/mcp",
"headers": { "Authorization": "Bearer ot_your_key" }
}
}
}Any other MCP client
Codex, ChatGPT, OpenClaw, Hermes, and any other MCP client need the same values. Give them either the hosted URL and header, or the local command and env.
# Hosted server (nothing to install)
url: https://mcp.opentweet.io/mcp
transport: streamable-http
header: Authorization: Bearer ot_your_key
# Local server (stdio)
command: npx
args: -y @opentweet/mcp-server
env: OPENTWEET_API_KEY=ot_your_key4. Verify the tools appear
Restart or reload your client after editing the config. Open the client's MCP or tools panel and confirm the opentweet server is connected and lists 36 tools, such as opentweet_create_tweet, opentweet_schedule_tweet, and opentweet_get_analytics. Then ask your agent something like "post a tweet that says hello from MCP" to confirm end to end.
Quick sanity check
Ask your agent to callopentweet_list_tweets. If it returns your posts, the key and connection are both good. The full list is in the MCP tools reference.Troubleshooting
Server not connecting or tools missing
- 401 or auth errors: the key must start with
ot_and be sent asAuthorization: Bearer ot_your_key(hosted) orOPENTWEET_API_KEY(local). Verify it withGET https://opentweet.io/api/v1/me. - Wrong URL: the endpoint is
https://mcp.opentweet.io/mcp. The hostapi.opentweet.iodoes not resolve, do not use it. - Local server won't start: confirm Node 18+ is installed and that
npx -y @opentweet/mcp-serverruns in your terminal. - Tools still missing: fully quit and reopen the client. Some clients cache MCP config and need a restart, not just a window reload.
- No posting access: scheduling and publishing require an active subscription. Check
subscription.has_accessin the/meresponse.
Next steps
- • MCP tools reference: every one of the 36 tools your agent can call, with parameters.
- • Quickstart: post your first tweet in three minutes via REST, MCP, or the CLI.
- • MCP overview: what the OpenTweet MCP server does and why to use it.