reddit-agent-publisher
Enables AI agents to prepare, preview, and get human approval before publishing Reddit posts and comments via a local authenticated browser session, without Reddit API credentials.
README
Reddit Agent Publisher
A self-hosted, human-approved Reddit publishing bridge for AI agents and MCP clients.
Reddit Agent Publisher connects a narrow application interface to your own authenticated Reddit browser session. It does not require Reddit Data API credentials: authentication stays inside Chrome while the application manages drafts, live previews, approvals, local state, and audit history.
The core workflow is deliberately simple:
prepare → preview → approve → execute

Nothing is submitted during preparation or preview. An external change is only executed after approval of the exact current preview.
Why this project exists
Generic browser agents are powerful, but they also expose a very large browser surface. Reddit Agent Publisher narrows that surface to a small publishing-oriented interface with explicit state transitions and approval checks.
Instead of giving an AI agent unrestricted browser control, the agent works through a purpose-built publisher layer that knows about Reddit posts, comments, edits, deletes, subreddit rules, flairs, previews, and approval state.
Features
| Capability | Status |
|---|---|
| Create Reddit posts | ✅ |
| Create comments / replies | ✅ |
| Edit own content | ✅ |
| Delete own content | ✅ |
| Read subreddit rules | ✅ |
| Discover post flairs | ✅ |
| Live browser preview | ✅ |
| MCP server | ✅ |
| CLI | ✅ |
| Local SQLite state | ✅ |
| Hash-chained audit events | ✅ |
| OpenAPI 3.1 contract | ✅ |
| Hosted HTTP / GPT Actions gateway | Not bundled in the public edition |
Architecture
flowchart LR
A[AI agent / MCP client / CLI] --> B[PublisherService]
B --> C[(SQLite state)]
B --> D[Reddit browser adapter]
D --> E[Playwright + local CDP]
E --> F[User-owned Chrome]
F --> G[Reddit]
B --> H[Live preview]
H --> I{Owner approval}
I -->|approved| J[Execute exact preview]
I -->|not approved| K[No external change]
Requirements
- Node.js 22+
- npm
- Chrome, Chromium, or Chrome for Testing
- a Reddit account
Quick start
git clone https://github.com/Bl0ck154/reddit-agent-publisher.git
cd reddit-agent-publisher
npm ci
npm run build
The public edition connects to a local Chrome DevTools Protocol endpoint. Chrome is started and controlled by you; this project does not store your Reddit password or manage browser credentials.
Default endpoint:
http://127.0.0.1:9222
A typical local Chrome launch looks like this:
google-chrome --remote-debugging-port=9222 --user-data-dir="$HOME/.reddit-agent-publisher-chrome"
Executable names differ between operating systems and Chrome distributions. Log in to Reddit manually in that Chrome profile, then keep the browser available while the publisher is running.
To use another local CDP port:
export PUBLISHER_CDP_URL=http://127.0.0.1:9333
Remote CDP hosts are intentionally rejected.
MCP setup
After building the project, point your MCP client at dist/mcp.js.
Example configuration:
{
"mcpServers": {
"reddit-agent-publisher": {
"command": "node",
"args": ["/absolute/path/reddit-agent-publisher/dist/mcp.js"]
}
}
}
The MCP server exposes a narrow tool set around the publishing state machine, including preparation, preview, approval, execution, account status, subreddit rules, flair discovery, pending drafts, and diagnostics.
CLI
The repository also includes src/cli.ts, compiled to dist/cli.js.
node dist/cli.js --help
node dist/cli.js status
node dist/cli.js doctor
The CLI and MCP server use the same PublisherService, state database, validation rules, and approval model.
Approval and safety model
A few design decisions are intentional:
- Preview first. The Reddit form is prepared before any external mutation.
- Digest-bound approval. Approval is tied to the exact preview digest and revision.
- Expiring approval. Old approvals cannot be reused indefinitely.
- Canonical targets. Edit/delete operations are bound to canonical Reddit post/comment URLs.
- Local browser boundary. The CDP endpoint must resolve to localhost.
- Account write lock. Concurrent mutations for the same account are rejected.
- Audit trail. Local audit events are hash-chained.
- Manual authentication challenges. CAPTCHA, 2FA, consent, and account challenges stay in the user-owned browser.
Local state
By default, application state is stored under:
~/.local/share/reddit-agent-publisher
You can override this with PUBLISHER_STATE_DIR.
The state directory contains the SQLite database, preview artifacts, and temporary files. Runtime state, databases, logs, and environment files are excluded by .gitignore.
OpenAPI / GPT Actions
src/actions-schema.ts contains a Reddit-only OpenAPI 3.1 contract for integrations that want an HTTP layer.
The public repository currently does not bundle a hosted HTTP gateway. The schema is included as an integration boundary, while the working public interfaces are the CLI and MCP server.
Project structure
src/
├── adapters/
│ ├── base.ts
│ └── reddit-browser.ts
├── tests/
├── actions-schema.ts
├── cli.ts
├── config.ts
├── db.ts
├── external-chrome.ts
├── mcp.ts
├── service.ts
└── types.ts
Development
npm ci
npm run check
npm run check builds the TypeScript project and runs the test suite. The same check runs in GitHub Actions on pushes and pull requests.
Release history
See CHANGELOG.md for notable changes. Published versions are available under GitHub Releases.
Limitations
Reddit Agent Publisher works against the website UI, so Reddit frontend changes can require selector maintenance. It is not intended to hide automation from Reddit or bypass account challenges. Authentication, CAPTCHA, 2FA, consent, and similar user-verification steps remain manual.
This project is not affiliated with or endorsed by Reddit.
Contributing
See CONTRIBUTING.md. Security-related reports should follow SECURITY.md.
License
MIT — see LICENSE.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。