You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tools/mcp.mdx
+96-17Lines changed: 96 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,9 +46,22 @@ flowchart LR
46
46
- On **first run with no cached token**, it opens your browser for a one-time OAuth2 login, then caches and **auto-refreshes** the token forever after.
47
47
- All diagnostics go to **stderr**; **stdout stays a clean JSON-RPC channel**.
48
48
49
-
### Before you begin
49
+
### Getting started
50
50
51
-
1.**Create an X app** in the [X Developer Portal](https://developer.x.com) with **OAuth 2.0** enabled.
51
+
Pick one of two routes:
52
+
53
+
***Simple — App-only Bearer.** Paste your app's Bearer token into an `Authorization` header on the MCP client. No bridge, no browser login. Read-only endpoints; no user context (can't act as you). Works with clients that support remote MCP with custom headers.
54
+
***Full — `xurl mcp` bridge (OAuth 2.0 user context).** A local bridge handles the OAuth 2.0 PKCE login and auto-refreshes tokens, so the model acts with your account's scopes. Required for writes (bookmarks, Articles) and any user-context tool.
55
+
56
+
#### Simple route (app-only Bearer)
57
+
58
+
1.**Create an X app** in the [X Developer Portal](https://developer.x.com).
59
+
2.**Copy your App-only Bearer token** from the app's "Keys and tokens" page.
60
+
3. Point your client at `https://api.x.com/mcp` with the token as an `Authorization` header — see [App-only (direct URL, no bridge)](#app-only-direct-url-no-bridge) below for the snippet.
61
+
62
+
#### Full route (xurl bridge)
63
+
64
+
1.**Create an X app** with **OAuth 2.0** enabled.
52
65
2.**Register the redirect URI**`http://localhost:8080/callback` on the app (required for the first-run browser login). To use a different one, set `REDIRECT_URI` and register that instead.
53
66
3.**Copy your `CLIENT_ID` and `CLIENT_SECRET`** — you'll put them in the client config.
54
67
4.**Have Node.js installed** (for `npx`).
@@ -68,18 +81,9 @@ flowchart LR
68
81
69
82
#### 1. Grok Build
70
83
71
-
Add the server with one command (the `-e` flags become the server's environment, args after `--` go to `npx`):
Then open **Cursor → Settings → MCP**, confirm **xapi** shows a green dot and its tools. On first use Cursor spawns the bridge and your browser opens for login; the tool list populates once the handshake completes.
0 commit comments