How to Connect TikTok Data to Codex CLI (MCP Setup, 2026)
Codex is good at research that ends in a file: a markdown brief, a CSV, a set of draft scripts. With the FYPNow MCP server added, it can fetch the TikTok side of that research itself, including the top videos in a niche, the hooks behind them and the hashtags gaining creators. You add one block to config.toml, and the key stays in an environment variable.
What you need
- Codex CLI, installed.
- A FYPNow workspace on a paid plan. Creator and Starter include a 7-day free trial.
- An API key from FYPNow → Settings → API. It is shown once.
Step 1: Store the key in an environment variable
Set FYPNOW_API_KEY in your shell or system environment, with the key as the value.
Step 2: Add the server
Either run:
codex mcp add fypnow --url https://api.fypnow.com/mcp --bearer-token-env-var FYPNOW_API_KEY
or add this to ~/.codex/config.toml:
[mcp_servers.fypnow]
url = "https://api.fypnow.com/mcp"
bearer_token_env_var = "FYPNOW_API_KEY"
Step 3: Check it
codex mcp list
fypnow should appear. Then ask Codex:
What's trending across niches this week?
OAuth instead of a key
Codex supports OAuth for HTTP servers through codex mcp login fypnow. The FYPNow site does not say it works with Codex, so we have not tested it.
What you can ask it
- "Get the top 20 trending videos across niches from the last 3 days and save them to
trending.csvwith views, multiple and hook." The window can be anything from 6 hours to 7 days. - "Which hashtags are more creators using in Personal Finance this week?"
- "Search analysed hooks about productivity and group them by hook type in
hooks.md." - "Show the open trends in Food with their example video links."
- "Analyze https://www.tiktok.com/@someone/video/123 and summarise why it worked." Needs a read+write key. Allow about a minute.
What the data is
Results come from FYPNow's catalogue of public TikTok videos, sorted into niches by keywords and hashtags. Niches refresh on a schedule, so expect the newest videos to be a few days old. The multiple compares a video's views with its creator's follower count. Nothing here touches private analytics for any account.
Troubleshooting
fypnowisn't incodex mcp list. Check you edited~/.codex/config.toml, or that the project is trusted if you used.codex/config.toml.401 missing_api_key. Codex couldn't readFYPNOW_API_KEY. Export it in the same shell you start Codex from, or add it to your shell profile and open a new terminal.401 invalid_api_key. Check the whole key was copied. FYPNow keys start withfyp_sk_.403 write_scope_required. A read key called a write tool. Create a read+write key if you need analysis.- TOML errors on start. The table name is
[mcp_servers.fypnow], with an underscore.
Limits
- It reads and analyses. It does not post for you.
- A key acts on one workspace. Revoke it in Settings → API if it leaks.
- Results describe what has happened to other videos. They are not a forecast.
Other guides
The same server works in Claude Code, Gemini CLI and OpenCode. For ChatGPT itself, see connecting TikTok data to ChatGPT. The MCP server page lists every tool.
Frequently asked questions
Where does Codex CLI keep MCP settings?
In ~/.codex/config.toml, or in .codex/config.toml for a trusted project. The CLI and the IDE extension share the same config.
How do I keep the key out of the config file?
Use bearer_token_env_var to name an environment variable, so the secret is read from the environment instead of the file.
Does the Codex IDE extension pick this up too?
Yes. The CLI and the IDE extension read the same config.toml, so a server added in one shows up in the other.
Which FYPNow key scope should Codex use?
A read key covers browsing niches, trends, hashtags and hooks. Use read+write only if you want Codex to analyse new videos, create niches or search trends.
Start free trial
See why any TikTok or YouTube Short went viral with a frame-by-frame AI breakdown. 7-day free trial, then plans from $19/mo.
Prefer to explore first? Start free trial