Reddit MCP Server for AI Agents
FetchLayer's Reddit MCP server works with Claude Desktop, Claude Code, Cursor, Windsurf, VS Code, and more. Pick your tool and connect in under a minute.
Short answer: FetchLayer runs a remote Reddit MCP server at https://mcp.fetchlayer.dev with 16 Reddit tools: keyword search for posts and comments, full threads with nested comment trees, subreddit feeds and date ranges, user histories and trending communities. It works in Claude, Claude Code, Cursor, Windsurf, VS Code, KiloCode, OpenClaw and Hermes, with no Reddit account or app. Calls cost the same as the REST API, $1.99 per 1,000 requests, and the first 30 are free. Below is the exact setup for every client.
Every client connects to the same server. Only two things change from one client to the next: where the config lives, and what it calls the URL field.
Before you start
- Get a key. Create a FetchLayer API key; it starts with
ss-. Claude’s connector signs in with your account instead and needs no key. - Pick the URL. For Reddit only, use
https://mcp.fetchlayer.dev/?platforms=reddit. That address lists just the 16 Reddit tools. Without the parameter, the server lists every platform (over 200 tools), and some clients cap the total: Windsurf loads at most 100 tools across all servers, VS Code’s Copilot 128. If you also want X/Twitter, use?platforms=reddit,twitter.
Pick your client
| Client | Where the config goes | Notes |
|---|---|---|
| Claude (web, desktop, mobile) | Customize → Connectors → Add custom connector | Signs in, no key |
| Claude Code | One claude mcp add command | |
| Cursor | ~/.cursor/mcp.json or .cursor/mcp.json | url + headers |
| Windsurf | ~/.codeium/windsurf/mcp_config.json | serverUrl, 100-tool cap |
| VS Code (Copilot) | .vscode/mcp.json | servers, type: "http", 128-tool cap |
| KiloCode | KiloCode’s mcp_settings.json | needs type: "streamable-http" |
| OpenClaw | mcp.servers in OpenClaw config | transport: "streamable-http" |
| Hermes Agent | ~/.hermes/config.yaml | YAML mcp_servers |
| No MCP: plain tools | Your own agent loop | Three tool schemas and a dispatcher |
In every example below, replace ss-your-fetchlayer-key with your key.
Claude
Claude’s desktop app doesn’t load remote servers from claude_desktop_config.json: a bare url entry there is dropped without an error. Add FetchLayer as a custom connector instead:
- In Claude, open Customize → Connectors → Add custom connector.
- Name it
fetchlayerand pastehttps://mcp.fetchlayer.dev. - Click Connect and sign in to FetchLayer.
The connector works in Claude on the web, desktop and mobile. The step-by-step guide, with the approval flow and a full research session, is Connect Reddit MCP to Claude Desktop.
Claude Code
One command writes the config:
claude mcp add --transport http fetchlayer "https://mcp.fetchlayer.dev/?platforms=reddit" \
--header "Authorization: Bearer ss-your-fetchlayer-key"Start Claude Code and the tools are available. For config scopes, an end-to-end workflow and combining Reddit with your codebase, see Search Reddit from Claude Code.
Cursor
Cursor reads mcp.json globally (~/.cursor/mcp.json, every project) or per project (.cursor/mcp.json). Create the file if it doesn’t exist:
{
"mcpServers": {
"fetchlayer": {
"url": "https://mcp.fetchlayer.dev/?platforms=reddit",
"headers": {
"Authorization": "Bearer ss-your-fetchlayer-key"
}
}
}
}If you already have servers configured, add the fetchlayer block next to them. When both files define a server with the same name, the project file wins for that workspace, which is handy for using a different key in one repo.
Reload the window (Ctrl/Cmd+Shift+P → Reload Window). Settings → MCP shows a green dot when the server is connected. Cursor asks you to approve the first tool call in a session; auto-run for MCP tools is a broad setting that covers every server, so review it before turning it on.
A good use in an editor: ask the agent to turn real posts into test fixtures (“search r/rust for async questions, take 10, and write them as fixtures for these parser tests”). Real posts carry what hand-written fixtures miss: [deleted] authors, empty bodies, 8,000-character posts, emoji in titles.
Windsurf
Windsurf calls the remote address serverUrl, not url. Open Settings → MCP Configuration, or edit ~/.codeium/windsurf/mcp_config.json (%USERPROFILE%\.codeium\windsurf\mcp_config.json on Windows):
{
"mcpServers": {
"fetchlayer": {
"serverUrl": "https://mcp.fetchlayer.dev/?platforms=reddit",
"headers": {
"Authorization": "Bearer ss-your-fetchlayer-key"
}
}
}
}Keep ?platforms=reddit: Cascade loads at most 100 tools across every server, so the full tool list would push other servers’ tools out. Restart Windsurf; the MCP panel shows a green indicator when connected. Windsurf meters agent actions with its own credits, and an MCP tool call counts like any other action.
VS Code
VS Code’s Copilot agent mode reads .vscode/mcp.json in the workspace. The top-level key is servers (not mcpServers), and the server needs "type": "http". Because this file lives in your repo, keep the key out of it with an input prompt:
{
"inputs": [
{
"type": "promptString",
"id": "fetchlayer-key",
"description": "FetchLayer API key",
"password": true
}
],
"servers": {
"fetchlayer": {
"type": "http",
"url": "https://mcp.fetchlayer.dev/?platforms=reddit",
"headers": {
"Authorization": "Bearer ${input:fetchlayer-key}"
}
}
}
}VS Code asks for the key once and stores it. Copilot sends at most 128 tools per request, so keep the platforms filter. Reload the window, accept the prompt to trust the new server, and use Copilot Chat in agent mode. The first call in a session shows an approval prompt with the exact request.
KiloCode
KiloCode has its own MCP settings, separate from VS Code’s .vscode/mcp.json. In KiloCode’s MCP panel choose Edit Global MCP (the file is mcp_settings.json under VS Code’s globalStorage/kilocode.kilo-code/settings/) and add:
{
"mcpServers": {
"fetchlayer": {
"type": "streamable-http",
"url": "https://mcp.fetchlayer.dev/?platforms=reddit",
"headers": {
"Authorization": "Bearer ss-your-fetchlayer-key"
}
}
}
}Don’t leave out "type": "streamable-http": without it KiloCode falls back to the older SSE transport and the connection fails. KiloCode’s modes have different tool permissions; if an answer arrives instantly with no tool-call block in the transcript, check the mode before the config. With auto-approve on, give the agent a limit in the prompt (“open at most 3 threads”) so an unattended run stays small.
OpenClaw
OpenClaw keeps MCP servers under mcp.servers in its config. The quickest way is the CLI:
openclaw mcp set fetchlayer '{"url":"https://mcp.fetchlayer.dev/?platforms=reddit","transport":"streamable-http","headers":{"Authorization":"Bearer ${FETCHLAYER_API_KEY}"}}'Or edit the config directly:
{
"mcp": {
"servers": {
"fetchlayer": {
"url": "https://mcp.fetchlayer.dev/?platforms=reddit",
"transport": "streamable-http",
"headers": {
"Authorization": "Bearer ${FETCHLAYER_API_KEY}"
}
}
}
}
}Set FETCHLAYER_API_KEY in the gateway’s environment so the key never sits in the file; openclaw mcp doctor warns about literal secrets in headers. Because OpenClaw runs autonomously, write objectives with a ceiling (“search r/selfhosted for URL shorteners, open at most 5 threads, then stop”) and ask it to cite each thread’s URL, so you can check what it read.
Hermes
Hermes Agent reads mcp_servers from ~/.hermes/config.yaml:
mcp_servers:
fetchlayer:
url: "https://mcp.fetchlayer.dev/?platforms=reddit"
headers:
Authorization: "Bearer ss-your-fetchlayer-key"Restart Hermes. For unattended runs, put the bounds in the task itself (how many searches, how many threads), and ask for the permalink of every post it quotes.
As an agent skill, without MCP
If your framework doesn’t speak MCP (a custom loop, or an SDK where you register tools yourself), give the agent Reddit as ordinary tools. Each tool is a JSON schema plus one dispatcher that calls the REST API, and errors go back to the model as data so it can fix its own call:
// Reddit as plain agent tools, for frameworks without MCP.
// One schema per tool; one dispatcher that calls FetchLayer.
const tools = [
{
name: 'search_reddit',
endpoint: 'search',
description: 'Search Reddit posts by keyword, optionally inside one subreddit. sort: relevance, new, top, comments or hot.',
input_schema: {
type: 'object',
properties: {
query: { type: 'string' },
subreddit: { type: 'string' },
sort: { type: 'string', enum: ['relevance', 'new', 'top', 'comments', 'hot'] },
time: { type: 'string', enum: ['hour', 'day', 'week', 'month', 'year', 'all'] },
},
required: ['query'],
},
},
{
name: 'read_thread',
endpoint: 'post',
description: 'A Reddit post and its comment tree, by URL.',
input_schema: { type: 'object', properties: { url: { type: 'string' } }, required: ['url'] },
},
{
name: 'subreddit_posts',
endpoint: 'community-posts',
description: "A subreddit's posts. sort: hot, new, top or rising.",
input_schema: {
type: 'object',
properties: { subreddit: { type: 'string' }, sort: { type: 'string', enum: ['hot', 'new', 'top', 'rising'] } },
required: ['subreddit'],
},
},
];
async function runTool(name, input) {
const tool = tools.find((t) => t.name === name);
if (!tool) throw new Error(`unknown tool ${name}`);
const res = await fetch(`https://api.fetchlayer.dev/reddit/${tool.endpoint}`, {
method: 'POST',
headers: { Authorization: `Bearer ${process.env.FETCHLAYER_API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify(input),
});
const body = await res.json();
// Give the model the error as data, so it can correct its own call.
return res.ok ? body : { error: body.error, code: body.code, retryable: body.retryable };
}
// What your agent loop does when the model asks for a tool:
const found = await runTool('search_reddit', { query: 'postgres vs mysql', sort: 'top', time: 'year' });
console.log('search_reddit ->', found.items.length, 'posts');
const thread = await runTool('read_thread', { url: found.items[0].permalink });
console.log('read_thread ->', thread.title, '|', thread.comments.length, 'top-level comments');
console.log('bad call ->', await runTool('subreddit_posts', {}));We ran it on 12 November 2026: search_reddit returned 7 posts, read_thread returned the top thread with 31 top-level comments, and the bad call came back as invalid_input instead of throwing. The input_schema shape is Anthropic’s tool format; for OpenAI, rename it parameters.
Three tools cover most agent work:
- Research before you build: “Search Reddit for complaints about our competitor’s onboarding from the past year, read the three most-discussed threads, and list the recurring problems with links.”
- Find where people ask for what you sell: “Find recent posts in r/smallbusiness and r/Entrepreneur asking for an invoicing tool, and summarise what each poster needs.”
- Answer with sources: “Before answering, search Reddit for real experiences with this library and quote the posts you used.”
For more endpoints and languages, see Reddit API code examples.
What the agent can do: the 16 Reddit tools
| Tool | What it returns |
|---|---|
scrape_search | Posts matching a keyword, across Reddit or in one subreddit |
scrape_search_comments | Comments matching a keyword |
scrape_post | A post with its nested comment tree |
scrape_more_comments | Replies a thread response didn’t include |
scrape_comment_permalink | One comment with its parent context |
scrape_community_posts | A subreddit’s feed, or its posts between two dates |
scrape_community_details | Subreddit metadata, subscribers, rules |
scrape_search_communities | Subreddits matching a keyword |
scrape_user_profile | Karma, bio, account age |
scrape_user_posts | A user’s posts |
scrape_user_comments | A user’s comments |
scrape_search_users | Users matching a name |
scrape_popular | Posts from r/popular |
scrape_leaderboard | Top and trending communities |
scrape_explore | Communities by topic |
resolve_url_type | What a Reddit URL points to |
Results are structured JSON, so the agent can sort on score, filter on subreddit and check commentCount before deciding a thread is worth opening. A scrape_community_posts item looks like this (trimmed):
{
"id": "1xmgv01",
"subreddit": "Python",
"title": "Pip 26.3 - Extended Pylock Support, Build Backend Warnings, and a caution on wheel installation",
"author": "zurtex",
"score": 79,
"commentCount": 7,
"createdAt": "2026-11-03T02:20:39.815Z",
"permalink": "https://www.reddit.com/r/Python/comments/1xmgv01/pip_263_extended_pylock_support_build_backend/",
"postType": "text"
}The REST API has the same 16 endpoints: see the Reddit API reference.
Prompts to try
- “Search Reddit for discussions comparing Tailwind and Bootstrap from the past month, and summarise the main arguments with links.”
- “Get this week’s top 10 posts from r/ExperiencedDevs.”
- “Before we pick this library, search Reddit for people who hit problems with it in production. Open only the 3 most-discussed threads.”
- “Find subreddits about DevOps and list their subscriber counts.”
- “List every post in r/selfhosted from the last 7 days that mentions backups.”
What a session costs
MCP calls use the same credits as REST calls: $1.99 per 1,000 requests pay-as-you-go, less on monthly plans, and failed calls are free (pricing).
- A search or subreddit feed bills per page of results returned (up to 25 posts on a feed).
- A thread with its comment tree bills 1 credit per 2 pages of comments read, so most threads cost 1.
- Reusing data already in the conversation costs nothing.
The cheapest pattern is “search broadly, then open selectively”. Saying how many threads to open is the single most effective way to keep a long or unattended session small.
Troubleshooting
- No tools appear. Check the file path for your client, validate the JSON or YAML (no trailing commas), and fully restart the app rather than reloading one window.
- “Invalid API key” or 401. The key must start with
ss-and be copied whole from the dashboard. The header isAuthorization: Bearer ss-…. - Windsurf or VS Code shows only some tools, or other servers’ tools disappear. You’re over the client’s tool cap: add
?platforms=redditto the URL. - KiloCode won’t connect. Add
"type": "streamable-http". - Claude Desktop ignores the server. Use a custom connector, not
claude_desktop_config.json. - “Out of credits” on a tool call. The server still connects and lists its tools, but calls are refused until you top up or subscribe.
What’s next
- Reddit Scraper API: the REST API behind these tools, with pricing
- How to Scrape Reddit in 2026: every method, not just MCP
- Reddit API code examples: Python, Node.js, TypeScript, Go and Bun
- Twitter/X MCP server: the same setup for X data
- Social media MCP servers compared: every platform on one server, and how other providers compare