Facebook MCP server for AI agents and assistants

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Facebook MCP or direct API to post updates, fetch messages, manage comments, and gather page analytics through natural language.

Facebook logoFacebook
Oauth2

Facebook is a social media and advertising platform for businesses and creators. It helps you connect, share, and manage content across your public Facebook Pages.

72 Tools

Try Facebook now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
Facebook
Try asking
TOOLS

Supported Tools

Every Facebook action and event your agent gets out of the box.

Assign Page Task

Assigns tasks/roles to a business-scoped user or system user for a specific Facebook Page.

Create Comment

Creates a comment on a Facebook post or replies to an existing comment.

Create Multi-Photo Post

Publish one Facebook Page feed post containing one or more photos from public URLs.

Create Photo Post

Creates a photo post on a Facebook Page using an image URL or uploaded image, with an optional caption.

Create Post

Creates a text or link post on a Facebook Page, with a required message field and optional link, scheduling, and targeting.

Create Video Post

Creates a video post on a Facebook Page.

Delete Comment

Deletes a Facebook comment.

Delete Post

Permanently deletes a Facebook Page post.

Get Ad Insights

Read Marketing API performance insights for an advertising object.

Get Comment

Retrieves details of a specific Facebook comment.

Get Comments

Retrieves comments from a Facebook post or comment (for replies).

Get Conversation Messages

Retrieves messages from a specific conversation.

Get Current User

Validates the access token and retrieves the authenticated user's own profile via /me.

Get Graph Object

Read caller-selected fields from an identified Facebook Graph node using permissions already granted to the connection.

Get Graph Objects

Read caller-selected fields from multiple Facebook Graph nodes in one batch request and return successes and failures keyed by requested object ID.

Get Message Details

Retrieves details of a specific message sent or received by the Page.

Get Page Conversations

Retrieves a list of conversations between users and the Page.

Get Page Details

Fetches details about a specific Facebook Page.

Get Page Insights

Retrieves analytics and insights for a Facebook Page, including follower, media view and engagement metrics.

Get Page Photos

Retrieves photos from a Facebook Page.

Get Page Posts

Retrieves posts from a Facebook Page's feed using Graph API v26.0, with optional time filters.

Get Page Roles

Retrieves a list of people and their tasks/roles on a Facebook Page.

Get Page Tagged Posts

Retrieves posts where a Facebook Page is tagged or mentioned.

Get Page Videos

Retrieves videos from a Facebook Page.

Get Post

Retrieves details of a specific Facebook post using a full numeric Page ID and post ID separated by an underscore.

Get Post Insights

Retrieves media-view and unique media-viewer insights for a Facebook post.

Get Post Reactions

Retrieves reactions (like, love, wow, etc.) for a Facebook post.

Get Scheduled Posts

Retrieves one page of scheduled and unpublished posts for a Facebook Page, with pagination information when returned.

Add Reaction

Adds a LIKE reaction to a Facebook post or comment.

List Ad Account Campaigns

List campaigns belonging to a Facebook ad account.

List Ad Accounts

List ad accounts available to the authenticated Facebook user.

List Ads

List ads associated with a Facebook advertising parent.

List Assigned Ad Accounts

Lists ad accounts assigned to a business-scoped user.

List Business Ad Accounts

Lists client ad accounts a Facebook Business can access.

List Businesses

List Business Manager businesses accessible to the connected Facebook user, including selected business details and permitted roles.

List Client Pages

List client-owned Pages accessible to a Business Manager business.

List Managed Pages

Retrieves Facebook Pages managed by a user, with page details, access tokens and tasks when returned.

List Object Attachments

List one page of attachments belonging to a Facebook Graph object.

List Owned Ad Accounts

List ad accounts owned by a Business Manager business, with optional Meta account filtering and cursor pagination.

List Owned Pages

List Facebook Pages owned by a Business Manager business.

List Page Ads Posts

List ad-created Page posts, including optional inline-created and dynamic-ad filters.

List Page Albums

List photo albums belonging to a managed Facebook Page with selected fields and safe cursor pagination.

List Page-Authored Posts

List posts authored by a Facebook Page, excluding visitor and tagged feed content.

List Page Events

List events associated with a managed Facebook Page.

List Page Leadgen Forms

List lead-generation forms owned by a managed Facebook Page.

List Page Reels

List a Facebook Page's Reel video records with selected fields and cursor pagination.

List Page Stories

Lists photo and video stories for a Facebook Page managed by the connected account.

List Page Subscribed Apps

List applications subscribed to webhook notifications for a Facebook Page managed by the connected account.

List Permissions

List granted, declined, or expired Facebook permissions for the connected user and app.

List Published Page Posts

List posts published by a Facebook Page, excluding unpublished posts.

List Video Captions

List one page of caption tracks attached to a managed Page's video.

List Video Tags

Return one page of people or Pages tagged on a Facebook video.

List Video Thumbnails

List available thumbnail images for a Facebook video.

