In ~/.codex/config.toml, under one [mcp_servers.<name>] table per server. A trusted project can also carry its own .codex/config.toml. The Codex CLI, the IDE extension and the ChatGPT desktop app share this config, so a server added in one shows up in the others.
Connect the Reddit MCP to Codex
OpenAI Codex configures MCP servers in TOML. Point an mcp_servers table in ~/.codex/config.toml at the hosted Reddit MCP server with your key as a bearer token, or run the redditapis-mcp package locally with npx, and Codex gets live Reddit tools in the CLI and the IDE extension.
Written by Emma, developer relations at Redditapis. The server is the published redditapis-mcp package, so every field below is verified against the live package and Codex's own docs.
How do you add the Reddit MCP to Codex?
Export REDDITAPIS_KEY in your shell, then run codex mcp add reddit --url https://api.redditapis.com/mcp --bearer-token-env-var REDDITAPIS_KEY. That writes a [mcp_servers.reddit] table with url and bearer_token_env_var to ~/.codex/config.toml, so nothing is installed. To run the server locally instead, use codex mcp add reddit --env REDDITAPIS_KEY=YOUR_KEY -- npx -y redditapis-mcp@latest. Type /mcp in the Codex TUI to confirm the server is active.
Set up the Reddit MCP in Codex
Codex keeps its MCP servers in ~/.codex/config.toml, one TOML table per server. The hosted server needs only a url and the name of the environment variable that holds your key; Codex sends it as a bearer token. The local npx server is the alternative when you want the package on your machine.
~/.codex/config.tomlKey: mcp_servers$ npx -y redditapis-mcp@latest# ~/.codex/config.toml (hosted server, nothing to install)
[mcp_servers.reddit]
url = "https://api.redditapis.com/mcp"
# Codex reads your key from this environment variable and sends it as a bearer token
bearer_token_env_var = "REDDITAPIS_KEY"
# Local alternative: run the package with npx instead of using the hosted server
# [mcp_servers.reddit]
# command = "npx"
# args = ["-y", "redditapis-mcp@latest"]
# startup_timeout_sec = 30
# [mcp_servers.reddit.env]
# REDDITAPIS_KEY = "YOUR_KEY"# hosted server (export REDDITAPIS_KEY in your shell first)
codex mcp add reddit \
--url https://api.redditapis.com/mcp \
--bearer-token-env-var REDDITAPIS_KEY
# or the local package
codex mcp add reddit \
--env REDDITAPIS_KEY=YOUR_KEY \
-- npx -y redditapis-mcp@latest
# check it
codex mcp listAdd the server table
Add a [mcp_servers.reddit] table to ~/.codex/config.toml, or to .codex/config.toml in a trusted project to scope it there. The table name after mcp_servers is the server name Codex shows. For the hosted server the table holds url and bearer_token_env_var; codex mcp add with --url and --bearer-token-env-var writes the same thing.
Make the key available
For the hosted server, export REDDITAPIS_KEY in the shell that starts Codex; Codex reads the variable named in bearer_token_env_var and never stores the key in the file. For the IDE extension, start the editor from that shell or set the variable in the editor's own environment. For the local package, give the table command npx and an args array of -y and redditapis-mcp@latest, and put REDDITAPIS_KEY under [mcp_servers.reddit.env].
Local only: allow time for the first start
The hosted server has nothing to download. If you run the local package, Codex waits 10 seconds for a server to start by default and the first npx run downloads the package, so startup_timeout_sec = 30 keeps a cold start from timing out.
Confirm the tools loaded
Run codex mcp list in a terminal, or type /mcp inside the Codex TUI to see the active servers. In the IDE extension, open the gear menu, then MCP servers.
Confirm it connected
codex mcp list shows reddit, and /mcp in the TUI lists it as active with its Reddit tools. If it is missing, check that the TOML parses (a quote or bracket out of place fails the whole file). On the hosted server, an error that the REDDITAPIS_KEY environment variable is not set means the key was not exported where Codex started; a 401 means the key reached the server but is wrong or revoked, so copy it again from your dashboard. On the local package, check that npx is on your PATH and that the start did not hit startup_timeout_sec.
The Reddit tools Codex reaches for most
Per our published redditapis-mcp catalog, the server exposes 59 tools; these 11 are the reads agents call most (the full table is on the Reddit MCP hub). The comment, post, vote and DM tools act as your own Reddit account only after you connect it (reddit_connect locally, POST /api/reddit/session for the hosted server), and each is marked as a write so the client asks first. Your key, REDDITAPIS_KEY, authenticates every call.
reddit_searchreddit_subreddit_postsreddit_subreddit_topreddit_postreddit_post_commentsreddit_search_commentsreddit_search_communitiesreddit_search_mediareddit_search_usersreddit_user_profilereddit_user_commentsSame server, a different client?
The redditapis-mcp server runs the same way everywhere; only the config file and key differ per client. Setup for the others:
- Reddit MCP for Claude Desktop , mcpServers in JSON
- Reddit MCP for Claude Code , mcpServers in JSON
- Reddit MCP for Cursor , mcpServers in JSON
- Reddit MCP for VS Code , servers in JSON
- Reddit MCP for Windsurf , mcpServers in JSON
- Reddit MCP for Kilo Code , mcp in JSONC
- Reddit MCP for OpenClaw , mcp.servers in JSON
- Reddit MCP for Hermes , mcp_servers in YAML
- Reddit MCP hub , every client, the full tool table, limits and fixes
- Reddit MCP server overview , the server, tools, and pricing
- Reddit API for AI agents , tool use, MCP, and RAG on Reddit
By the numbers
Reddit MCP access, by the numbers
Every Redditapis figure resolves to our published per-call rates; every external figure is a primary US source.
Redditapis bills reads at $0.0015 per call, votes at $0.005, writes at $0.012, and DMs at $0.025, one flat rate for every account with no minimum spend. (Redditapis pricing, 2026)
The published redditapis-mcp server exposes 59 tools behind one Bearer key, and every new account starts with $0.50 in free credits, enough for roughly 333 reads before any charge. (Redditapis, 2026)
Reddit's own commercial Data API was reported at $0.24 per 1,000 API calls, the rate that ended third-party apps like Apollo in 2023. (The Verge, 2023)
Reddit's free Data API access is limited to 100 queries per minute per OAuth client, and traffic without OAuth is blocked, so an MCP client polling at volume needs a managed layer. (Reddit Data API Wiki, 2026)
Reddit signed a reported $60 million-a-year deal to license its data for AI training, a sign of how valuable structured Reddit context has become for models. (Reuters, 2024)
Frequently asked questions
For the hosted server, run codex mcp add reddit --url https://api.redditapis.com/mcp --bearer-token-env-var REDDITAPIS_KEY with REDDITAPIS_KEY exported in your shell. For the local package, run codex mcp add reddit --env REDDITAPIS_KEY=YOUR_KEY -- npx -y redditapis-mcp@latest, where everything after the double dash is the command that starts the server. codex mcp list confirms the entry was written.
Codex uses TOML, not JSON. Instead of an mcpServers object you write a [mcp_servers.reddit] table: url and bearer_token_env_var for the hosted server, or command and args with a nested [mcp_servers.reddit.env] table for the local package. The fields are the same ones other clients use, written as TOML.
That happens with the local package: Codex gives a server 10 seconds to start by default, and the first npx run has to download redditapis-mcp before it can answer. Set startup_timeout_sec = 30 in the [mcp_servers.reddit] table, or use the hosted server, which has nothing to download.
The redditapis-mcp server gives Codex 59 tools: Reddit reads such as reddit_search, reddit_subreddit_posts, reddit_post_comments and reddit_user_profile, plus monitor, webhook, credit and feedback tools. None of them post, vote or send DMs on Reddit.
Keep reading.
Continue exploring related pages.
Reddit API documentation
The complete 2026 reference: auth, all 74 endpoints, and code.
Get a Reddit API key
Instant bearer token, no waitlist and no enterprise contract.
Reddit Responsible Builder Policy
Why Reddit denies API applications, and the managed REST bypass.
Reddit API use cases
14 use cases from AI training to brand monitoring and DMs.
Reddit Search API
Search posts, comments, users, and communities over one REST endpoint.
Reddit MCP server
Wrap the REST API as MCP tools for Claude, Cursor, and any MCP client.
Reddit MCP hub
Install tabs for every client, the full tool table, pricing and fixes.
Reddit API for AI agents
Live Reddit context for tool calls, MCP servers, and RAG pipelines.
Redditapis pricing
Endpoint-level costs and quick monthly totals - reads from $0.0015 / call.
Reddit API cost calculator
Estimate monthly spend using your request volume.
Reddit API guides and tutorials
Tutorials, walkthroughs, and API deep-dives for developers.
Reddit API alternatives
Evaluate alternatives by cost model, limits, and integration fit.
Cheap Reddit API
The cheapest way to get Reddit data: $0.0015 per call, no contract, no minimum.
Official Reddit API vs Redditapis
Access, setup, rate limits, and pricing, side by side.
PRAW alternative
A hosted Reddit REST API for any language, no app registration or OAuth.
Reddapi alternative
A maintained Reddit REST API with published pricing and write endpoints.
Reddit comment scraper alternative
The raw comment API: search and filter comments, historical and live, clean JSON.
Reddit scraper API
Hosted scraper API vs building your own: no proxies to manage, clean JSON.
RapidAPI Reddit alternative
A direct, maintained Reddit API with published pricing and write endpoints.
Bright Data Reddit alternative
A purpose-built Reddit API vs a general scraping platform: structured JSON, plus writes.
ScraperAPI Reddit alternative
A Reddit-native API vs a generic HTML fetcher: auth and pagination handled, typed JSON.
TikHub alternative
TikHub's Reddit surface is read-only; get comment, vote, and DM endpoints too.
EnsembleData alternative
No $100/month floor: pay per call from $0.0015, plus write, vote, and DM endpoints.
Scrape Creators alternative
7 read-only Reddit endpoints vs a dedicated API with real write, vote, and DM paths.
FetchLayer alternative
Posts, comments, and search only; add vote, comment, and DM over the same REST auth.
PullPush alternative
PullPush is free but volunteer-run and goes offline for reindexing; a maintained REST API that stays up.
Reddit monitoring API
Build your own keyword and brand-mention monitor: search, comment search, and subreddit streams over REST.
F5Bot vs Redditapis
F5Bot's Slack and Discord delivery needs its $49.99/mo Gold tier; Redditapis includes it from $19/mo.
Syften vs Redditapis
Syften caps you at 100 to 500 results a day; Redditapis allows 10,000 a day per monitor at the entry plan.
Octolens vs Redditapis
Octolens meters by mention with overage fees; Redditapis is flat-priced by subreddit slot from $19/mo.
Affiliate program
Earn 20% lifetime commissions - capped at $5,000/yr.
Reddit Vote API tutorial
Upvote and downvote a post programmatically via the REST API.
Reddit Data API: REST, no PRAW
REST endpoints for Reddit data with no PRAW and no OAuth dance.
Reddit scraping benchmarks
Real throughput, error rates, and cost benchmarks for Reddit scraping.
Reddit API answers
Direct answers on cost, access, rate limits, endpoints, and auth.
How much the Reddit API costs
Per-call pricing from $0.0015 a read, with $0.50 in free credits.
Reddit API in Python
One requests call with a bearer token, no PRAW and no OAuth flow.
Reddit shadowban checker
Check if a Reddit account is shadowbanned in seconds, free and no login.
Subreddit stats checker
See any subreddit's live subscriber count, active users, and age, free and no login.
Give Codex live Reddit tools.
$0.50 in free credits at signup, no card required. Copy your bearer token, paste it into the config above, and the reddit tools are live the same session.
