Hayow004/facebook-mcp-server
3.1
If you are the rightful owner of facebook-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server designed for seamless integration with the Facebook Graph API, enabling AI agents to perform various Facebook-related actions securely and efficiently.
Facebook MCP Server
A Model Context Protocol (MCP) server for Facebook Graph API integration with AI agents.
Features
- ✅ Facebook Graph API integration
- ✅ Secure credential handling via environment variables
- ✅ JSON-based API responses
- ✅ Multiple Facebook API actions support
- ✅ Railway deployment ready
Setup
1. Environment Variables
Set these environment variables in Railway (or your hosting platform):
FACEBOOK_ACCESS_TOKEN=your_facebook_access_token_here
FACEBOOK_APP_ID=your_facebook_app_id_here
2. Deploy to Railway
- Connect this GitHub repo to Railway
- Set the environment variables in Railway dashboard
- Deploy automatically
API Endpoints
Health Check
GET /
Test Facebook Connection
GET /test-facebook
MCP Endpoint (for AI Agents)
POST /mcp
Content-Type: application/json
{
"action": "get_user_info"
}
Supported Actions
get_user_info
- Get current user informationget_pages
- Get user's Facebook pagespost_message
- Post message to page (requires page token)
Example Usage
curl -X POST https://your-app.up.railway.app/mcp \
-H "Content-Type: application/json" \
-d '{"action": "get_user_info"}'
Security
- Never commit access tokens to GitHub
- Use environment variables for all credentials
- Access tokens should have minimal required permissions
Development
npm install
npm run dev