X (Twitter)
Search, read and publish X posts and manage users, lists and media via the X API v2.
- Pricing
- Open source
- Runs
- Locally
- Version
- 0.1.1
- Listing updated
- 5 days ago
About X (Twitter)
X (Twitter) is an open-source MCP server. It runs locally on your machine and is started by your AI client.
Install
Run in a terminal
claude mcp add mcp-x --env X_API_KEY='<X_API_KEY>' --env X_API_KEY_SECRET='<X_API_KEY_SECRET>' --env X_ACCESS_TOKEN='<X_ACCESS_TOKEN>' --env X_ACCESS_TOKEN_SECRET='<X_ACCESS_TOKEN_SECRET>' --env MEDIA_ROOT='<MEDIA_ROOT>' -- docker run -i --rm -e X_API_KEY -e X_API_KEY_SECRET -e X_ACCESS_TOKEN -e X_ACCESS_TOKEN_SECRET -e MEDIA_ROOT ghcr.io/role1776/mcp-x:0.1.1Add to claude_desktop_config.json
{
"mcpServers": {
"mcp-x": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"X_API_KEY",
"-e",
"X_API_KEY_SECRET",
"-e",
"X_ACCESS_TOKEN",
"-e",
"X_ACCESS_TOKEN_SECRET",
"-e",
"MEDIA_ROOT",
"ghcr.io/role1776/mcp-x:0.1.1"
],
"env": {
"X_API_KEY": "<X_API_KEY>",
"X_API_KEY_SECRET": "<X_API_KEY_SECRET>",
"X_ACCESS_TOKEN": "<X_ACCESS_TOKEN>",
"X_ACCESS_TOKEN_SECRET": "<X_ACCESS_TOKEN_SECRET>",
"MEDIA_ROOT": "<MEDIA_ROOT>"
}
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"mcp-x": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"X_API_KEY",
"-e",
"X_API_KEY_SECRET",
"-e",
"X_ACCESS_TOKEN",
"-e",
"X_ACCESS_TOKEN_SECRET",
"-e",
"MEDIA_ROOT",
"ghcr.io/role1776/mcp-x:0.1.1"
],
"env": {
"X_API_KEY": "<X_API_KEY>",
"X_API_KEY_SECRET": "<X_API_KEY_SECRET>",
"X_ACCESS_TOKEN": "<X_ACCESS_TOKEN>",
"X_ACCESS_TOKEN_SECRET": "<X_ACCESS_TOKEN_SECRET>",
"MEDIA_ROOT": "<MEDIA_ROOT>"
}
}
}
}Add to .vscode/mcp.json
{
"servers": {
"mcp-x": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"X_API_KEY",
"-e",
"X_API_KEY_SECRET",
"-e",
"X_ACCESS_TOKEN",
"-e",
"X_ACCESS_TOKEN_SECRET",
"-e",
"MEDIA_ROOT",
"ghcr.io/role1776/mcp-x:0.1.1"
],
"env": {
"X_API_KEY": "<X_API_KEY>",
"X_API_KEY_SECRET": "<X_API_KEY_SECRET>",
"X_ACCESS_TOKEN": "<X_ACCESS_TOKEN>",
"X_ACCESS_TOKEN_SECRET": "<X_ACCESS_TOKEN_SECRET>",
"MEDIA_ROOT": "<MEDIA_ROOT>"
}
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mcp-x": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"X_API_KEY",
"-e",
"X_API_KEY_SECRET",
"-e",
"X_ACCESS_TOKEN",
"-e",
"X_ACCESS_TOKEN_SECRET",
"-e",
"MEDIA_ROOT",
"ghcr.io/role1776/mcp-x:0.1.1"
],
"env": {
"X_API_KEY": "<X_API_KEY>",
"X_API_KEY_SECRET": "<X_API_KEY_SECRET>",
"X_ACCESS_TOKEN": "<X_ACCESS_TOKEN>",
"X_ACCESS_TOKEN_SECRET": "<X_ACCESS_TOKEN_SECRET>",
"MEDIA_ROOT": "<MEDIA_ROOT>"
}
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"mcp-x": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"X_API_KEY",
"-e",
"X_API_KEY_SECRET",
"-e",
"X_ACCESS_TOKEN",
"-e",
"X_ACCESS_TOKEN_SECRET",
"-e",
"MEDIA_ROOT",
"ghcr.io/role1776/mcp-x:0.1.1"
],
"env": {
"X_API_KEY": "<X_API_KEY>",
"X_API_KEY_SECRET": "<X_API_KEY_SECRET>",
"X_ACCESS_TOKEN": "<X_ACCESS_TOKEN>",
"X_ACCESS_TOKEN_SECRET": "<X_ACCESS_TOKEN_SECRET>",
"MEDIA_ROOT": "<MEDIA_ROOT>"
}
}
}
}Using several servers? Build one config file with the MCP config generator.
Configuration
X_API_KEYOAuth 1.0a consumer key. developer.x.com -> your project -> your app -> Keys and tokens.RequiredX_API_KEY_SECRETOAuth 1.0a consumer secret, issued together with X_API_KEY.RequiredX_ACCESS_TOKENUser access token. Set the app permissions to Read and Write BEFORE generating it: a token keeps the permissions it was created with, and a read-only one fails every write until it is regenerated.RequiredX_ACCESS_TOKEN_SECRETUser access token secret, issued together with X_ACCESS_TOKEN.RequiredMEDIA_ROOTAbsolute path to an existing directory - the only one x_media_upload may read files from. Anything outside it is refused, symlinks included. Checked at startup.RequiredMCP_TRANSPORTstdio (client spawns the process) or http (streamable HTTP listener).MCP_NAMEServer name reported in the MCP initialize handshake.MCP_PATHHTTP path the MCP endpoint is served on. Used only when MCP_TRANSPORT=http.SERVER_PORTTCP port to listen on. Used only when MCP_TRANSPORT=http.SERVER_READ_TIMEOUTHTTP read timeout as a Go duration. Used only when MCP_TRANSPORT=http.SERVER_WRITE_TIMEOUTHTTP write timeout as a Go duration. Used only when MCP_TRANSPORT=http.LOG_MODElocal (text, debug) or prod (JSON, info). Logs go to stderr.MAX_IDLE_CONNS_PER_HOSTIdle connections the outbound HTTP client keeps per host.X_DEBUGLog the raw requests sent to the X API. Verbose; the output can contain request details, so keep it off outside debugging.POSTS_MAX_QUERIESQueries accepted in one x_posts_search or x_posts_count call.POSTS_MAX_USERNAMESUsernames accepted in one x_posts_by_user call.POSTS_MAX_IDSPost ids accepted in one x_posts_lookup call. The X API caps this at 100.POSTS_DEFAULT_RESULTSPosts returned per query when the call does not ask for a count. Every post returned is billed.POSTS_MAX_RESULTSUpper bound for posts per query. The X API caps this at 100.POSTS_DEFAULT_DAYSHow far back post searches look when the call does not say, in days.POSTS_MAX_DAYSFurthest back a post search may look, in days. Recent search cannot exceed 7.POSTS_DEFAULT_TIMEOUT_MSTimeout for a posts call in milliseconds when the call does not request one.POSTS_MIN_TIMEOUT_MSLowest timeout a posts call may request, in milliseconds.POSTS_MAX_TIMEOUT_MSHighest timeout a posts call may request, in milliseconds.USERS_MAX_USERNAMESUsernames accepted in one x_users_lookup call. The X API caps this at 100.USERS_MAX_IDSUser ids accepted in one x_users_lookup call. The X API caps this at 100.USERS_DEFAULT_RESULTSUsers returned per page when the call does not ask for a count.USERS_MAX_RESULTSUpper bound for users per page.USERS_DEFAULT_TIMEOUT_MSTimeout for a users call in milliseconds when the call does not request one.USERS_MIN_TIMEOUT_MSLowest timeout a users call may request, in milliseconds.USERS_MAX_TIMEOUT_MSHighest timeout a users call may request, in milliseconds.LISTS_DEFAULT_RESULTSItems returned per list page when the call does not ask for a count.LISTS_MAX_RESULTSUpper bound for items per list page. The X API caps this at 100.LISTS_DEFAULT_TIMEOUT_MSTimeout for a lists call in milliseconds when the call does not request one.LISTS_MIN_TIMEOUT_MSLowest timeout a lists call may request, in milliseconds.LISTS_MAX_TIMEOUT_MSHighest timeout a lists call may request, in milliseconds.MEDIA_CHUNK_BYTESBytes per upload segment. The X APPEND endpoint caps a segment at 5 MB.MEDIA_POLL_INTERVAL_MSHow often the upload status is polled while X transcodes a video, in milliseconds.MEDIA_DEFAULT_TIMEOUT_MSTimeout for a whole upload in milliseconds when the call does not request one.MEDIA_MIN_TIMEOUT_MSLowest timeout an upload may request, in milliseconds.MEDIA_MAX_TIMEOUT_MSHighest timeout an upload may request, in milliseconds.X_API_KEYOAuth 1.0a consumer key. developer.x.com -> your project -> your app -> Keys and tokens.RequiredX_API_KEY_SECRETOAuth 1.0a consumer secret, issued together with X_API_KEY.RequiredX_ACCESS_TOKENUser access token. Set the app permissions to Read and Write BEFORE generating it: a token keeps the permissions it was created with, and a read-only one fails every write until it is regenerated.RequiredX_ACCESS_TOKEN_SECRETUser access token secret, issued together with X_ACCESS_TOKEN.RequiredMEDIA_ROOTAbsolute path to an existing directory - the only one x_media_upload may read files from. Anything outside it is refused, symlinks included. Checked at startup.RequiredMCP_TRANSPORTstdio (client spawns the process) or http (streamable HTTP listener).MCP_NAMEServer name reported in the MCP initialize handshake.MCP_PATHHTTP path the MCP endpoint is served on. Used only when MCP_TRANSPORT=http.SERVER_PORTTCP port to listen on. Used only when MCP_TRANSPORT=http.SERVER_READ_TIMEOUTHTTP read timeout as a Go duration. Used only when MCP_TRANSPORT=http.SERVER_WRITE_TIMEOUTHTTP write timeout as a Go duration. Used only when MCP_TRANSPORT=http.LOG_MODElocal (text, debug) or prod (JSON, info). Logs go to stderr.MAX_IDLE_CONNS_PER_HOSTIdle connections the outbound HTTP client keeps per host.X_DEBUGLog the raw requests sent to the X API. Verbose; the output can contain request details, so keep it off outside debugging.POSTS_MAX_QUERIESQueries accepted in one x_posts_search or x_posts_count call.POSTS_MAX_USERNAMESUsernames accepted in one x_posts_by_user call.POSTS_MAX_IDSPost ids accepted in one x_posts_lookup call. The X API caps this at 100.POSTS_DEFAULT_RESULTSPosts returned per query when the call does not ask for a count. Every post returned is billed.POSTS_MAX_RESULTSUpper bound for posts per query. The X API caps this at 100.POSTS_DEFAULT_DAYSHow far back post searches look when the call does not say, in days.POSTS_MAX_DAYSFurthest back a post search may look, in days. Recent search cannot exceed 7.POSTS_DEFAULT_TIMEOUT_MSTimeout for a posts call in milliseconds when the call does not request one.POSTS_MIN_TIMEOUT_MSLowest timeout a posts call may request, in milliseconds.POSTS_MAX_TIMEOUT_MSHighest timeout a posts call may request, in milliseconds.USERS_MAX_USERNAMESUsernames accepted in one x_users_lookup call. The X API caps this at 100.USERS_MAX_IDSUser ids accepted in one x_users_lookup call. The X API caps this at 100.USERS_DEFAULT_RESULTSUsers returned per page when the call does not ask for a count.USERS_MAX_RESULTSUpper bound for users per page.USERS_DEFAULT_TIMEOUT_MSTimeout for a users call in milliseconds when the call does not request one.USERS_MIN_TIMEOUT_MSLowest timeout a users call may request, in milliseconds.USERS_MAX_TIMEOUT_MSHighest timeout a users call may request, in milliseconds.LISTS_DEFAULT_RESULTSItems returned per list page when the call does not ask for a count.LISTS_MAX_RESULTSUpper bound for items per list page. The X API caps this at 100.LISTS_DEFAULT_TIMEOUT_MSTimeout for a lists call in milliseconds when the call does not request one.LISTS_MIN_TIMEOUT_MSLowest timeout a lists call may request, in milliseconds.LISTS_MAX_TIMEOUT_MSHighest timeout a lists call may request, in milliseconds.MEDIA_CHUNK_BYTESBytes per upload segment. The X APPEND endpoint caps a segment at 5 MB.MEDIA_POLL_INTERVAL_MSHow often the upload status is polled while X transcodes a video, in milliseconds.MEDIA_DEFAULT_TIMEOUT_MSTimeout for a whole upload in milliseconds when the call does not request one.MEDIA_MIN_TIMEOUT_MSLowest timeout an upload may request, in milliseconds.MEDIA_MAX_TIMEOUT_MSHighest timeout an upload may request, in milliseconds.X_API_KEYOAuth 1.0a consumer key. developer.x.com -> your project -> your app -> Keys and tokens.RequiredX_API_KEY_SECRETOAuth 1.0a consumer secret, issued together with X_API_KEY.RequiredX_ACCESS_TOKENUser access token. Set the app permissions to Read and Write BEFORE generating it: a token keeps the permissions it was created with, and a read-only one fails every write until it is regenerated.RequiredX_ACCESS_TOKEN_SECRETUser access token secret, issued together with X_ACCESS_TOKEN.RequiredMEDIA_ROOTAbsolute path to an existing directory - the only one x_media_upload may read files from. Anything outside it is refused, symlinks included. Checked at startup.RequiredMCP_TRANSPORTstdio (client spawns the process) or http (streamable HTTP listener).MCP_NAMEServer name reported in the MCP initialize handshake.MCP_PATHHTTP path the MCP endpoint is served on. Used only when MCP_TRANSPORT=http.SERVER_PORTTCP port to listen on. Used only when MCP_TRANSPORT=http.SERVER_READ_TIMEOUTHTTP read timeout as a Go duration. Used only when MCP_TRANSPORT=http.SERVER_WRITE_TIMEOUTHTTP write timeout as a Go duration. Used only when MCP_TRANSPORT=http.LOG_MODElocal (text, debug) or prod (JSON, info). Logs go to stderr.MAX_IDLE_CONNS_PER_HOSTIdle connections the outbound HTTP client keeps per host.X_DEBUGLog the raw requests sent to the X API. Verbose; the output can contain request details, so keep it off outside debugging.POSTS_MAX_QUERIESQueries accepted in one x_posts_search or x_posts_count call.POSTS_MAX_USERNAMESUsernames accepted in one x_posts_by_user call.POSTS_MAX_IDSPost ids accepted in one x_posts_lookup call. The X API caps this at 100.POSTS_DEFAULT_RESULTSPosts returned per query when the call does not ask for a count. Every post returned is billed.POSTS_MAX_RESULTSUpper bound for posts per query. The X API caps this at 100.POSTS_DEFAULT_DAYSHow far back post searches look when the call does not say, in days.POSTS_MAX_DAYSFurthest back a post search may look, in days. Recent search cannot exceed 7.POSTS_DEFAULT_TIMEOUT_MSTimeout for a posts call in milliseconds when the call does not request one.POSTS_MIN_TIMEOUT_MSLowest timeout a posts call may request, in milliseconds.POSTS_MAX_TIMEOUT_MSHighest timeout a posts call may request, in milliseconds.USERS_MAX_USERNAMESUsernames accepted in one x_users_lookup call. The X API caps this at 100.USERS_MAX_IDSUser ids accepted in one x_users_lookup call. The X API caps this at 100.USERS_DEFAULT_RESULTSUsers returned per page when the call does not ask for a count.USERS_MAX_RESULTSUpper bound for users per page.USERS_DEFAULT_TIMEOUT_MSTimeout for a users call in milliseconds when the call does not request one.USERS_MIN_TIMEOUT_MSLowest timeout a users call may request, in milliseconds.USERS_MAX_TIMEOUT_MSHighest timeout a users call may request, in milliseconds.LISTS_DEFAULT_RESULTSItems returned per list page when the call does not ask for a count.LISTS_MAX_RESULTSUpper bound for items per list page. The X API caps this at 100.LISTS_DEFAULT_TIMEOUT_MSTimeout for a lists call in milliseconds when the call does not request one.LISTS_MIN_TIMEOUT_MSLowest timeout a lists call may request, in milliseconds.LISTS_MAX_TIMEOUT_MSHighest timeout a lists call may request, in milliseconds.MEDIA_CHUNK_BYTESBytes per upload segment. The X APPEND endpoint caps a segment at 5 MB.MEDIA_POLL_INTERVAL_MSHow often the upload status is polled while X transcodes a video, in milliseconds.MEDIA_DEFAULT_TIMEOUT_MSTimeout for a whole upload in milliseconds when the call does not request one.MEDIA_MIN_TIMEOUT_MSLowest timeout an upload may request, in milliseconds.MEDIA_MAX_TIMEOUT_MSHighest timeout an upload may request, in milliseconds.X_API_KEYOAuth 1.0a consumer key. developer.x.com -> your project -> your app -> Keys and tokens.RequiredX_API_KEY_SECRETOAuth 1.0a consumer secret, issued together with X_API_KEY.RequiredX_ACCESS_TOKENUser access token. Set the app permissions to Read and Write BEFORE generating it: a token keeps the permissions it was created with, and a read-only one fails every write until it is regenerated.RequiredX_ACCESS_TOKEN_SECRETUser access token secret, issued together with X_ACCESS_TOKEN.RequiredMEDIA_ROOTAbsolute path to an existing directory - the only one x_media_upload may read files from. Anything outside it is refused, symlinks included. Checked at startup.RequiredMCP_TRANSPORTstdio (client spawns the process) or http (streamable HTTP listener).MCP_NAMEServer name reported in the MCP initialize handshake.MCP_PATHHTTP path the MCP endpoint is served on. Used only when MCP_TRANSPORT=http.SERVER_PORTTCP port to listen on. Used only when MCP_TRANSPORT=http.SERVER_READ_TIMEOUTHTTP read timeout as a Go duration. Used only when MCP_TRANSPORT=http.SERVER_WRITE_TIMEOUTHTTP write timeout as a Go duration. Used only when MCP_TRANSPORT=http.LOG_MODElocal (text, debug) or prod (JSON, info). Logs go to stderr.MAX_IDLE_CONNS_PER_HOSTIdle connections the outbound HTTP client keeps per host.X_DEBUGLog the raw requests sent to the X API. Verbose; the output can contain request details, so keep it off outside debugging.POSTS_MAX_QUERIESQueries accepted in one x_posts_search or x_posts_count call.POSTS_MAX_USERNAMESUsernames accepted in one x_posts_by_user call.POSTS_MAX_IDSPost ids accepted in one x_posts_lookup call. The X API caps this at 100.POSTS_DEFAULT_RESULTSPosts returned per query when the call does not ask for a count. Every post returned is billed.POSTS_MAX_RESULTSUpper bound for posts per query. The X API caps this at 100.POSTS_DEFAULT_DAYSHow far back post searches look when the call does not say, in days.POSTS_MAX_DAYSFurthest back a post search may look, in days. Recent search cannot exceed 7.POSTS_DEFAULT_TIMEOUT_MSTimeout for a posts call in milliseconds when the call does not request one.POSTS_MIN_TIMEOUT_MSLowest timeout a posts call may request, in milliseconds.POSTS_MAX_TIMEOUT_MSHighest timeout a posts call may request, in milliseconds.USERS_MAX_USERNAMESUsernames accepted in one x_users_lookup call. The X API caps this at 100.USERS_MAX_IDSUser ids accepted in one x_users_lookup call. The X API caps this at 100.USERS_DEFAULT_RESULTSUsers returned per page when the call does not ask for a count.USERS_MAX_RESULTSUpper bound for users per page.USERS_DEFAULT_TIMEOUT_MSTimeout for a users call in milliseconds when the call does not request one.USERS_MIN_TIMEOUT_MSLowest timeout a users call may request, in milliseconds.USERS_MAX_TIMEOUT_MSHighest timeout a users call may request, in milliseconds.LISTS_DEFAULT_RESULTSItems returned per list page when the call does not ask for a count.LISTS_MAX_RESULTSUpper bound for items per list page. The X API caps this at 100.LISTS_DEFAULT_TIMEOUT_MSTimeout for a lists call in milliseconds when the call does not request one.LISTS_MIN_TIMEOUT_MSLowest timeout a lists call may request, in milliseconds.LISTS_MAX_TIMEOUT_MSHighest timeout a lists call may request, in milliseconds.MEDIA_CHUNK_BYTESBytes per upload segment. The X APPEND endpoint caps a segment at 5 MB.MEDIA_POLL_INTERVAL_MSHow often the upload status is polled while X transcodes a video, in milliseconds.MEDIA_DEFAULT_TIMEOUT_MSTimeout for a whole upload in milliseconds when the call does not request one.MEDIA_MIN_TIMEOUT_MSLowest timeout an upload may request, in milliseconds.MEDIA_MAX_TIMEOUT_MSHighest timeout an upload may request, in milliseconds.X_API_KEYOAuth 1.0a consumer key. developer.x.com -> your project -> your app -> Keys and tokens.RequiredX_API_KEY_SECRETOAuth 1.0a consumer secret, issued together with X_API_KEY.RequiredX_ACCESS_TOKENUser access token. Set the app permissions to Read and Write BEFORE generating it: a token keeps the permissions it was created with, and a read-only one fails every write until it is regenerated.RequiredX_ACCESS_TOKEN_SECRETUser access token secret, issued together with X_ACCESS_TOKEN.RequiredMEDIA_ROOTAbsolute path to an existing directory - the only one x_media_upload may read files from. Anything outside it is refused, symlinks included. Checked at startup.RequiredMCP_TRANSPORTstdio (client spawns the process) or http (streamable HTTP listener).MCP_NAMEServer name reported in the MCP initialize handshake.MCP_PATHHTTP path the MCP endpoint is served on. Used only when MCP_TRANSPORT=http.SERVER_PORTTCP port to listen on. Used only when MCP_TRANSPORT=http.SERVER_READ_TIMEOUTHTTP read timeout as a Go duration. Used only when MCP_TRANSPORT=http.SERVER_WRITE_TIMEOUTHTTP write timeout as a Go duration. Used only when MCP_TRANSPORT=http.LOG_MODElocal (text, debug) or prod (JSON, info). Logs go to stderr.MAX_IDLE_CONNS_PER_HOSTIdle connections the outbound HTTP client keeps per host.X_DEBUGLog the raw requests sent to the X API. Verbose; the output can contain request details, so keep it off outside debugging.POSTS_MAX_QUERIESQueries accepted in one x_posts_search or x_posts_count call.POSTS_MAX_USERNAMESUsernames accepted in one x_posts_by_user call.POSTS_MAX_IDSPost ids accepted in one x_posts_lookup call. The X API caps this at 100.POSTS_DEFAULT_RESULTSPosts returned per query when the call does not ask for a count. Every post returned is billed.POSTS_MAX_RESULTSUpper bound for posts per query. The X API caps this at 100.POSTS_DEFAULT_DAYSHow far back post searches look when the call does not say, in days.POSTS_MAX_DAYSFurthest back a post search may look, in days. Recent search cannot exceed 7.POSTS_DEFAULT_TIMEOUT_MSTimeout for a posts call in milliseconds when the call does not request one.POSTS_MIN_TIMEOUT_MSLowest timeout a posts call may request, in milliseconds.POSTS_MAX_TIMEOUT_MSHighest timeout a posts call may request, in milliseconds.USERS_MAX_USERNAMESUsernames accepted in one x_users_lookup call. The X API caps this at 100.USERS_MAX_IDSUser ids accepted in one x_users_lookup call. The X API caps this at 100.USERS_DEFAULT_RESULTSUsers returned per page when the call does not ask for a count.USERS_MAX_RESULTSUpper bound for users per page.USERS_DEFAULT_TIMEOUT_MSTimeout for a users call in milliseconds when the call does not request one.USERS_MIN_TIMEOUT_MSLowest timeout a users call may request, in milliseconds.USERS_MAX_TIMEOUT_MSHighest timeout a users call may request, in milliseconds.LISTS_DEFAULT_RESULTSItems returned per list page when the call does not ask for a count.LISTS_MAX_RESULTSUpper bound for items per list page. The X API caps this at 100.LISTS_DEFAULT_TIMEOUT_MSTimeout for a lists call in milliseconds when the call does not request one.LISTS_MIN_TIMEOUT_MSLowest timeout a lists call may request, in milliseconds.LISTS_MAX_TIMEOUT_MSHighest timeout a lists call may request, in milliseconds.MEDIA_CHUNK_BYTESBytes per upload segment. The X APPEND endpoint caps a segment at 5 MB.MEDIA_POLL_INTERVAL_MSHow often the upload status is polled while X transcodes a video, in milliseconds.MEDIA_DEFAULT_TIMEOUT_MSTimeout for a whole upload in milliseconds when the call does not request one.MEDIA_MIN_TIMEOUT_MSLowest timeout an upload may request, in milliseconds.MEDIA_MAX_TIMEOUT_MSHighest timeout an upload may request, in milliseconds.X_API_KEYOAuth 1.0a consumer key. developer.x.com -> your project -> your app -> Keys and tokens.RequiredX_API_KEY_SECRETOAuth 1.0a consumer secret, issued together with X_API_KEY.RequiredX_ACCESS_TOKENUser access token. Set the app permissions to Read and Write BEFORE generating it: a token keeps the permissions it was created with, and a read-only one fails every write until it is regenerated.RequiredX_ACCESS_TOKEN_SECRETUser access token secret, issued together with X_ACCESS_TOKEN.RequiredMEDIA_ROOTAbsolute path to an existing directory - the only one x_media_upload may read files from. Anything outside it is refused, symlinks included. Checked at startup.RequiredMCP_TRANSPORTstdio (client spawns the process) or http (streamable HTTP listener).MCP_NAMEServer name reported in the MCP initialize handshake.MCP_PATHHTTP path the MCP endpoint is served on. Used only when MCP_TRANSPORT=http.SERVER_PORTTCP port to listen on. Used only when MCP_TRANSPORT=http.SERVER_READ_TIMEOUTHTTP read timeout as a Go duration. Used only when MCP_TRANSPORT=http.SERVER_WRITE_TIMEOUTHTTP write timeout as a Go duration. Used only when MCP_TRANSPORT=http.LOG_MODElocal (text, debug) or prod (JSON, info). Logs go to stderr.MAX_IDLE_CONNS_PER_HOSTIdle connections the outbound HTTP client keeps per host.X_DEBUGLog the raw requests sent to the X API. Verbose; the output can contain request details, so keep it off outside debugging.POSTS_MAX_QUERIESQueries accepted in one x_posts_search or x_posts_count call.POSTS_MAX_USERNAMESUsernames accepted in one x_posts_by_user call.POSTS_MAX_IDSPost ids accepted in one x_posts_lookup call. The X API caps this at 100.POSTS_DEFAULT_RESULTSPosts returned per query when the call does not ask for a count. Every post returned is billed.POSTS_MAX_RESULTSUpper bound for posts per query. The X API caps this at 100.POSTS_DEFAULT_DAYSHow far back post searches look when the call does not say, in days.POSTS_MAX_DAYSFurthest back a post search may look, in days. Recent search cannot exceed 7.POSTS_DEFAULT_TIMEOUT_MSTimeout for a posts call in milliseconds when the call does not request one.POSTS_MIN_TIMEOUT_MSLowest timeout a posts call may request, in milliseconds.POSTS_MAX_TIMEOUT_MSHighest timeout a posts call may request, in milliseconds.USERS_MAX_USERNAMESUsernames accepted in one x_users_lookup call. The X API caps this at 100.USERS_MAX_IDSUser ids accepted in one x_users_lookup call. The X API caps this at 100.USERS_DEFAULT_RESULTSUsers returned per page when the call does not ask for a count.USERS_MAX_RESULTSUpper bound for users per page.USERS_DEFAULT_TIMEOUT_MSTimeout for a users call in milliseconds when the call does not request one.USERS_MIN_TIMEOUT_MSLowest timeout a users call may request, in milliseconds.USERS_MAX_TIMEOUT_MSHighest timeout a users call may request, in milliseconds.LISTS_DEFAULT_RESULTSItems returned per list page when the call does not ask for a count.LISTS_MAX_RESULTSUpper bound for items per list page. The X API caps this at 100.LISTS_DEFAULT_TIMEOUT_MSTimeout for a lists call in milliseconds when the call does not request one.LISTS_MIN_TIMEOUT_MSLowest timeout a lists call may request, in milliseconds.LISTS_MAX_TIMEOUT_MSHighest timeout a lists call may request, in milliseconds.MEDIA_CHUNK_BYTESBytes per upload segment. The X APPEND endpoint caps a segment at 5 MB.MEDIA_POLL_INTERVAL_MSHow often the upload status is polled while X transcodes a video, in milliseconds.MEDIA_DEFAULT_TIMEOUT_MSTimeout for a whole upload in milliseconds when the call does not request one.MEDIA_MIN_TIMEOUT_MSLowest timeout an upload may request, in milliseconds.MEDIA_MAX_TIMEOUT_MSHighest timeout an upload may request, in milliseconds.X_API_KEYOAuth 1.0a consumer key. developer.x.com -> your project -> your app -> Keys and tokens.RequiredX_API_KEY_SECRETOAuth 1.0a consumer secret, issued together with X_API_KEY.RequiredX_ACCESS_TOKENUser access token. Set the app permissions to Read and Write BEFORE generating it: a token keeps the permissions it was created with, and a read-only one fails every write until it is regenerated.RequiredX_ACCESS_TOKEN_SECRETUser access token secret, issued together with X_ACCESS_TOKEN.RequiredMEDIA_ROOTAbsolute path to an existing directory - the only one x_media_upload may read files from. Anything outside it is refused, symlinks included. Checked at startup.RequiredMCP_TRANSPORTstdio (client spawns the process) or http (streamable HTTP listener).MCP_NAMEServer name reported in the MCP initialize handshake.MCP_PATHHTTP path the MCP endpoint is served on. Used only when MCP_TRANSPORT=http.SERVER_PORTTCP port to listen on. Used only when MCP_TRANSPORT=http.SERVER_READ_TIMEOUTHTTP read timeout as a Go duration. Used only when MCP_TRANSPORT=http.SERVER_WRITE_TIMEOUTHTTP write timeout as a Go duration. Used only when MCP_TRANSPORT=http.LOG_MODElocal (text, debug) or prod (JSON, info). Logs go to stderr.MAX_IDLE_CONNS_PER_HOSTIdle connections the outbound HTTP client keeps per host.X_DEBUGLog the raw requests sent to the X API. Verbose; the output can contain request details, so keep it off outside debugging.POSTS_MAX_QUERIESQueries accepted in one x_posts_search or x_posts_count call.POSTS_MAX_USERNAMESUsernames accepted in one x_posts_by_user call.POSTS_MAX_IDSPost ids accepted in one x_posts_lookup call. The X API caps this at 100.POSTS_DEFAULT_RESULTSPosts returned per query when the call does not ask for a count. Every post returned is billed.POSTS_MAX_RESULTSUpper bound for posts per query. The X API caps this at 100.POSTS_DEFAULT_DAYSHow far back post searches look when the call does not say, in days.POSTS_MAX_DAYSFurthest back a post search may look, in days. Recent search cannot exceed 7.POSTS_DEFAULT_TIMEOUT_MSTimeout for a posts call in milliseconds when the call does not request one.POSTS_MIN_TIMEOUT_MSLowest timeout a posts call may request, in milliseconds.POSTS_MAX_TIMEOUT_MSHighest timeout a posts call may request, in milliseconds.USERS_MAX_USERNAMESUsernames accepted in one x_users_lookup call. The X API caps this at 100.USERS_MAX_IDSUser ids accepted in one x_users_lookup call. The X API caps this at 100.USERS_DEFAULT_RESULTSUsers returned per page when the call does not ask for a count.USERS_MAX_RESULTSUpper bound for users per page.USERS_DEFAULT_TIMEOUT_MSTimeout for a users call in milliseconds when the call does not request one.USERS_MIN_TIMEOUT_MSLowest timeout a users call may request, in milliseconds.USERS_MAX_TIMEOUT_MSHighest timeout a users call may request, in milliseconds.LISTS_DEFAULT_RESULTSItems returned per list page when the call does not ask for a count.LISTS_MAX_RESULTSUpper bound for items per list page. The X API caps this at 100.LISTS_DEFAULT_TIMEOUT_MSTimeout for a lists call in milliseconds when the call does not request one.LISTS_MIN_TIMEOUT_MSLowest timeout a lists call may request, in milliseconds.LISTS_MAX_TIMEOUT_MSHighest timeout a lists call may request, in milliseconds.MEDIA_CHUNK_BYTESBytes per upload segment. The X APPEND endpoint caps a segment at 5 MB.MEDIA_POLL_INTERVAL_MSHow often the upload status is polled while X transcodes a video, in milliseconds.MEDIA_DEFAULT_TIMEOUT_MSTimeout for a whole upload in milliseconds when the call does not request one.MEDIA_MIN_TIMEOUT_MSLowest timeout an upload may request, in milliseconds.MEDIA_MAX_TIMEOUT_MSHighest timeout an upload may request, in milliseconds.
Pricing
Open source
More servers for the same service
X (Twitter) FAQ
Is X (Twitter) free?
Yes. X (Twitter) is open source, so you can use and self-host it for free.
How do I add X (Twitter) to Claude Code?
Run this command in your terminal: claude mcp add mcp-x --env X_API_KEY='<X_API_KEY>' --env X_API_KEY_SECRET='<X_API_KEY_SECRET>' --env X_ACCESS_TOKEN='<X_ACCESS_TOKEN>' --env X_ACCESS_TOKEN_SECRET='<X_ACCESS_TOKEN_SECRET>' --env MEDIA_ROOT='<MEDIA_ROOT>' -- docker run -i --rm -e X_API_KEY -e X_API_KEY_SECRET -e X_ACCESS_TOKEN -e X_ACCESS_TOKEN_SECRET -e MEDIA_ROOT ghcr.io/role1776/mcp-x:0.1.1
Where this comes from
- Description: from the official MCP Registry entry.
- Install steps: from the official MCP Registry entry.