
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
twitter-mcp-js
Advanced tools
Complete Twitter API MCP server with 32 tools for social media integration, analytics, and automation
一个完整的Twitter API MCP服务器,基于twitterapi.io提供的API端点实现。
git clone <repository-url>
cd twitter-mcp-js
npm install
cp .env.example .env
# 编辑 .env 文件,添加你的 Twitter API 密钥
# Edit .env file and add your Twitter API key
在 .env
文件中配置以下变量 / Configure the following variables in .env
:
# Twitter API Configuration
TWITTER_API_KEY=your_api_key_here
# Server Configuration
PORT=3000
NODE_ENV=development
LOG_LEVEL=info
# 开发模式 / Development mode
npm run dev
# 生产模式 / Production mode
npm start
适用于本地开发和调试 / For local development and debugging:
{
"$schema": "https://github.com/modelcontextprotocol/specification/blob/main/schema/mcp_config_schema.json",
"description": "Twitter MCP Server Configuration for Local Development",
"mcpServers": {
"twitter-mcp-server": {
"command": "node",
"args": ["/path/to/twitter-mcp-js/src/index.js"],
"env": {
"TWITTER_API_KEY": "your_twitter_api_key_here"
},
"description": "Complete Twitter API integration with 32 tools for social media automation",
"capabilities": {
"tools": true
}
}
}
}
适用于快速部署和测试 / For quick deployment and testing:
{
"$schema": "https://github.com/modelcontextprotocol/specification/blob/main/schema/mcp_config_schema.json",
"description": "Twitter MCP Server Configuration using NPX",
"mcpServers": {
"twitter-mcp-server": {
"command": "npx",
"args": ["twitter-mcp-js"],
"env": {
"TWITTER_API_KEY": "your_api_key_here"
},
"description": "Twitter MCP Server - Complete Twitter API integration with 32 tools for social media automation and analytics"
}
}
}
// 通过MCP调用
{
"tool": "twitter_get_user_info",
"arguments": {
"userName": "elonmusk"
}
}
{
"tool": "twitter_advanced_search",
"arguments": {
"query": "AI technology",
"queryType": "Latest"
}
}
{
"tool": "twitter_create_tweet",
"arguments": {
"login_cookies": "your_login_cookie",
"tweet_text": "Hello from MCP!"
}
}
twitter-mcp-js/
├── src/
│ ├── index.js # MCP服务器主文件 / Main MCP server
│ ├── twitter-api.js # Twitter API客户端 / Twitter API client
│ ├── tools.js # 工具定义 / Tool definitions
│ └── health-server.js # 健康检查服务器 / Health check server
├── .github/
│ └── workflows/
│ └── security.yml # 安全扫描工作流 / Security scan workflow
├── mcp-config-local.json # 本地开发配置 / Local development config
├── mcp-config-npx.json # NPX远程配置 / NPX remote config
├── examples.md # 详细使用示例 / Detailed examples
├── twitterapi_io.md # API文档参考 / API documentation
├── package.json # 项目配置 / Project configuration
├── README.md # 项目文档 / Project documentation
└── LICENSE # 许可证 / License
服务器包含完整的错误处理机制 / The server includes comprehensive error handling:
src/tools.js
中定义工具schema / Define tool schema in src/tools.js
src/twitter-api.js
中实现API方法 / Implement API method in src/twitter-api.js
src/index.js
中添加工具处理逻辑 / Add tool handling logic in src/index.js
MIT License
欢迎提交Issue和Pull Request / Issues and Pull Requests are welcome!
如有问题,请查看 / For issues, please check:
FAQs
Complete Twitter API MCP server with 32 tools for social media integration, analytics, and automation
The npm package twitter-mcp-js receives a total of 164 weekly downloads. As such, twitter-mcp-js popularity was classified as not popular.
We found that twitter-mcp-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.