reddit-mcp
Provides read-only access to Reddit data via the Reddit API, including tools for retrieving the authenticated user's profile, listing subscribed subreddits, fetching user history, getting subreddit feeds, and searching Reddit.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@reddit-mcpwhat are the top posts on r/technology this week?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
reddit-mcp
Read-only Reddit Data API MCP connector for Cursor / Grok Bot connect-card OAuth.
Runs as a Cloudflare Worker that speaks MCP Streamable HTTP and passes through the caller's Authorization: Bearer token to https://oauth.reddit.com.
Repository: https://github.com/pmsorhaindo/reddit-mcp
Architecture
Cursor / Grok Bot
│ OAuth (connect-card) against Reddit authorize/token
│ then MCP JSON-RPC with Bearer access token
▼
Cloudflare Worker (this repo)
│ POST /mcp → tools/list, tools/call
│ GET /.well-known/oauth-* → discovery pointing at Reddit
▼
https://oauth.reddit.com (User-Agent from env, Bearer passthrough)Route | Purpose |
| Liveness + endpoint map |
| MCP Streamable HTTP (JSON-RPC: |
| OAuth AS metadata (Reddit authorize/token) |
| Protected-resource metadata for this MCP URL |
| Dev landing page only — does not exchange codes |
Why minimal JSON-RPC (not the full MCP SDK)?
@modelcontextprotocol/sdk historically targeted Node transports. This Worker implements a Workers-native, dependency-light Streamable HTTP JSON-RPC surface (initialize / tools/list / tools/call) that matches what Cursor/Grok need for tool calling, without Durable Objects or session stores. That fits bearer passthrough: the Worker never holds Reddit refresh tokens.
Tools
Tool | Reddit API | Scopes |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
All tools return compact JSON (truncated text fields). limit defaults to 25, capped at 100.
Rate limiting
Outbound Reddit calls are serialized per Worker isolate (promise chain).
Response
X-Ratelimit-Remaining/X-Ratelimit-Resetare honored before the next call.HTTP 429 / 503 trigger bounded retries with
Retry-Afteror exponential backoff.
Secret hygiene
Never commit real secrets.
Strong
.gitignorecovers.env,.dev.vars,.wrangler/,node_modules/,dist/,credentials*.json,.mcp-auth/.Only example env files are committed:
.dev.vars.example,.env.example.wrangler.tomlhas no inline secrets.Errors and
consolelogs never includeAuthorizationheaders, tokens, or secret env values.Tool error payloads are status/message only — no upstream response bodies that might echo credentials.
Related MCP server: reddit-mcp
Reddit app setup
Create a Reddit app at https://www.reddit.com/prefs/apps (type web app or installed app as appropriate for your client).
Add redirect URIs:
http://localhost:8787/callback— local wrangler / manual testinghttps://www.cursor.com/agents/mcp/oauth/callback— Cursor connect-card
Request scopes (comma-separated in Reddit authorize URLs):
identity,read,mysubreddits,history
Note
client_id/client_secretfor the OAuth client (Cursor / your secrets manager). Do not put them in this repo or inwrangler.toml.
OAuth discovery assumptions
/.well-known/oauth-authorization-serveradvertises:authorization_endpoint:https://www.reddit.com/api/v1/authorizetoken_endpoint:https://www.reddit.com/api/v1/access_token
This Worker does not perform authorization-code exchange and does not store refresh tokens.
Cursor/Grok complete OAuth with Reddit (using the Reddit app credentials you configure in the client), then send
Authorization: Bearer <access_token>on MCP requests.issuerin the metadata is this Worker's origin so MCP clients can discover docs from the MCP base URL; authorize/token still happen on Reddit.Reddit scopes are traditionally comma-separated on the authorize URL — clients must join scopes accordingly.
Cloudflare deploy
Prerequisites: Node 22+, Cloudflare account, Wrangler logged in (npx wrangler login).
git clone https://github.com/pmsorhaindo/reddit-mcp.git
cd reddit-mcp
npm install
# Local secrets (gitignored)
cp .dev.vars.example .dev.vars
# edit USER_AGENT — must identify you per Reddit API rules
npm run typecheck
npm run dev # http://127.0.0.1:8787
# Production secret (not committed)
npx wrangler secret put USER_AGENT
npm run deployUSER_AGENT example shape (placeholder only):
cloudflare-worker:reddit-mcp:0.1.0 (by /u/YOUR_REDDIT_USERNAME)After deploy, note the workers.dev or custom domain URL, e.g. https://reddit-mcp.<account>.workers.dev.
Add MCP server (Cursor / Grok)
Configure AddMcpServer (or equivalent connect-card) with:
Field | Value |
URL |
|
Auth | OAuth (connect-card) |
Scopes |
|
The client should use your Reddit app's client id/secret and the Cursor redirect URI above. After auth, MCP tool calls must include the Reddit access token as a Bearer header; this Worker forwards it upstream.
Smoke tests
Replace $BASE and $TOKEN locally — do not commit tokens.
BASE=http://127.0.0.1:8787
TOKEN=reddit_access_token_here
# Health
curl -sS "$BASE/health"
# OAuth metadata
curl -sS "$BASE/.well-known/oauth-authorization-server"
curl -sS "$BASE/.well-known/oauth-protected-resource"
# MCP initialize
curl -sS -X POST "$BASE/mcp" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"smoke","version":"0"}}}'
# tools/list
curl -sS -X POST "$BASE/mcp" \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
# tools/call get_me (requires valid Bearer)
curl -sS -X POST "$BASE/mcp" \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $TOKEN" \
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_me","arguments":{}}}'Expected: JSON-RPC results; get_me returns compact profile fields. Missing Bearer → JSON-RPC error Unauthorized without leaking headers.
Scripts
Script | Command |
|
|
|
|
|
|
Out of scope
Writing, voting, messaging, moderation, or Ads API
Storing Reddit refresh tokens or client secrets on the Worker
Performing OAuth code exchange on
/callbackFull MCP resources/prompts/sampling/elicitation sessions
Multi-tenant token vaults / Durable Object session stores
Guaranteeing cross-isolate global rate-limit coordination (limits are per isolate + Reddit headers)
License
Private / unpublished unless you add a license file.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Reddit MCP server: search posts, subreddit feeds, comments & user profiles as JSON. No API key.
Reddit MCP — public Reddit data via JSON endpoints (no auth required)
Reddit & X data for AI agents over MCP. Semantic search, hosted, no Reddit API.
Read-only Reddit search API for AI agents: posts, comments, comment trees, subreddit rules.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that provides both read-only and authenticated access to Reddit content and interactions without requiring a developer API key. It enables users to browse posts, search subreddits, and perform write actions like commenting and voting by leveraging browser session cookies.81The Unlicense
- FlicenseNot gradedqualityDmaintenanceA read-only Model Context Protocol server that enables browsing subreddits, searching within subreddits, retrieving comment trees, and looking up user activity on Reddit via natural language.
- AlicenseNot gradedqualityDmaintenanceA read-only MCP server that connects to the Reddit Data API to search posts, browse subreddits, read comments, view user profiles, and check trending content through the Model Context Protocol.121MIT
- AlicenseNot gradedqualityCmaintenanceRead-only MCP server for public Reddit content using TypeScript. Enables listing posts, fetching post details and comments, and searching Reddit.322MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pmsorhaindo/reddit-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server