Skip to main content

X

X hosts its official MCP server at https://api.x.com/mcp over streamable HTTP. The X card with the Official badge pre-fills that URL. X does not register clients. An admin creates an OAuth 2.0 app and pastes its client ID. Each person signs in with their own X account, and calls run as that account. See MCP servers for the X API.

Choose a Native App. It is a public client: PKCE only, and no client secret. Paste the client ID in Willow and leave Client Secret empty. A Web App or Automated App is a confidential client. X accepts client_secret_basic for that secret and rejects client_secret_post. Willow sends a pasted secret in the token request body.

The card uses the full server. X also documents https://api.x.com/mcp?read_only=true. On that URL only read tools are offered, and a write call is refused even when the token has write scopes.

Create an X app​

  1. In Willow, go to MCP Servers → + Add MCP server, open the X card with the Official badge, and click + Use.

  2. On the Setup tab, under OAuth sign-in, select Client ID & secret. Automatic (discovery) cannot register a client, because X does not advertise a registration endpoint. Copy the Redirect URL:

    • SaaS: https://{org}.withwillow.ai/{org}/api/auth/callback
    • On-prem: {CONNECT_URL}/{org}/api/auth/callback

    Copy the exact URL from the Setup tab. X matches it exactly, including the scheme and any trailing slash. See Apps.

  3. In the X Developer Console, create an app, or open an existing one. New apps use OAuth 2.0. On an older app, enable OAuth 2.0 in the app's authentication settings.

  4. Set the app type to Native App.

  5. Add the copied callback URL to the app's callback allowlist.

  6. Open Keys and tokens and copy the OAuth 2.0 Client ID. It is the long string on that page. A Native App has no client secret.

Set up Willow​

  1. Keep Client ID & secret. Paste the Client ID. Leave Client Secret empty.

  2. Open Advanced settings. Under Scopes, add the X API scopes the agent needs, and include offline.access. X issues a refresh token only when that scope is granted. Without it, the access token lasts two hours. With a client you entered yourself, Willow sends only the scopes listed here. An empty list sends no scope. See Configure Proxy OAuth.

    X's MCP guide uses tweet.read, users.read, bookmark.read, bookmark.write, and offline.access as an example. Scope names are listed in OAuth 2.0 Authorization Code Flow with PKCE.

  3. Save, click Check connection, and sign in with the X account the agent should use. Assign groups and click Publish.

X keeps one live OAuth grant per app and user. Signing in from a second client with the same app revokes the first client's tokens. Use a separate X app for Willow when that account also signs in from another client.

Troubleshooting​

The callback is not approved​

Cause: The callback URL on the app differs from the URL Willow sent. X returns "Callback URL not approved for this client application."

Solution: Copy the Redirect URL from the Setup tab again and add that exact value to the app's callback allowlist.

X shows "Something went wrong — You weren't able to give access to the App"​

Cause: The client ID is missing or invalid.

Solution: Paste the OAuth 2.0 Client ID from Keys and tokens. Leave Client Secret empty.

The token exchange is rejected​

Cause: A client secret from a Web App or Automated App was pasted. X rejects client_secret_post. It accepts none (PKCE only) and client_secret_basic.

Solution: Use a Native App and leave Client Secret empty. Sign in again.

Sign-in succeeds and the connection expires after about two hours​

Cause: offline.access was not requested, so X did not issue a refresh token.

Solution: Add offline.access under Advanced settings → Scopes, save, and sign in again.

Sign-in returns client-not-enrolled​

Cause: The app is not in the package and environment the MCP server expects.

Solution: In the Developer Console, move the app to Pay-per-use and Production.

Additional Resources​