Facebook MCP server for AI agents

Live

OAUTH 2.0

SOCIAL MEDIA

Marketing

Facebook gives your agent social media and messaging tools for the Pages your users manage: publish and schedule posts, read Page and post insights, handle comments and Messenger conversations, and manage photos, videos, and live video.

  • Per-user credentials: each call uses the actual user's token, never a shared bot.
  • Encrypted per-tenant vault: AES-256, resolved at request time, never in LLM context.
  • Scoped before every call: pre-call scope check, 90-day SIEM-exportable audit chain.
Facebook
agent · Acme Q3
Run
How did our Page posts perform last week on reach and engagement?
S
facebook_get_insights
126ms
Social media agent
Your Page reached 31,400 people last week. The Thursday product update post drew the most engagement, with 612 reactions.
Sources: Facebook Page insights, 7 days
facebook
7 days
18:29
Message Claude...

Tools your social media agent reaches for on Facebook, scoped per user.

CALL ANY TOOL
166 tools for social media on Facebook: manage Pages, publish and schedule posts, read insights, moderate comments, run Messenger conversations, and upload photos and videos.
facebook_assign_custom_label_to_user
Assign custom label to user
Assign a custom label to one Messenger user (PSID passed as user), so Page Inbox and Messenger conversations can be filtered by that label. Returns {success: true}. Use facebook_remove_custom_label_from_user to take a label off a person. Page Contact Terms must be accepted. Needs a Page access token: call facebook_list_my_pages and pass the Page's access_token as page_access_token.
Parameters
Name
Type
Required
Description
label_id
string
Required
The Label ID to operate on.
user
string
Required
Page-scoped ID (PSID) of the person to assign the label to (numeric; SDK type int64).
page_access_token
string
Optional
Optional Page access token to use instead of the connected user token. Required for most Page-scoped reads/writes (feed, posts, comments, insights, photos), get it from facebook_list_my_pages (request the access_token field).
facebook_create_comment
Create comment
facebook_create_page_canvas
Create page canvas
facebook_create_page_post
Post create page
facebook_debug_access_token
Debug access token
facebook_delete_message_template
Delete message template
facebook_get_canvas_preview
Preview get canvas
facebook_get_object
Get object
facebook_get_thread_owner
Get thread owner
facebook_list_albums
List albums
facebook_list_feed
List feed
facebook_list_message_templates
List message templates
facebook_list_page_call_to_actions
List page call to actions
facebook_list_page_roles
List page roles
facebook_list_page_video_lists
List page video lists
facebook_list_shared_posts
List shared posts
facebook_list_video_captions
List video captions
facebook_moderate_conversations
Moderate conversations
facebook_publish_page_photo_story
Publish page photo story
facebook_remove_custom_label_from_user
Remove custom label from user
facebook_revoke_user_permissions
Revoke user permissions
facebook_search_pages
Search pages
facebook_send_canvas_preview_notification
Send canvas preview notification
facebook_set_user_persistent_menu
Set user persistent menu
facebook_take_thread_control
Take thread control
facebook_update_business_messaging_feature_status
Update business messaging feature status
facebook_update_media_fingerprint
Update media fingerprint
facebook_update_page_profile_picture
Update page profile picture
facebook_update_post
Post update
facebook_upload_message_attachment
Upload message attachment

For more tools, view docs.

Build your Agent
Same auth pattern across LangChain, OpenAI, Anthropic, and Google ADK.
Python · LlamaIndex
import { ScalekitClient } from "@scalekit-sdk/node";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

// Facebook tools scoped to this user
const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["facebook"], toolNames: [
    "facebook_list_my_pages",
    "facebook_create_page_post",
    "facebook_get_insights"] },
  pageSize: 100,
});

const agent = createReactAgent({ llm, tools });
await agent.invoke({ messages: [{ role: "user", content: "Post our release announcement on the Page and show how last week's posts performed" }] });
import OpenAI from "openai";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const openai = new OpenAI();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["facebook"] }, pageSize: 100,
});

const res = await openai.chat.completions.create({
  model: "gpt-5",
  messages: [{ role: "user", content: "Post our release announcement on the Page and show how last week's posts performed" }],
  tools,
});

// Execute the tool call with the user's vaulted Facebook OAuth token
await sk.tools.executeTool(res.choices[0].message.tool_calls[0], "user_123");
import Anthropic from "@anthropic-ai/sdk";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);
const anthropic = new Anthropic();

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["facebook"] }, pageSize: 100,
});

const msg = await anthropic.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Post our release announcement on the Page and show how last week's posts performed" }],
  tools,
});

// Tool call runs with the user's vaulted Facebook OAuth token
await sk.tools.executeTool(msg.content, "user_123");
import { Agent } from "@google/adk/agents";
import { ScalekitClient } from "@scalekit-sdk/node";

const sk = new ScalekitClient(env.SCALEKIT_ENV_URL, env.SCALEKIT_CLIENT_ID, env.SCALEKIT_CLIENT_SECRET);

const { tools } = await sk.tools.listScopedTools("user_123", {
  filter: { connectionNames: ["facebook"] }, pageSize: 100,
});

const agent = new Agent({
  name: "facebook_agent",
  model: "gemini-2.5-pro",
  instruction: "Facebook tools scoped to this user",
  tools,
});

