Social CLI MCP

Social CLI MCP

MCP server for posting to Twitter/X, Reddit, LinkedIn, Instagram, and email via CLI or AI agents, with Telegram bot control and security confirmations.

Category
访问服务器

README

Social CLI MCP 📱

License: MIT

CLI tool for posting to social media platforms with MCP server support for AI agents

Post to Twitter/X, Reddit, LinkedIn, and Instagram from your terminal or via AI agents.


Features

  • 🐦 Twitter/X - Posts, threads, media uploads, analytics
  • 🤖 Reddit - Text posts, link posts, cross-posting
  • 💼 LinkedIn - Updates with links and images
  • 📸 Instagram - Photo/video posts, carousels (Creator/Business accounts)
  • 📧 Email - Gmail SMTP for outreach campaigns
  • 🤖 MCP Server - AI agent integration
  • 🎨 Interactive mode - Guided posting experience
  • 📱 Telegram Bot - Remote control + Claude AI chat
  • 🔐 Security Gate - All sensitive actions require Telegram confirmation

Quick Start

1. Install

git clone https://github.com/Alemusica/social-cli-mcp.git
cd social-cli-mcp
npm install

2. Configure

cp .env.example .env
# Edit .env with your API credentials

3. Test connections

npm run cli test

4. Post!

# Single platform
npm run cli post "Hello world!" --twitter

# Multiple platforms
npm run cli post "Check this out!" --twitter --linkedin

# Reddit (requires subreddit)
npm run cli post "My post" --reddit ClaudeAI --title "My Title"

# Instagram (requires image)
npm run cli post "My caption" --instagram "https://example.com/image.jpg"

# Interactive mode
npm run cli interactive

CLI Commands

# Post to platforms
social post <text> [options]
  -t, --twitter              Post to Twitter/X
  -r, --reddit <subreddit>   Post to Reddit
  -l, --linkedin             Post to LinkedIn
  -i, --instagram <image>    Post to Instagram
  -a, --all                  Post to all configured
  --title <title>            Reddit post title
  --link <url>               Include a link
  --hashtags <tags>          Comma-separated hashtags
  --media <urls>             Comma-separated media URLs

# Post Twitter thread
social thread <tweet1> <tweet2> ...

# Test connections
social test [--all|--twitter|--reddit|--linkedin|--instagram]

# Show status
social status

# Interactive mode
social interactive
social i

API Credentials Setup

Twitter/X

  1. Go to developer.twitter.com
  2. Create a project and app
  3. Generate API keys and access tokens
  4. Add to .env:
    TWITTER_API_KEY=xxx
    TWITTER_API_SECRET=xxx
    TWITTER_ACCESS_TOKEN=xxx
    TWITTER_ACCESS_SECRET=xxx
    

Reddit

  1. Go to reddit.com/prefs/apps
  2. Create a "script" type application
  3. Add to .env:
    REDDIT_CLIENT_ID=xxx
    REDDIT_CLIENT_SECRET=xxx
    REDDIT_USERNAME=xxx
    REDDIT_PASSWORD=xxx
    

LinkedIn

  1. Go to linkedin.com/developers
  2. Create an app
  3. Request "Share on LinkedIn" permission
  4. Get OAuth access token
  5. Add to .env:
    LINKEDIN_ACCESS_TOKEN=xxx
    

Instagram

Requires Business or Creator account

  1. Go to developers.facebook.com
  2. Create an app
  3. Add Instagram Graph API
  4. Link Facebook Page to Instagram account
  5. Get access token
  6. Add to .env:
    INSTAGRAM_ACCESS_TOKEN=xxx
    INSTAGRAM_BUSINESS_ACCOUNT_ID=xxx
    

MCP Server

Use with Claude, Cursor, or any MCP-compatible AI agent.

Configuration

Add to your MCP config:

{
  "mcpServers": {
    "social": {
      "command": "node",
      "args": ["/path/to/social-cli-mcp/dist/mcp-server.js"],
      "env": {
        "TWITTER_API_KEY": "xxx",
        "TWITTER_API_SECRET": "xxx",
        "TWITTER_ACCESS_TOKEN": "xxx",
        "TWITTER_ACCESS_SECRET": "xxx"
      }
    }
  }
}

Available Tools

Tool Description
post_twitter Post a tweet
post_twitter_thread Post a thread
post_reddit Post to subreddit
post_linkedin Post to LinkedIn
post_instagram Post to Instagram
post_all Post to all platforms
test_connections Test all connections
get_status Get config status

Telegram Bot 📱

Control your social media from Telegram with security confirmations.

Setup

  1. Create bot with @BotFather
  2. Get your user ID from @userinfobot
  3. Add to .env:
    TELEGRAM_BOT_TOKEN=your_bot_token
    TELEGRAM_USER_ID=your_user_id
    ANTHROPIC_API_KEY=sk-ant-xxx  # Optional, for Claude AI
    

Run

npm run bot

Commands

Command Description
/tweet <text> Post tweet (with confirmation)
/email to|subj|body Send email (with confirmation)
/pending View pending actions
/twitter View recent tweets + metrics
/status Outreach status
/venues List contacted venues
Free text Chat with Claude AI

Security

All sensitive actions (tweets, emails) require confirmation via inline buttons. Actions expire after 5 minutes.

See docs/TELEGRAM_BOT_SETUP.md for detailed setup.


Security Gate 🔐

When using Claude Code or other CLI tools, sensitive actions are routed through Telegram for confirmation:

# Test email with confirmation
npx tsx src/security-gate.ts test-email your@email.com

# Test tweet with confirmation
npx tsx src/security-gate.ts test-tweet "Hello world"

Development

# Run CLI in dev mode
npm run cli <command>

# Run MCP server
npm run mcp

# Run Telegram bot
npm run bot

# Build
npm run build

License

MIT


Built with ❤️ by @FluturArt

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选