Commit 06f7426
committed
feat: add
New commands
- `xurl mcp [URL]`: a stdio<->Streamable-HTTP MCP bridge for the hosted X API MCP
server. Injects an auto-refreshed OAuth2 Bearer token, maintains the MCP
session id, handles JSON/SSE/202 responses, processes requests in order off
the read loop while dispatching notifications concurrently, synthesizes a
JSON-RPC error for any request it cannot answer (so a strict client never
hangs), and shuts down cleanly on SIGINT/EOF.
- `xurl token`: print a valid (refreshed, persisted) OAuth2 access token for the
active app; never opens a browser, so it is scriptable.
Auth
- `xurl auth oauth2 --headless`: authenticate on remote/headless machines with no
reachable localhost callback -- print the authorize URL, paste the redirect
URL/code back (also via stdin).
- OAuth2 token exchange/refresh now sets the client-auth style explicitly (Basic
header for confidential clients, body for public), fixing
`unauthorized_client: Missing valid authorization header` against X.
- `auth app` -> `auth app-only` (aliases: app, bearer); token is positional or
read from stdin (`-`); `auth clear --app-only`.
Command surface
- Group subcommands in `--help`; add `xurl posts USERNAME`; support `xurl
--version`; `-d` implies POST (curl-like).
Fixes
- media upload: corrected verbose/wait/trace argument order and added media-type
auto-detection (erroring on unsupported types instead of guessing).
- Surface real transport/auth errors instead of printing `null`; fail fast on
missing credentials; JSON-encode DM text; clamp `--max-results` per endpoint;
OAuth2 expiry/skew handling; webhook help + isolated ServeMux; `.gitignore`
fix. See CHANGELOG.md for the complete list.xurl mcp bridge + xurl token, headless OAuth2, and auth/UX hardening1 parent b8d4863 commit 06f7426
23 files changed
Lines changed: 2743 additions & 196 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 5 | + | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
11 | 25 | | |
12 | 26 | | |
13 | 27 | | |
| |||
16 | 30 | | |
17 | 31 | | |
18 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
19 | 43 | | |
20 | 44 | | |
21 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
89 | 97 | | |
90 | 98 | | |
91 | 99 | | |
| |||
104 | 112 | | |
105 | 113 | | |
106 | 114 | | |
107 | | - | |
| 115 | + | |
108 | 116 | | |
109 | | - | |
| 117 | + | |
| 118 | + | |
110 | 119 | | |
| 120 | + | |
| 121 | + | |
111 | 122 | | |
112 | 123 | | |
113 | 124 | | |
| |||
249 | 260 | | |
250 | 261 | | |
251 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
252 | 310 | | |
253 | 311 | | |
254 | 312 | | |
| |||
280 | 338 | | |
281 | 339 | | |
282 | 340 | | |
283 | | - | |
| 341 | + | |
284 | 342 | | |
285 | 343 | | |
| 344 | + | |
286 | 345 | | |
287 | 346 | | |
288 | | - | |
| 347 | + | |
289 | 348 | | |
290 | 349 | | |
291 | 350 | | |
| |||
302 | 361 | | |
303 | 362 | | |
304 | 363 | | |
305 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
306 | 367 | | |
307 | 368 | | |
308 | 369 | | |
309 | | - | |
| 370 | + | |
310 | 371 | | |
311 | 372 | | |
312 | | - | |
| 373 | + | |
313 | 374 | | |
314 | | - | |
| 375 | + | |
315 | 376 | | |
316 | 377 | | |
317 | 378 | | |
318 | 379 | | |
319 | | - | |
| 380 | + | |
320 | 381 | | |
321 | 382 | | |
322 | 383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| 73 | + | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| |||
157 | 162 | | |
158 | 163 | | |
159 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
160 | 169 | | |
161 | 170 | | |
162 | 171 | | |
| |||
404 | 413 | | |
405 | 414 | | |
406 | 415 | | |
| 416 | + | |
| 417 | + | |
0 commit comments