await agent.run("Post our release announcement on the Page and show how last week's posts performed");
Try these prompts
Copy any prompt into your agent. Each maps directly to a Facebook tool. Click to copy, paste into your agent, done.
Pages and posts
Copy the prompt
Copied
List the Facebook Pages I manage.
Copy the prompt
Copied
Publish a post on our Page announcing the new release, with a link to the changelog.
Copy the prompt
Copied
Show the posts scheduled to go out on our Page.
Insights and comments
Copy the prompt
Copied
Show insights for our latest Page post.
Copy the prompt
Copied
List the comments on our most recent post.
Copy the prompt
Copied
Reply to the top comment on our latest post.
Messenger and media
Copy the prompt
Copied
List the open Messenger conversations on our Page.
Copy the prompt
Copied
Send a Messenger reply to the customer who asked about shipping.
Copy the prompt
Copied
Upload this photo to our Page with a caption.
SEE HOW AUTH WORKS
Each user signs in to Facebook once, and Scalekit stores and refreshes their tokens. Credentials stay vaulted, every call is scope checked, and every action is logged.
1
Authorize
Your user connects
Facebook
once. We tie it to their identity and the meetings they approved — no shared bot account, no org-wide access
Who:
user ‘A’
when:
Once per user
access:
Limited to user
2
Store
Their
Facebook
token lives in a vault scoped to them. User A's meetings are never reachable by an agent acting for user B, even on the same connection
vault:
encrypted
scope:
per-user
tokens:
auto-refreshed
3
Resolve
When your agent calls a
Facebook
tool, we fetch the right token server-side. It never touches your agent, never appears in the LLM context, never shows up in your logs
speed:
~40ms
check:
before every call
seen by:
nobody
4
Audit
Every
Facebook
tool call is logged — who triggered it, which meeting was fetched, what came back. 90 days of history, tied to the user who authorized it
history:
90 days
export:
SIEM-ready
logged:
every call
Test other agents
See the same per-user auth pattern across other marketing and social connectors.
GTM and RevOps Teams
Competitive intelligence briefing agent
Scans Gong calls for competitor mentions, matches each one to its Notion battlecard, and DMs every affected rep a single Slack digest per cycle. Every call runs as the PMM who owns the briefing, never a shared bot.
Support and Ops Teams
Support ticket automation agent
Fetches new Zendesk tickets, drafts a reply from Notion knowledge base articles, digests what it cannot answer to Slack, and archives the rest, acting as the support agent rather than a shared API key.
Test other agents
See the same per-user auth pattern across other marketing and social connectors.
GTM
Competitive intelligence briefing agent
Scan Gong calls for competitor mentions, match each one to its Notion battlecard, and DM every affected rep a single Slack digest.
SUPPORT
Support ticket automation (Google ADK)
Fetch, annotate, and archive Zendesk tickets with Notion context, digesting anything it cannot answer to Slack.
Why Scalekit
Secure your agent's access. Connectors ship in minutes
01.
Shared tokens break per-user analytics
A shared Facebook token looks fine in a demo. In production every post, reply, and Messenger message looks like one service account, and you cannot tell which user triggered it. Scalekit resolves the credential of the actual user who triggered the agent, never a shared bot.
// shared token
audit → bot_service_account

// scalekit
audit → user_abc ✓
02.
Authentication is not authorization
03.
Multi-tenancy is architectural
04.
Facebook today. Ten connectors tomorrow.
“Our agents act across Salesforce, Gong, Google Drive, and more, on behalf of every customer. Scalekit behind the scenes meant we can keep adding tools without ever rebuilding how credentials or tool calling work.”
Venu Madhav Kattagoni
Head of Engineering / Von
FAQs
Frequently Asked Questions
Does the agent access Facebook as the user or through a shared service account?
As the user. Each user signs in to Facebook once, and Scalekit stores and refreshes their tokens. Posts, comments, and Messenger messages the agent sends are attributed to that user in your audit trail, not a shared service account.
Where is the Facebook OAuth token stored?
In Scalekit's managed AES-256 token vault, namespaced per tenant. Refresh is automatic. Revocation is a single dashboard action. Credentials never appear in prompts, logs, or LLM context.
Can I limit what the agent does in Facebook?
Yes. Filter by tool name in listScopedTools to expose only what you want, for example the insights and list tools without facebook_delete_object, which permanently deletes a post, comment, photo, or video. Scalekit also enforces scope checks before every API call.
What happens when a user revokes Facebook access?
The connection is invalidated on the next tool call. Subsequent requests for that user fail closed with a clear error. Other users in the tenant remain unaffected. The event is logged for audit.
Which Facebook Pages can the agent work with?
The Pages the connected user manages. facebook_list_my_pages returns each Page and its ID, which the Page-level tools such as facebook_create_page_post and facebook_get_insights need. You register your own Meta app with Facebook Login for the connection.
Start in your coding agent
Up and running in one command
Install the Scalekit skill in your editor of choice. Connector, auth, tools, prompt, all wired up
Claude Code REPL
/plugin marketplace add scalekit-inc/claude-code-authstack
/plugin install agentkit@scalekit-auth-stack
Cursor Code REPL
# ~/.cursor/mcp.json
{
""mcpServers"": {
""facebook"": {
""url"": ""https://mcp.scalekit.com/facebook"",
""headers"": { ""Authorization"": ""Bearer $SCALEKIT_TOKEN"" }
}
}
}
Codex Code REPL
# ~/.codex/config.toml
[mcp_servers.facebook]
url = ""https://mcp.scalekit.com/facebook""
auth_env = ""SCALEKIT_TOKEN""
Copilot Code REPL
# .vscode/mcp.json
{
""servers"": {
""facebook"": {
""url"": ""https://mcp.scalekit.com/facebook"",
""type"": ""http""
}
}
}