Skip to content
Conduit

mcp server

reddit-mcp

A Model Context Protocol (MCP) server for Reddit. Log in once with a real browser, then read and post without an API key.

preaverage/reddit-mcpcommunitylistedunreviewed

Set up

Runs on your computer. Pick your agent and operating system.

This project does not publish an install method we can turn into a config. Follow the README instead.

README

synced Oct 28, 2026

reddit-mcp

npm license

Read Reddit from any MCP client. You log in once in a real browser, and the server handles everything after that with ordinary HTTP requests. There is no API key to get and no Reddit app to register.

Why this one

Most Reddit MCP servers ask you to register a Reddit app and paste in a client ID and secret. This one asks you to sign in.

A browser window opens, you log in, and that is the setup. Requests then come from your own account, so your home feed and your saved posts work. The browser closes when login finishes, and it only comes back if your session expires.

Quick start

Sign in once, which opens a browser window:

npx -y @preaverage/reddit-mcp login

Then point Claude Code at it:

claude mcp add --scope user reddit -- npx -y @preaverage/reddit-mcp

The user scope makes it available in every project rather than only the directory you ran that in. Restart Claude Code afterwards, since a running session does not pick up a newly added server.

Any client that reads a JSON config takes the same command:

{
  "mcpServers": {
    "reddit": {
      "command": "npx",
      "args": ["-y", "@preaverage/reddit-mcp"]
    }
  }
}

Codex

codex mcp add reddit -- npx -y @preaverage/reddit-mcp

Editing ~/.codex/config.toml by hand works too:

[mcp_servers.reddit]
command = "npx"
args = ["-y", "@preaverage/reddit-mcp"]

The first login downloads Camoufox, a hardened Firefox, along with the Playwright driver, so give it a minute.

Claude Desktop

Download the .mcpb bundle for your platform from the releases page and open it. Claude Desktop installs it in one click, with no terminal involved, and the install dialog has a checkbox for allowing writes. Sign in afterwards through the login tool.

From source

go build -o reddit-mcp ./cmd/mcp-server
./reddit-mcp login
claude mcp add --scope user reddit -- /path/to/reddit-mcp

Tools

Reading Reddit:

ToolWhat it does
get_meYour profile and karma
get_userAnyone's public profile
get_postOne post, by URL, t3_ fullname, or bare id
get_post_commentsA post with its comment tree
get_more_commentsExpand branches the tree cut off
get_user_postsSomeone's posts, or your own
get_user_commentsSomeone's comments, or your own
get_saved_postsPosts you saved
get_subreddit_postsA subreddit feed, or your home feed
get_subredditSubreddit description and subscriber count
search_postsSearch posts, optionally inside one subreddit

Writing to Reddit, which is off until you turn it on:

ToolWhat it does
submit_postCreate a text post or a link post in a subreddit
replyComment on a post, or reply to another comment
editRewrite the body of your own text post or comment
deletePermanently remove your own post or comment

These four act publicly under your account, so the server leaves them out unless you ask for them. Without that a client cannot see them, let alone call them.

Turning on writes

Set REDDIT_MCP_ENABLE_WRITES to 1 where your client keeps environment variables for the server.

Claude Code, using -e:

claude mcp add --scope user reddit -e REDDIT_MCP_ENABLE_WRITES=1 -- npx -y @preaverage/reddit-mcp

Codex, using --env before the --:

codex mcp add reddit --env REDDIT_MCP_ENABLE_WRITES=1 -- npx -y @preaverage/reddit-mcp

If you already added the server without it, remove and add it again.

Claude Desktop asks during installation instead. Tick "Allow posting, editing, and deleting" in the install dialog, or change it later in the extension's settings.

Clients with a JSON config take an env block:

{
  "mcpServers": {
    "reddit": {
      "command": "npx",
      "args": ["-y", "@preaverage/reddit-mcp"],
      "env": { "REDDIT_MCP_ENABLE_WRITES": "1" }
    }
  }
}

The same in ~/.codex/config.toml:

[mcp_servers.reddit.env]
REDDIT_MCP_ENABLE_WRITES = "1"

Running the binary yourself needs nothing special:

