DevSkits916/Facebook-MCP-Server-beta-1
If you are the rightful owner of Facebook-MCP-Server-beta-1 and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Facebook MCP Server is a production-ready server that provides read-only access to the Facebook Graph API using the Model Context Protocol (MCP). It is built with Node.js, TypeScript, and Express, and can be deployed locally or as a web service.
Facebook MCP Server
A production-ready Model Context Protocol (MCP) server that exposes the Facebook Graph API as a read-only data source over Streamable HTTP. Built with Node.js, TypeScript, Express, and @modelcontextprotocol/sdk, this server can run locally or be deployed as a web service on Render.
Features
- Exposes Facebook profile, feed, group feed, and group search as MCP tools.
- Read-only access to the Facebook Graph API (no posting or automation).
- Secured with an API key (
x-api-key) header for MCP requests. - Deployable on Render with minimal configuration.
Prerequisites
- Node.js 20+
- A Facebook Graph API access token with the necessary read permissions.
- An MCP server API key you define.
Environment Variables
FACEBOOK_ACCESS_TOKEN: Facebook Graph API token (required).MCP_SERVER_API_KEY: API key required on/mcprequests (required).PORT: Port to listen on (defaults to3000if not set).
Installation
npm install
Running Locally
npm run build
FACEBOOK_ACCESS_TOKEN=your_token MCP_SERVER_API_KEY=your_api_key PORT=3000 npm run start
For development without a build step, you can use:
FACEBOOK_ACCESS_TOKEN=your_token MCP_SERVER_API_KEY=your_api_key PORT=3000 npm run dev
MCP Endpoint
All MCP traffic goes through /mcp and must include x-api-key: <MCP_SERVER_API_KEY>.
Example JSON-RPC request:
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "x-api-key: your_api_key" \
-d '{
"jsonrpc": "2.0",
"id": "1",
"method": "tools/call",
"params": { "name": "facebook_get_profile", "arguments": {} }
}'
Unsupported HTTP methods on /mcp return a JSON-RPC error indicating "method not allowed." Unauthorized requests return a JSON-RPC error with code -32001.
Tools
facebook_get_profile: Returns the authenticated user’s profile.facebook_get_my_feed(limit=10): Returns the authenticated user’s feed.facebook_get_group_feed(groupId, limit=10): Returns a group feed if visible/authorized for the token.facebook_search_groups(query, limit=10): Searches for groups by query.
All tools are read-only and rely solely on permitted Graph API endpoints; no scraping or posting is performed.
Deployment on Render
- Create a new Web Service.
- Connect your repository and use this configuration:
- Build Command:
npm install && npm run build - Start Command:
npm run start
- Build Command:
- Add environment variables
FACEBOOK_ACCESS_TOKENandMCP_SERVER_API_KEY(both non-sync). - Deploy. Render will provide the
PORTenvironment variable automatically.
Compliance
This server uses only documented, read-only Facebook Graph API endpoints. It does not perform scraping, posting, automation, or any actions that violate Meta platform policies.