Social Media MCP Server

by tayler-id

Integrations

  • Integrated for research capabilities, allowing the MCP server to search for information, facts, and news using Brave Search

  • Enables posting content to Mastodon with platform-specific formatting, managing API rate limits, and tracking post performance

  • Used for content generation, allowing the MCP server to create social media posts using OpenAI's models

社交媒体 MCP 服务器

一个连接多个社交媒体平台的模型上下文协议(MCP)服务器,允许用户通过自然语言指令跨平台创建和发布内容。

特征

  • 自然语言界面:通过简单的指令为多个平台创建帖子
  • 研究能力:自动研究主题标签、趋势、事实和新闻
  • 多平台支持:以平台特定的格式发布到 Twitter/X、Mastodon 和 LinkedIn
  • 内容生成:使用多种人工智能模型生成引人入胜的内容
  • 速率限制管理:通过排队和回退优雅地处理 API 速率限制
  • 分析:跟踪帖子表现并优化内容策略

入门

先决条件

  • Node.js(v18+)
  • npm 或 yarn
  • API 密钥用于:
    • Twitter/X
    • 乳齿象
    • LinkedIn
    • OpenAI 和/或 Anthropic(用于内容生成)
    • 勇敢搜索(用于研究)

安装

  1. 克隆存储库:
git clone https://github.com/yourusername/social-media-mcp.git cd social-media-mcp
  1. 安装依赖项:
npm install
  1. 使用您的 API 密钥创建一个.env文件:
# Twitter API Credentials TWITTER_API_KEY=your_api_key TWITTER_API_SECRET=your_api_secret TWITTER_BEARER_TOKEN=your_bearer_token TWITTER_ACCESS_TOKEN=your_access_token TWITTER_ACCESS_SECRET=your_access_secret TWITTER_OAUTH_CLIENT=your_oauth_client TWITTER_CLIENT_SECRET=your_client_secret # Mastodon API Credentials MASTODON_CLIENT_SECRET=your_client_secret MASTODON_CLIENT_KEY=your_client_key MASTODON_ACCESS_TOKEN=your_access_token # LinkedIn API Credentials LINKEDIN_CLIENT_ID=your_client_id LINKEDIN_CLIENT_SECRET=your_client_secret LINKEDIN_ACCESS_TOKEN=your_access_token # AI API Keys ANTHROPIC_API_KEY=your_anthropic_key OPENAI_API_KEY=your_openai_key BRAVE_API_KEY=your_brave_key # Application Settings LOG_LEVEL=info CACHE_ENABLED=true RATE_LIMIT_ENABLED=true
  1. 构建项目:
npm run build
  1. 启动服务器:
npm start

MCP 集成

要将此 MCP 服务器与 Claude 或其他兼容 MCP 的助手一起使用,请将其添加到您的 MCP 设置中:

{ "mcpServers": { "social-media-mcp": { "command": "node", "args": ["path/to/social-media-mcp/build/index.js"], "env": { "TWITTER_API_KEY": "your_api_key", "TWITTER_API_SECRET": "your_api_secret", "TWITTER_BEARER_TOKEN": "your_bearer_token", "TWITTER_ACCESS_TOKEN": "your_access_token", "TWITTER_ACCESS_SECRET": "your_access_secret", "TWITTER_OAUTH_CLIENT": "your_oauth_client", "TWITTER_CLIENT_SECRET": "your_client_secret", "MASTODON_CLIENT_SECRET": "your_client_secret", "MASTODON_CLIENT_KEY": "your_client_key", "MASTODON_ACCESS_TOKEN": "your_access_token", "LINKEDIN_CLIENT_ID": "your_client_id", "LINKEDIN_CLIENT_SECRET": "your_client_secret", "LINKEDIN_ACCESS_TOKEN": "your_access_token", "ANTHROPIC_API_KEY": "your_anthropic_key", "OPENAI_API_KEY": "your_openai_key", "BRAVE_API_KEY": "your_brave_key" }, "disabled": false, "autoApprove": [] } } }