REDDIT_MCP_ENABLE_WRITES=1 reddit-mcp serve

Ask for session_status to see whether it took. It reports writes_enabled, so you can tell a missing variable apart from a client that never restarted.

Managing your login:

ToolWhat it does
session_statusWhether you are logged in and when the token expires
loginOpens the browser login flow without leaving your client
logoutSigns out on Reddit, then deletes the session and browser profile

Common options

OptionApplies toNotes
rawevery tool that calls RedditReturns Reddit's own JSON instead of the trimmed version
limitlistings1 to 100, default 25
afterlistingsCursor from the previous response
sortlistings, commentsSuch as hot, new, top
timetop and controversialhour through all

Listings return an after cursor for the next page. Comment trees mark anything they cut off with more_ids, which get_more_comments turns back into real comments.

reply, edit, and delete take whatever identifies the target: a post URL, a comment URL, a bare post id, or a t1_/t3_ fullname. A comment URL points at that comment rather than the post it sits under. When Reddit refuses a write, such as a rate limit or a subreddit that requires flair, its own reason comes back verbatim. Reddit reports a delete as successful whether or not the item was yours, so delete checks afterwards and tells you which it was.

How it works

  1. When you log in, Camoufox opens through Playwright with a profile that persists. Once your session cookies appear, the server records them along with the exact headers and user agent the browser sent.
  2. Every request after that goes out through bogdanfinn/tls-client using a Firefox TLS fingerprint, your cookies, and those same headers in Firefox's order. They reach oauth.reddit.com with the web app's own bearer token.
  3. The token lasts about a day. Shortly before it expires the server loads reddit.com once, which is enough for Reddit to issue a fresh one. If that fails it reopens Camoufox in the background. It asks you to log in again only if the browser profile itself has been signed out.

Command line

CommandWhat it does
reddit-mcp serveRuns the MCP server on stdio. This is the default
reddit-mcp loginSigns you in, or says who you already are. Add -force to sign in again
reddit-mcp whoamiPrints your profile, to check the saved session works
reddit-mcp refreshRenews cookies in the background using the saved profile
reddit-mcp logoutSigns out on Reddit and deletes everything stored locally

Files

PathHolds
~/.config/reddit-mcp/session.jsonCookies, headers, user agent. Readable only by you
~/.cache/reddit-mcp/profileThe browser profile that stays logged in
~/.cache/reddit-mcp/camoufoxThe browser itself
~/.cache/ms-playwright-goThe Playwright driver
VariableEffect
REDDIT_MCP_SESSIONKeeps the session file somewhere other than the default path
REDDIT_MCP_ENABLE_WRITESSet to 1 or true to offer the four tools that post, edit, and delete

Privacy

Your session file holds real credentials, so it is written readable only by your user account. Nothing else on disk keeps them.

No tool returns a cookie or a token, in raw mode or otherwise. get_me strips your email address, payment flags, and linked accounts before the raw response goes out. logout revokes the session with Reddit before deleting the local files, so the cookies stop working even if someone recovers them.

A default install can only read. The four tools that write are not registered unless you set REDDIT_MCP_ENABLE_WRITES to 1 or true, which means a client cannot post, edit, or delete by accident. Nothing votes or touches your messages either way.

Bear in mind what enabling writes means. The model can publish under your name, and delete cannot be undone.

Requirements

Node 18 or newer if you install through npx. Go 1.26 or newer if you build from source.

Linux, macOS, and Windows all work, on both Intel and ARM, except Windows on ARM, which Camoufox does not build for.

Development

go test ./...
go vet ./...

Publishing to npm builds one package per platform, each holding a cross-compiled binary, plus a small launcher package that picks the right one. Set the scope at the top of the build script if you publish under a different account.

scripts/build-npm.sh
scripts/publish-npm.sh

Desktop bundles are built the same way, one .mcpb per platform, ready to attach to a release. The tool list inside each manifest comes from a running server, so it cannot drift from the code.

scripts/build-mcpb.sh

MIT licensed.

The code is split by job. internal/browser drives Camoufox and captures the login, internal/reddit is the HTTP client and the Reddit API, internal/session stores what login produced, and internal/server exposes it all as MCP tools.

↑↓ navigate openesc close