{"id":51060453,"url":"https://github.com/selamy-labs/reddit-mcp","last_synced_at":"2026-06-23T01:31:04.709Z","repository":{"id":365572303,"uuid":"1272076219","full_name":"selamy-labs/reddit-mcp","owner":"selamy-labs","description":"reddit-mcp — a small, terms-aware MCP server exposing read-only Reddit research as typed tools.","archived":false,"fork":false,"pushed_at":"2026-06-17T22:51:15.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-18T00:20:57.776Z","etag":null,"topics":["autonomous-agent","mcp","model-context-protocol","reddit","research"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/selamy-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-17T09:10:16.000Z","updated_at":"2026-06-17T22:51:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/selamy-labs/reddit-mcp","commit_stats":null,"previous_names":["selamy-labs/reddit-mcp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/selamy-labs/reddit-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selamy-labs%2Freddit-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selamy-labs%2Freddit-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selamy-labs%2Freddit-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selamy-labs%2Freddit-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/selamy-labs","download_url":"https://codeload.github.com/selamy-labs/reddit-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/selamy-labs%2Freddit-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34672250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autonomous-agent","mcp","model-context-protocol","reddit","research"],"created_at":"2026-06-23T01:31:03.292Z","updated_at":"2026-06-23T01:31:04.700Z","avatar_url":"https://github.com/selamy-labs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# reddit-mcp\n\n[![CI](https://github.com/selamy-labs/reddit-mcp/actions/workflows/test.yml/badge.svg)](https://github.com/selamy-labs/reddit-mcp/actions/workflows/test.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)\n\n`reddit-mcp` is a small [Model Context Protocol](https://modelcontextprotocol.io)\nserver that exposes **read-only Reddit research** as typed tools. It turns the\n\"call Reddit\" capability that previously lived as prose in the `reddit-research`\nskill into callable tools, with the terms-aware and rate-limit discipline baked\ninto the server rather than left to the caller.\n\nReddit is a noisy public-discussion source, not ground truth. Use these tools\nfor trend discovery, theme-finding, and hypothesis generation, and check\nhigh-value claims against independent sources.\n\n## Tools\n\n| Tool | Purpose |\n| --- | --- |\n| `reddit_search(query, subreddit?, sort?, time?, limit?)` | Search Reddit, optionally scoped to one subreddit. |\n| `reddit_subreddit_top(subreddit, time?, limit?)` | A subreddit's top posts for a time window. |\n| `reddit_get_post(id)` | A single post's metadata by base-36 id. |\n| `reddit_get_comments(post_id, limit?)` | Top-level comments for a post (flags `has_more`). |\n\n`sort` is one of `relevance`/`hot`/`top`/`new`/`comments`; `time` is one of\n`hour`/`day`/`week`/`month`/`year`/`all`. Every result carries a `lineage`\nblock (`source`, `access_path`, `url`, `retrieved_at`) so findings can be cited\nand re-verified.\n\n## Access \u0026 terms\n\n- **Read-only.** The server only reads Reddit's public `.json` endpoints. It\n  never writes, votes, or posts.\n- **Polite by default.** A descriptive `User-Agent`, minimum spacing between\n  requests, and exponential backoff with jitter on `429`/`5xx` keep low-volume\n  discovery within Reddit's documented envelope. A `Retry-After` header on a\n  rate-limit response is honoured when present. `401`/`403`/`404` surface\n  immediately as errors (often a datacenter/CI IP block, removed content, or an\n  auth requirement).\n- **Escalate when needed.** For higher volume, OAuth, or reliable comment-tree\n  pagination, set `REDDIT_BEARER_TOKEN` to use the authenticated API host\n  (`oauth.reddit.com`). Obtain a token per Reddit's API terms.\n\nReddit's public JSON surface is **not** a stable contract; validate current\nbehavior from the real runtime before depending on a path.\n\n## Configuration (environment, resolved at call time)\n\n| Variable | Effect |\n| --- | --- |\n| `REDDIT_USER_AGENT` | Override the default descriptive UA. |\n| `REDDIT_BEARER_TOKEN` | When set, requests use the authenticated API host. **Never embed this in code or config files.** |\n\nCredentials are read from the environment when a request is made and are never\nbaked into the package.\n\n## Install\n\nRun directly from GitHub with the MCP extra:\n\n```bash\nuvx --from \"git+https://github.com/selamy-labs/reddit-mcp@v0.1.0#egg=reddit-mcp[mcp]\" reddit-mcp\n```\n\nOr with pipx:\n\n```bash\npipx install \"reddit-mcp[mcp] @ git+https://github.com/selamy-labs/reddit-mcp@v0.1.0\"\n```\n\n## MCP client config\n\n```json\n{\n  \"mcpServers\": {\n    \"reddit\": {\n      \"command\": \"uvx\",\n      \"args\": [\n        \"--from\",\n        \"git+https://github.com/selamy-labs/reddit-mcp@v0.1.0#egg=reddit-mcp[mcp]\",\n        \"reddit-mcp\"\n      ],\n      \"env\": {\n        \"REDDIT_USER_AGENT\": \"your-app/1.0 (research; +https://example.com)\"\n      }\n    }\n  }\n}\n```\n\n## Observability (OpenTelemetry)\n\nThe server runs unmodified under\n[OpenTelemetry zero-code auto-instrumentation](https://opentelemetry.io/docs/zero-code/python/).\nInstall the `otel` extra and launch via `opentelemetry-instrument`:\n\n```bash\npipx install \"reddit-mcp[mcp,otel] @ git+https://github.com/selamy-labs/reddit-mcp@v0.1.0\"\nOTEL_SERVICE_NAME=reddit-mcp \\\nOTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317 \\\nOTEL_TRACES_EXPORTER=otlp \\\n  opentelemetry-instrument reddit-mcp\n```\n\nConfig is **vendor-neutral** — point `OTEL_EXPORTER_OTLP_ENDPOINT` at any OTLP\ncollector; the collector (not this server) owns any Cloud Trace / vendor coupling.\n\n\u003e **stdio safety (required):** this server speaks MCP over stdin/stdout, so its\n\u003e stdout carries the JSON-RPC protocol. Export traces/logs via **OTLP only** —\n\u003e **never** set `OTEL_TRACES_EXPORTER=console` (or any stdout exporter), which\n\u003e would interleave span output into the protocol stream and break the client.\n\n## Architecture\n\nThe Reddit logic lives once in `reddit_mcp.core.RedditClient`; the MCP server in\n`reddit_mcp.mcp_server` is a thin wrapper that serialises structured results to\nJSON and maps expected failures to `ToolError`. All network access goes through\nan **injected transport** (`reddit_mcp.transport`), and all timing through an\ninjected clock, so the full request/parse/backoff path is exercised offline in\ntests with canned fixtures. The default `UrllibTransport` uses only the standard\nlibrary, so the core package has zero runtime dependencies; the `mcp` SDK is an\noptional extra needed only to run the server.\n\n## Development\n\n```bash\npython -m pip install -e \".[test]\"\nruff format --check .\nruff check .\ncoverage run -m pytest\ncoverage report --fail-under=95\n```\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselamy-labs%2Freddit-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fselamy-labs%2Freddit-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fselamy-labs%2Freddit-mcp/lists"}