可用工具

创建帖子

根据自然语言指令创建内容并将其发布到社交媒体平台。

{ "instruction": "Post about the latest AI developments in healthcare", "platforms": ["twitter", "mastodon", "linkedin"], "postImmediately": false }

获取热门话题

从社交媒体平台获取热门话题。

{ "platform": "twitter", "category": "technology", "count": 5 }

研究主题

使用 Brave Search 和 Perplexity 研究一个主题。

{ "topic": "artificial intelligence ethics", "includeHashtags": true, "includeFacts": true, "includeTrends": true, "includeNews": true }

发展

项目结构

social-media-mcp/ ├── src/ │ ├── index.ts # Entry point │ ├── config/ # Configuration │ ├── types/ # TypeScript type definitions │ ├── core/ # Core orchestration logic │ ├── nlp/ # Natural language processing │ ├── research/ # Research engine │ │ ├── brave/ # Brave Search integration │ │ ├── perplexity/ # Perplexity integration │ │ └── aggregator/ # Research result aggregation │ ├── content/ # Content generation │ │ ├── strategies/ # AI model strategies │ │ ├── formatter/ # Platform-specific formatting │ │ └── templates/ # Content templates │ ├── platforms/ # Social media platform integrations │ │ ├── twitter/ # Twitter API integration │ │ └── mastodon/ # Mastodon API integration │ ├── analytics/ # Analytics engine │ ├── rate-limit/ # Rate limit management │ └── utils/ # Utility functions ├── memory-bank/ # Project documentation ├── build/ # Compiled JavaScript ├── .env # Environment variables ├── package.json # Dependencies and scripts └── tsconfig.json # TypeScript configuration

脚本

  • npm run build :构建项目
  • npm run dev :以热重载方式在开发模式下运行
  • npm start :启动生产服务器
  • npm test :运行测试
  • npm run lint :运行 linting
  • npm run format :格式化代码

实用程序脚本

scripts目录包含社交媒体 MCP 服务器的实用程序脚本:

  • scripts/linkedin-oauth.js :处理 LinkedIn 的 OAuth 2.0 流程以获取访问令牌
    • 用法: cd scripts && npm install && npm run linkedin-oauth
    • 请参阅scripts/README.md了解更多详细信息

文档

documentation目录包含每个社交媒体平台集成的详细文档:

执照

该项目已获得 ISC 许可。

致谢

-
security - not tested
F
license - not found
-
quality - not tested

连接多个社交媒体平台(Twitter/X、Mastodon、LinkedIn),让用户通过自然语言指令跨平台创建和发布内容。

  1. 特征
    1. 入门
      1. 先决条件
      2. 安装
      3. MCP 集成
    2. 可用工具
      1. 创建帖子
      2. 获取热门话题
      3. 研究主题
    3. 发展
      1. 项目结构
      2. 脚本
      3. 实用程序脚本
      4. 文档
    4. 执照
      1. 致谢

        Related MCP Servers

        • A
          security
          A
          license
          A
          quality
          Server for X (Twitter) integration that provides tools for reading your timeline and engaging with tweets. Designed for use with Claude desktop.
          Last updated -
          3
          0
          9
          JavaScript
          MIT License
        • A
          security
          A
          license
          A
          quality
          A Model Context Protocol (MCP) server for managing social media posts, currently supporting X (formerly Twitter).
          Last updated -
          3
          7
          JavaScript
          MIT License
        • -
          security
          A
          license
          -
          quality
          Enables interaction with Twitter through a Model Context Protocol, allowing large language models to post tweets, search for tweets, and reply to tweets.
          Last updated -
          25
          0
          10
          TypeScript
          MIT License
          • Apple
        • A
          security
          A
          license
          A
          quality
          An MCP server that allows Claude to create, manage and publish X/Twitter posts directly through the chat interface.
          Last updated -
          5
          35
          Python
          MIT License
          • Apple

        View all related MCP servers

        ID: 9zu5lcg37u