View as Markdown

Facebook Integration

Manage Facebook Page posts, comments, reactions, and insights via the Graph API

The Facebook integration provides access to manage Facebook Page posts, comments, reactions, and insights via the Graph API through the Integrate MCP server.

Installation

The Facebook integration is included with the SDK:

import { facebookIntegration } from "integrate-sdk/server";

Setup

1. Create a Facebook OAuth App

  1. Go to Facebook Developer Portal
  2. Create a new OAuth application
  3. Configure your redirect URI
  4. Note your Client ID and Client Secret

2. Configure the Integration on Your Server

Add the Facebook integration to your server configuration. The integration automatically reads FACEBOOK_CLIENT_ID and FACEBOOK_CLIENT_SECRET from your environment variables:

import { createMCPServer, facebookIntegration } from "integrate-sdk/server";
 
export const { client: serverClient } = createMCPServer({
  apiKey: process.env.INTEGRATE_API_KEY,
  integrations: [
    facebookIntegration({
      scopes: ["public_profile", "email", "pages_show_list", "pages_read_engagement", "pages_manage_posts", "pages_read_user_content", "pages_manage_engagement"], // Optional
    }),
  ],
});

You can override the environment variables by passing explicit values:

facebookIntegration({
  clientId: process.env.CUSTOM_FACEBOOK_ID,
  clientSecret: process.env.CUSTOM_FACEBOOK_SECRET,
      scopes: ["public_profile", "email", "pages_show_list", "pages_read_engagement", "pages_manage_posts", "pages_read_user_content", "pages_manage_engagement"], // Optional
});

3. Client-Side Usage

The default client automatically includes all integrations. You can use it directly:

import { client } from "integrate-sdk";
 
await client.authorize("facebook");
const result = await client.facebook.getMe({});
 
console.log(result);

If you're using a custom client, add the integration to the integrations array:

import { createMCPClient, facebookIntegration } from "integrate-sdk";
 
const customClient = createMCPClient({
  integrations: [facebookIntegration()],
});

Configuration Options

export interface FacebookIntegrationConfig {
  /** Facebook app OAuth client ID (defaults to FACEBOOK_CLIENT_ID env var) */
  clientId?: string;

Default Scopes

These defaults are applied unless you override scopes in the integration config:

  • public_profile
  • email
  • pages_show_list
  • pages_read_engagement
  • pages_manage_posts
  • pages_read_user_content
  • pages_manage_engagement

Tools

facebook_get_me

Get me

export interface FacebookGetMeParams { fields?: string }

facebook_list_pages

List pages

export interface FacebookListPagesParams { fields?: string }

facebook_list_page_posts

List page posts

export interface FacebookListPagePostsParams {
    page_id: string;

facebook_get_object

Get object

export interface FacebookGetObjectParams { object_id: string;

facebook_create_page_post

Create page post

export interface FacebookCreatePagePostParams {
    page_id: string;

facebook_delete_object

Delete object

export interface FacebookDeleteObjectParams { object_id: string }

facebook_list_comments

List comments

export interface FacebookListCommentsParams {
    object_id: string;

facebook_publish_comment

Publish comment

export interface FacebookPublishCommentParams { object_id: string;

facebook_get_insights

Get insights

export interface FacebookGetInsightsParams {
    object_id: string;

facebook_set_comment_visibility

Set comment visibility

export interface FacebookSetCommentVisibilityParams { comment_id: string;

facebook_like_object

Like object

export interface FacebookLikeObjectParams { object_id: string }

Notes

  • Category: Social Media
  • Authentication mode: OAuth