# Copy to .env and fill in the first section. Pass the file explicitly: # ./bin/mcp-x -env /path/to/.env # There is no implicit lookup — under stdio the working directory is chosen by # the MCP client, so a relative default would be unpredictable. If the file is # missing the server falls back to the ambient environment, but the four keys # below must still be set somewhere or startup fails. # --- X API credentials (REQUIRED) --- # developer.x.com -> your project -> your app. # IMPORTANT: under "User authentication settings" set App permissions to # "Read and Write" BEFORE you generate the Access Token and Secret. A token # generated while the app was read-only stays read-only, and every write # returns 403 oauth1-permissions until you regenerate it. X_API_KEY= X_API_KEY_SECRET= X_ACCESS_TOKEN= X_ACCESS_TOKEN_SECRET= # --- Media (REQUIRED for x_media_upload) --- # Absolute path to the only directory x_media_upload may read files from. # Anything outside it is refused, symlinks included. The directory must already # exist: the server checks it at startup and refuses to start otherwise. MEDIA_ROOT=/tmp/mcp-x-media # --------------------------------------------------------------------------- # Everything below is optional; the value shown is the built-in default. # --------------------------------------------------------------------------- # --- MCP server --- # MCP_TRANSPORT=stdio # stdio | http # MCP_NAME=mcp-x # MCP_PATH=/mcp # used only when MCP_TRANSPORT=http # --- HTTP server (used only when MCP_TRANSPORT=http) --- # SERVER_PORT=8080 # SERVER_READ_TIMEOUT=60s # SERVER_WRITE_TIMEOUT=60s # --- Logging --- # LOG_MODE=local # local (text, debug) | prod (json, info) # --- HTTP client --- # MAX_IDLE_CONNS_PER_HOST=100 # X_DEBUG=false # log raw gotwi requests # --- Posts limits --- # POSTS_MAX_QUERIES=5 # POSTS_MAX_USERNAMES=5 # POSTS_MAX_IDS=100 # POSTS_DEFAULT_RESULTS=10 # POSTS_MAX_RESULTS=100 # POSTS_DEFAULT_DAYS=7 # POSTS_MAX_DAYS=7 # recent search cannot look back further # POSTS_DEFAULT_TIMEOUT_MS=15000 # POSTS_MIN_TIMEOUT_MS=2000 # POSTS_MAX_TIMEOUT_MS=60000 # --- Users limits --- # USERS_MAX_USERNAMES=100 # USERS_MAX_IDS=100 # USERS_DEFAULT_RESULTS=100 # USERS_MAX_RESULTS=1000 # USERS_DEFAULT_TIMEOUT_MS=15000 # USERS_MIN_TIMEOUT_MS=2000 # USERS_MAX_TIMEOUT_MS=60000 # --- Lists limits --- # LISTS_DEFAULT_RESULTS=25 # LISTS_MAX_RESULTS=100 # LISTS_DEFAULT_TIMEOUT_MS=15000 # LISTS_MIN_TIMEOUT_MS=2000 # LISTS_MAX_TIMEOUT_MS=60000 # --- Media limits --- # MEDIA_CHUNK_BYTES=4194304 # 4 MB; the APPEND endpoint caps a segment at 5 MB # MEDIA_POLL_INTERVAL_MS=2000 # MEDIA_DEFAULT_TIMEOUT_MS=120000 # MEDIA_MIN_TIMEOUT_MS=5000 # MEDIA_MAX_TIMEOUT_MS=600000