Skip to main content
Glama
aasper03
by aasper03
README.md
# reddit-mcp

Headless Reddit MCP server for Cursor. Posts replies using your logged-in Chrome session cookies (via Chrome DevTools Protocol), driving old.reddit.com's comment form.

> Reddit's official script OAuth apps are gated behind approval. This uses your own browser session instead.

## Tools

| Tool | Purpose |
| --- | --- |
| `reddit_whoami` | Current session username |
| `reddit_refresh_session` | Pull fresh cookies from CDP Chrome (`:9222`) |
| `reddit_reply` | Reply to a post/comment URL |
| `reddit_test_reply` | Harmless test comment on r/test |

## Requirements

- Python 3.11+
- Playwright Chromium
- Chrome running with remote debugging, logged into Reddit:
  ```bash
  google-chrome --remote-debugging-port=9222 --user-data-dir="$HOME/.config/google-chrome-cdp"
  ```

## Install

```bash
git clone https://github.com/aasper03/reddit-mcp.git ~/.reddit-mcp
cd ~/.reddit-mcp
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/playwright install chromium
chmod +x run-reddit-mcp.sh
```

Add to `~/.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "reddit": {
      "command": "/home/YOU/.reddit-mcp/run-reddit-mcp.sh",
      "args": []
    }
  }
}
```

Optional: `REDDIT_CDP_URL` (default `http://127.0.0.1:9222`).

## CLI

```bash
# after install, symlink optional:
ln -sf ~/.reddit-mcp/run-reddit-mcp.sh /dev/null  # MCP only

# or use the client via:
.venv/bin/python -c 'from client import get_username; print(get_username())'
```

## License

MIT — personal automation; follow Reddit's rules. Not affiliated with Reddit.

Maintenance

ActivityMaintained
ResponsivenessNo issues