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.

39 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 Photo Album

Creates a new photo album on a Facebook Page.

Create Photo Post

Creates a photo post on a Facebook Page.

Create Post

Creates a new text or link post on a Facebook Page.

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 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 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.

Get Page Photos

Retrieves photos from a Facebook Page.

Get Page Posts

Retrieves posts from a Facebook Page.

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.

Get Post Insights

Retrieves analytics and insights for a specific Facebook post.

Get Post Reactions

Retrieves reactions (like, love, wow, etc.

Get Scheduled Posts

Retrieves scheduled and unpublished posts for a Facebook Page.

Add Reaction

Adds a LIKE reaction to a Facebook post or comment.

List Managed Pages

Retrieves a list of Facebook Pages that the user manages (not personal profiles), including page details, access tokens, and tasks.

Mark Message Seen

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

Publish Scheduled Post

Publishes a previously scheduled or unpublished Facebook post immediately.

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.

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.

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 multiple photo files in batch to a Facebook Page or Album.

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

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

No. Composio provides a managed OAuth app for Facebook, so you sign in with your normal Facebook account and approve access. If you later want the consent screen to show your own company name, you can add your own Facebook OAuth app in the Composio dashboard, and every connection after that uses it.

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Yes. Composio is SOC 2 Type II compliant and is built to keep your Facebook connection and credentials secure. OAuth tokens and API keys are encrypted, and sensitive customer data is protected at rest and in transit.

Composio also undergoes independent security testing and continuously monitors its systems for security threats. You can review the latest reports and policies in the Composio Trust Center.

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

When you connect a Facebook account through Composio, every action runs under that account, so anything the agent creates, sends, or changes shows up in Facebook as done by you. Keep an approval step in your prompt for actions with side effects, such as sending or deleting, and have the agent draft first.

Exactly the ones Facebook lists on its consent screen when you connect. Review that screen before approving. If you connect a work account, your Facebook administrator may need to approve the app first, and you can revoke the access inside Facebook whenever you want.

Yes. Composio supports multiple connected accounts for the same app, and that works in Claude, ChatGPT, or any other assistant you connect through Composio. Give each Facebook connection a name such as work or personal, and the assistant uses the one you mention in the request. Each account keeps its own credentials and nothing is merged.

Composio refreshes Facebook tokens automatically, so day to day you do nothing. If you revoke access inside Facebook, or Facebook invalidates the session, the connection shows as expired in Composio and the agent stops acting on that account until you reconnect it, which is a single sign-in.

Composio's free plan includes 100,000 tool calls per month with no credit card, and up to 20,000 of those can run through Composio-managed apps like Facebook. Personal Facebook use rarely gets near that. Paid plans add higher limits and team features, and Facebook's own pricing is unaffected.

Built-in connectors usually give one AI access to a limited set of apps. Many people use Composio because it lets their AI connect to more apps than it normally supports, or connect to multiple accounts for the same app (e.g. connect Claude to multiple Facebook accounts).

With Composio, you connect Facebook once and then use it across different AI assistants without setting it up separately in each one. Connect your apps to Composio once, then connect Composio to whichever AI you use, whether that's Claude, ChatGPT, Hermes, or your own custom assistant.

Start with Facebook.It takes 30 seconds.

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

Start building