Read-only MCP server for public Reddit content using TypeScript.
reddit.list_subreddit_postsreddit.get_postreddit.get_commentsreddit.searchreddit.read_large_result
- No write/create/edit/delete operations.
- No OAuth flow.
- No RSS fallback yet (see
docs/rss-fallback-plan.md).
Primary runtime is Bun. Node fallback is also possible.
bun installbun run devnpm install
npm run start:node{
"mcpServers": {
"reddit": {
"command": "bun",
"args": ["run", "/absolute/path/to/reddit-mcp/src/index.ts"],
"env": {
"REDDIT_USER_AGENT": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
}
}
}
}{
"mcpServers": {
"reddit": {
"command": "npx",
"args": ["tsx", "/absolute/path/to/reddit-mcp/src/index.ts"],
"env": {
"REDDIT_USER_AGENT": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
}
}
}
}When Claude says tool output is too large and gives a file path, read it in chunks with:
reddit.read_large_resultwithfilePath,offset,limit- Start with
offset=0,limit=8000 - Use returned
nextOffsetuntildone=true
- Public data only.
REDDIT_USER_AGENTcan be customized in Claude MCP config.- Handle 429/403 upstream responses in the client workflow.
- Tool payload size protection is enabled in MCP responses:
limitis capped (search/listmax 25,commentsmax 50).- Long text fields are truncated server-side.
- If output is still too large, MCP returns a compact truncation message.
- Optional env:
MCP_MAX_OUTPUT_CHARS(default60000) to tune max response size sent to Claude.MCP_TOOL_RESULTS_ROOTS(comma-separated, default/sessions) to control which file roots are readable byreddit.read_large_result.