Mark Message Seen

Marks a user's message as seen by the Page, visibly updating the read status in the user's conversation.

Publish Page Photo Story

Publish an existing unpublished Facebook Page photo as a Page Story.

Publish Page Reel

Create a Facebook Page Reel from a hosted or local video and finish it as a draft, scheduled Reel, or publicly published Reel according to video_state.

Publish Scheduled Post

Publishes a previously scheduled or unpublished Facebook post immediately.

Refresh URL Scrape

Ask Facebook to rescrape a public HTTP or HTTPS URL, optionally returning requested URL metadata fields.

Remove Page Task

Removes a user's tasks/access from a specific Facebook Page.

Reschedule Post

Changes the scheduled publish time of an unpublished Facebook post.

Search Ad Targeting Options

Searches query-driven Meta ad targeting option families, including geographic areas, interests, locales, schools, majors, employers, and job titles.

Search Geographic Targeting Locations

Find current geographic keys accepted by Meta ad targeting.

Send Media Message

Sends a media message (image, video, audio, or file) from the Page to a user.

Send Message

Sends a text message from a Facebook Page (not personal profiles) to a user via Messenger.

Set Page Profile Picture

Replace a managed Facebook Page's profile picture with an image fetched from a public HTTP or HTTPS URL.

Set Video Thumbnail

Upload a thumbnail image for a video owned by a managed Facebook Page and optionally make it preferred.

Toggle Typing Indicator

Shows or hides the typing indicator for a user in Messenger.

Unlike Post or Comment

Removes a like from a Facebook post or comment.

Update Comment

Updates an existing Facebook comment.

Update Page Settings

Updates settings for a specific Facebook Page.

Update Post

Updates an existing Facebook Page post.

Upload Photos Batch

Uploads independent photos to a Facebook Page or Album using the Graph batch API, accepting up to 50 local files and up to 50 photo URLs.

SETUP GUIDE

Connect Facebook MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/mcp @ai-sdk/openai
Install the Composio SDK and your agent framework
2

Create a session with MCP enabled

typescript
import { Composio } from "@composio/core";

const composio = new Composio();
const { mcp } = await composio.create("your-user-id", {
  toolkits: ["facebook"],
  mcp: true,
});
Create a session scoped to Facebook and read its MCP URL and headers
3

Connect your agent to the MCP server

typescript
import { createMCPClient } from "@ai-sdk/mcp";
import { openai } from "@ai-sdk/openai";
import { generateText, stepCountIs } from "ai";

const client = await createMCPClient({
  transport: { type: "http", url: mcp.url, headers: mcp.headers },
});

const { text } = await generateText({
  model: openai("gpt-5.6-sol"),
  tools: await client.tools(),
  prompt: "Create a photo post announcing our weekend sale on the Facebook Page.",
  stopWhen: stepCountIs(10),
});

console.log(text);
await client.close();
Pass the session's MCP URL and headers to your agent and run a Facebook request
SETUP GUIDE

Connect Facebook API Tool with your Agent

1

Install Composio

typescript
npm install @composio/core @composio/openai openai
Install the Composio SDK, the OpenAI provider, and the OpenAI SDK
2

Create a Composio session

typescript
import OpenAI from "openai";
import { Composio } from "@composio/core";
import { OpenAIResponsesProvider } from "@composio/openai";

const composio = new Composio({ provider: new OpenAIResponsesProvider() });
const client = new OpenAI();

const session = await composio.create("your-user-id", { toolkits: ["facebook"] });
const tools = await session.tools();
Initialize Composio with the OpenAI Responses provider and create a session scoped to Facebook
3

Run Facebook tools with your agent

typescript
let response = await client.responses.create({
  model: "gpt-5.6-sol",
  tools,
  input: [{ role: "user", content: "Create a photo post announcing our weekend sale on the Facebook Page." }],
});

while (response.output.some((o) => o.type === "function_call")) {
  const outputs = await composio.provider.handleToolCalls(session, response.output);
  response = await client.responses.create({
    model: "gpt-5.6-sol",
    tools,
    previous_response_id: response.id,
    input: outputs,
  });
}

console.log(response.output_text);
Send a request, execute the Facebook tool calls through the session, and print the final answer
Guide

Connect multiple Facebook accounts to Claude and tell it which one to use by name.

Read the guide

Why Use Composio?

AI Native Facebook Integration

  • Supports both Facebook MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for reading, writing, and querying your Facebook Page data

Managed Auth

  • Built-in OAuth handling with automatic token refresh and rotation
  • Central place to manage, scope, and revoke Facebook Page access
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Facebook Pages
  • Scoped, least privilege access to Facebook resources
  • Full audit trail of agent actions to support review and compliance

Rolling this out across your team?

Give your team centralized access control across every framework with Composio’s MCP Gateway.

EXPLORE MCP GATEWAY
FAQ

Frequently asked questions

Start with Facebook.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Facebook tool your agent needs.Free to start.

Start building