The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Xflux listing page.
Affordable & stable X/Twitter API proxy service — MVP built with Next.js 15, TypeScript, Prisma, and PostgreSQL.
xflux_* API keys@xflux/xflux-mcp-server) for Claude Desktop & CursorPublished on the MCP Registry as io.github.yxs1640-png/xflux and on npm as @xflux/xflux-mcp-server.
Docs: https://www.xfluxapi.com/docs/integrations/mcp
/api/v1/*api-server/ (Consumer API proxy) + Dockerfile.worker (Monitor 轮询)See docs/DEPLOYMENT.md for Vercel + Fly.io deployment.
Supabase 新版界面里,连接串不在 Project Settings → Database,而在:
项目首页顶部 → 点击 Connect 按钮
Project Overview 里若已有 DIRECT_URL(端口 5432),在 .env 里 两个变量都填同一个值 即可:
示例格式:
然后执行:
DATABASE_URL,末尾加 ?pgbouncer=trueDIRECT_URL 仍用 5432 直连(Connect → Direct connection 或 Overview 里的值)| 变量 | 从哪里找 | 端口 |
|---|---|---|
DIRECT_URL | Connect → Direct connection,或 Project Overview | 5432 |
DATABASE_URL | Connect → Transaction pooler / ORMs → Prisma | 6543 |
本地开发用 5432 直连即可;部署 Vercel 时再把
DATABASE_URL换成 6543 池化连接。
部署到 Vercel 时,在 Environment Variables 里添加 DATABASE_URL、DIRECT_URL、NEXTAUTH_URL、NEXTAUTH_SECRET。
Local database options:
| Option | Command | When to use |
|---|---|---|
| SQLite (default) | DATABASE_URL="file:./dev.db" | Quick local dev, no install |
| Docker Postgres | npm run db:up then use postgres URL in .env | Match production locally |
| Neon (cloud) | Paste URL from neon.tech | No Docker, free tier |
For Docker Postgres, change prisma/schema.prisma provider back to postgresql and set:
DATABASE_URL="postgresql://xflux:xflux@localhost:5432/xflux?schema=public"
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | file:./dev.db (local SQLite) or PostgreSQL URL (production) |
NEXTAUTH_URL | Yes | App URL (e.g. http://localhost:3000) |
NEXTAUTH_SECRET | Yes | Random 32+ char secret |
TWITTER_BEARER_TOKEN | No | Twitter API v2 bearer token for live data |
STRIPE_* / BILLING_CHECKOUT_ENABLED | Prod | Live billing on Vercel — see docs/STRIPE.md |
Generate a secret:
After registering, use your API key:
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/users/:username | User profile |
| GET | /api/v1/users/:username/tweets | User timeline |
| GET | /api/v1/tweets/:id | Tweet by ID |
| GET | /api/v1/search?q=keyword | Search tweets |
| POST | /api/v1/tweets | Post tweet (requires OAuth setup) |
Push to GitHub:
Import project at vercel.com/new
Add environment variables in Vercel dashboard:
DATABASE_URL — from Vercel Postgres or NeonNEXTAUTH_URL — your production URL (e.g. https://xflux.vercel.app)NEXTAUTH_SECRET — random secretTWITTER_BEARER_TOKEN — optionalAfter first deploy, run database migration:
Or add a build step with Vercel Postgres integration.
prisma/schema.prisma datasource provider from sqlite to postgresqlDATABASE_URL is auto-injectedprisma db push or migrate)This project interacts with X/Twitter data. Ensure compliance with X Developer Agreement and applicable laws. Use official APIs when possible.
MIT