Megahorn
Allows posting content to Reddit subreddits via OAuth2 authentication, with support for multiple subreddits and auto-refresh of tokens.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Megahornpost 'We shipped AI analytics' to Twitter and LinkedIn"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Megahorn
One binary to rule them all. Cross-post to social media from your terminal or let AI agents do it for you.
You: "promote our new feature"
Claude: crafts platform-specific posts, shows you for approval
You: "looks good"
Claude: megahorn_post → Twitter, LinkedIn, Reddit → doneMegahorn is a standalone Go CLI + MCP server. It handles authentication and publishing — your API keys never leave your machine, never enter an AI conversation.
Why Megahorn?
Single binary —
go installand you're done. No Node.js, no Python, no Docker.Three platforms, one command — Twitter, LinkedIn, Reddit. More coming.
AI-native — Ships as an MCP server. Claude Code, Cursor, or any MCP client can post on your behalf.
Secure by design — Credentials live in your OS keychain. The MCP server is the security boundary.
Product-agnostic — Works for any project. The AI skill reads your repo's context automatically.
Free — No paid Twitter API. Browser automation for Twitter, free OAuth for LinkedIn and Reddit.
Related MCP server: linkedin-mcp
Installation
1. Install the binary
# Option A: Go install
go install github.com/rajpootathar/megahorn@latest
# Option B: From source
git clone https://github.com/rajpootathar/megahorn.git
cd megahorn && make build
sudo mv megahorn /usr/local/bin/2. Install the AI skill (optional)
npx skills add rajpootathar/megahornThis installs the social-post skill for Claude Code, Cursor, or any compatible AI agent. The skill teaches the agent how to write platform-adapted content and call Megahorn's MCP tools.
3. Register MCP server (optional)
megahorn install
# Restart your AI agent to activateThis adds Megahorn to your Claude Code MCP settings so the agent can call megahorn_post, megahorn_auth_status, and megahorn_auth as native tools.
Quick Start
Authenticate
megahorn auth twitter # Opens Chrome — log in manually, handle 2FA
megahorn auth linkedin # OAuth2 flow — opens browser for consent
megahorn auth reddit # OAuth2 flow — opens browser for consent
megahorn auth status # Check what's connected$ megahorn auth status
Platform Status
------------------------------
twitter + authenticated
linkedin + authenticated
reddit x not_configuredPost
# To specific platforms
megahorn post -t "Just shipped journey tracking"
megahorn post -t -l "We cut query time from 12s to 40ms"
megahorn post -r --subreddit SaaS,startups "Launched our analytics dashboard"
# To all authenticated platforms
megahorn post --all "Big announcement today"
# Preview without posting
megahorn post --dry-run -t -l -r --subreddit webdev "test post"
# From a file
megahorn post --file announcement.md -t -l
# JSON output (for scripting / piping)
megahorn post --json --dry-run -t -l "test"$ megahorn post -t -l -r --subreddit SaaS "Shipped user journey tracking"
TWITTER: https://x.com/yourhandle/status/1234567890
LINKEDIN: https://www.linkedin.com/feed/update/urn:li:share:12345
REDDIT: https://reddit.com/r/SaaS/comments/abc123
3/3 published.Configure
megahorn config # Show current config
megahorn config set browser.headed true # Always use visible browser
megahorn config set platforms.defaults twitter,linkedin # Default platforms when no flags
megahorn config set browser.chrome_path /usr/bin/chromium # Custom Chrome pathPlatform Setup
Twitter uses browser automation via chromedp — no paid API needed.
Run
megahorn auth twitterChrome opens to twitter.com/login
Log in normally (2FA supported)
Press Enter in the terminal once you see your feed
Session cookies are saved to your OS keychain
Headed vs headless: Auth always opens a visible browser. Posting defaults to headless (background). Use --headed to watch it happen.
If selectors break: Twitter changes its DOM frequently. Megahorn uses data-testid attributes which are more stable, but if posting fails, you can update selectors without rebuilding:
# Override selectors at ~/.megahorn/selectors/twitter.yaml
compose_button: '[data-testid="SideNav_NewTweet_Button"]'
tweet_textarea: '[data-testid="tweetTextarea_0"]'
post_button: '[data-testid="tweetButtonInline"]'LinkedIn uses the Community Management API (free, OAuth2).
Create an app (any name works, e.g., "Megahorn")
Under Products, request "Share on LinkedIn" and "Sign In with LinkedIn using OpenID Connect"
Under Auth settings, add redirect URL:
http://localhost:8338/callbackRun
megahorn auth linkedin— enter your Client ID and Client SecretBrowser opens for OAuth consent — authorize and you're done
Token expiry: LinkedIn tokens last ~60 days. Megahorn warns you when a token is approaching expiry. Re-run megahorn auth linkedin to refresh.
Reddit uses OAuth2 web app type (free, no password storage).
Go to reddit.com/prefs/apps
Click "create another app"
Choose web app, set redirect URI to
http://localhost:8338/callbackRun
megahorn auth reddit— enter your Client ID and Client SecretBrowser opens for consent — authorize and you're done
Token refresh: Reddit tokens expire hourly. Megahorn auto-refreshes using the stored refresh token — you won't notice.
Multi-subreddit: Post to multiple subreddits in one command:
megahorn post -r --subreddit SaaS,startups,webdev "Your post title\nYour post body"First line = title, rest = body.
MCP Server
Megahorn doubles as an MCP server, letting AI agents post to social media through native tool calls.
megahorn server # Starts stdio JSON-RPC serverAvailable Tools
Tool | Description | Parameters |
| Post content to a platform |
|
| Check authenticated platforms | — |
| Start auth flow (opens browser) |
|
Configuration
Add to your AI agent's MCP settings:
{
"mcpServers": {
"megahorn": {
"command": "megahorn",
"args": ["server"]
}
}
}Or run megahorn install to auto-configure Claude Code.
How AI Agents Use It
With the social-post skill installed, an AI agent will:
Read your project's CLAUDE.md, docs, and recent git history
Understand what you're promoting
Write platform-specific content (280ch tweet, LinkedIn thought-piece, Reddit discussion)
Show you the posts for approval
Call
megahorn_postfor each approved platformReport back with published URLs
The agent crafts the content. Megahorn handles the publishing. Your keys stay local.
Architecture
┌──────────────────┐ ┌─────────────────────┐
│ You (terminal) │────>│ │───> Twitter (Chrome CDP)
│ $ megahorn post │ │ │
└──────────────────┘ │ megahorn │───> LinkedIn (REST API)
│ (Go binary) │
┌──────────────────┐ │ │───> Reddit (REST API)
│ AI Agent (MCP) │────>│ Credentials: │
│ Claude / Cursor │ │ OS keychain │
└──────────────────┘ │ never in context │
└─────────────────────┘Project Structure
megahorn/
├── cmd/ # CLI commands (cobra)
│ ├── auth.go # megahorn auth
│ ├── post.go # megahorn post
│ ├── server.go # megahorn server (MCP)
│ ├── config.go # megahorn config
│ └── install.go # megahorn install
├── internal/
│ ├── platform/ # Platform interface + implementations
│ │ ├── twitter.go # chromedp browser automation
│ │ ├── linkedin.go # OAuth2 REST API
│ │ └── reddit.go # OAuth2 REST API
│ ├── mcp/ # MCP server + tool handlers
│ ├── auth/ # Keyring, OAuth2, browser open
│ ├── browser/ # Chrome launcher, selectors
│ └── config/ # YAML config management
├── skills/
│ └── social-post/
│ └── SKILL.md # AI agent skill (npx skills add)
├── selectors/
│ └── twitter.yaml # Default Twitter DOM selectors
└── package.json # For npx skills add discoveryCLI Reference
megahorn [command]
Commands:
auth [platform] Authenticate with a platform (twitter, linkedin, reddit)
auth status Show auth status for all platforms
post [content] Post content to platforms
server Start MCP server (stdio)
config Show configuration
config set [k] [v] Set a config value
install Configure MCP in Claude Code
version Print version
Post Flags:
-t, --twitter Post to Twitter
-l, --linkedin Post to LinkedIn
-r, --reddit Post to Reddit
-a, --all All authenticated platforms
--subreddit Comma-separated subreddits
--headed Visible browser for Twitter
--dry-run Preview without posting
-f, --file Read content from file
--json JSON output
Auth Flags:
--headed Visible browser (default: true)
--headless Headless browserSecurity
Layer | How |
At rest | OS keychain (macOS Keychain / Linux secret-service) |
In transit | HTTPS for APIs, WSS for Chrome CDP |
In AI context | Never. MCP tools are the boundary — agents send commands, never see keys |
Config files | Preferences only (browser mode, defaults). Zero secrets. |
Roadmap
v2 candidates (no timeline):
Bluesky, Dev.to, Hacker News, Mastodon, Discord, Hashnode, Product Hunt, Threads, Indie Hackers | Read feeds & comments | Media attachments | Twitter threads | Scheduling | Analytics | Windows support
Contributing
PRs welcome. The platform interface makes it easy to add new platforms:
type Platform interface {
Name() string
Auth(opts AuthOpts) error
Post(content string, opts PostOpts) (*PostResult, error)
Status() AuthStatus
}Implement these four methods, register in the registry, done.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/rajpootathar/megahorn'
If you have feedback or need assistance with the MCP directory API, please join our Discord server