NestDaddy

Facebook Mcp

io.github.IvanBBaev/facebook-mcp · v0.8.0

Facebook Pages MCP server for the Meta Graph API — publishing, insights, moderation, messaging

Connect Runs on your machine

Terminal
claude mcp add facebook-mcp -e FB_SYSTEM_TOKEN=<FB_SYSTEM_TOKEN> -e FB_ACCESS_TOKEN=<FB_ACCESS_TOKEN> -e FB_PAGE_TOKEN=<FB_PAGE_TOKEN> -e FB_APP_ID=<FB_APP_ID> -e FB_APP_SECRET=<FB_APP_SECRET> -e FB_PAGE_ID=<FB_PAGE_ID> -e FB_API_VERSION=<FB_API_VERSION> -e FB_ADS_API_VERSION=<FB_ADS_API_VERSION> -e FB_REQUEST_TIMEOUT_MS=<FB_REQUEST_TIMEOUT_MS> -e FB_HOST_CONCURRENCY=<FB_HOST_CONCURRENCY> -e FB_MAX_RESULT_CHARS=<FB_MAX_RESULT_CHARS> -e FB_WRITE_MODE=<FB_WRITE_MODE> -e FB_CONFIRM_TOKEN=<FB_CONFIRM_TOKEN> -e FB_MEDIA_DIR=<FB_MEDIA_DIR> -e FB_JOURNAL_PATH=<FB_JOURNAL_PATH> -e FB_ACTIVITY_STATE_PATH=<FB_ACTIVITY_STATE_PATH> -e FB_EXPORT_DIR=<FB_EXPORT_DIR> -e FB_TOOL_PACKAGES=<FB_TOOL_PACKAGES> -e FB_PACKAGES_DENY=<FB_PACKAGES_DENY> -e FB_PACKAGES_READONLY=<FB_PACKAGES_READONLY> -e FB_TRANSPORT=<FB_TRANSPORT> -e FB_HTTP_TOKEN=<FB_HTTP_TOKEN> -e FB_HTTP_PORT=<FB_HTTP_PORT> -e FB_AD_ACCOUNT_ID=<FB_AD_ACCOUNT_ID> -e FB_ADS_BUDGET_CEILING=<FB_ADS_BUDGET_CEILING> -e FB_ADS_CAMPAIGN_SPEND_CAP_MAX=<FB_ADS_CAMPAIGN_SPEND_CAP_MAX> -e FB_LOG_LEVEL=<FB_LOG_LEVEL> -- npx -y @ivanbaev/[email protected]
claude_desktop_config.json
{
  "mcpServers": {
    "facebook-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ivanbaev/[email protected]"
      ],
      "env": {
        "FB_SYSTEM_TOKEN": "<FB_SYSTEM_TOKEN>",
        "FB_ACCESS_TOKEN": "<FB_ACCESS_TOKEN>",
        "FB_PAGE_TOKEN": "<FB_PAGE_TOKEN>",
        "FB_APP_ID": "<FB_APP_ID>",
        "FB_APP_SECRET": "<FB_APP_SECRET>",
        "FB_PAGE_ID": "<FB_PAGE_ID>",
        "FB_API_VERSION": "<FB_API_VERSION>",
        "FB_ADS_API_VERSION": "<FB_ADS_API_VERSION>",
        "FB_REQUEST_TIMEOUT_MS": "<FB_REQUEST_TIMEOUT_MS>",
        "FB_HOST_CONCURRENCY": "<FB_HOST_CONCURRENCY>",
        "FB_MAX_RESULT_CHARS": "<FB_MAX_RESULT_CHARS>",
        "FB_WRITE_MODE": "<FB_WRITE_MODE>",
        "FB_CONFIRM_TOKEN": "<FB_CONFIRM_TOKEN>",
        "FB_MEDIA_DIR": "<FB_MEDIA_DIR>",
        "FB_JOURNAL_PATH": "<FB_JOURNAL_PATH>",
        "FB_ACTIVITY_STATE_PATH": "<FB_ACTIVITY_STATE_PATH>",
        "FB_EXPORT_DIR": "<FB_EXPORT_DIR>",
        "FB_TOOL_PACKAGES": "<FB_TOOL_PACKAGES>",
        "FB_PACKAGES_DENY": "<FB_PACKAGES_DENY>",
        "FB_PACKAGES_READONLY": "<FB_PACKAGES_READONLY>",
        "FB_TRANSPORT": "<FB_TRANSPORT>",
        "FB_HTTP_TOKEN": "<FB_HTTP_TOKEN>",
        "FB_HTTP_PORT": "<FB_HTTP_PORT>",
        "FB_AD_ACCOUNT_ID": "<FB_AD_ACCOUNT_ID>",
        "FB_ADS_BUDGET_CEILING": "<FB_ADS_BUDGET_CEILING>",
        "FB_ADS_CAMPAIGN_SPEND_CAP_MAX": "<FB_ADS_CAMPAIGN_SPEND_CAP_MAX>",
        "FB_LOG_LEVEL": "<FB_LOG_LEVEL>"
      }
    }
  }
}
~/.cursor/mcp.json
{
  "mcpServers": {
    "facebook-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ivanbaev/[email protected]"
      ],
      "env": {
        "FB_SYSTEM_TOKEN": "<FB_SYSTEM_TOKEN>",
        "FB_ACCESS_TOKEN": "<FB_ACCESS_TOKEN>",
        "FB_PAGE_TOKEN": "<FB_PAGE_TOKEN>",
        "FB_APP_ID": "<FB_APP_ID>",
        "FB_APP_SECRET": "<FB_APP_SECRET>",
        "FB_PAGE_ID": "<FB_PAGE_ID>",
        "FB_API_VERSION": "<FB_API_VERSION>",
        "FB_ADS_API_VERSION": "<FB_ADS_API_VERSION>",
        "FB_REQUEST_TIMEOUT_MS": "<FB_REQUEST_TIMEOUT_MS>",
        "FB_HOST_CONCURRENCY": "<FB_HOST_CONCURRENCY>",
        "FB_MAX_RESULT_CHARS": "<FB_MAX_RESULT_CHARS>",
        "FB_WRITE_MODE": "<FB_WRITE_MODE>",
        "FB_CONFIRM_TOKEN": "<FB_CONFIRM_TOKEN>",
        "FB_MEDIA_DIR": "<FB_MEDIA_DIR>",
        "FB_JOURNAL_PATH": "<FB_JOURNAL_PATH>",
        "FB_ACTIVITY_STATE_PATH": "<FB_ACTIVITY_STATE_PATH>",
        "FB_EXPORT_DIR": "<FB_EXPORT_DIR>",
        "FB_TOOL_PACKAGES": "<FB_TOOL_PACKAGES>",
        "FB_PACKAGES_DENY": "<FB_PACKAGES_DENY>",
        "FB_PACKAGES_READONLY": "<FB_PACKAGES_READONLY>",
        "FB_TRANSPORT": "<FB_TRANSPORT>",
        "FB_HTTP_TOKEN": "<FB_HTTP_TOKEN>",
        "FB_HTTP_PORT": "<FB_HTTP_PORT>",
        "FB_AD_ACCOUNT_ID": "<FB_AD_ACCOUNT_ID>",
        "FB_ADS_BUDGET_CEILING": "<FB_ADS_BUDGET_CEILING>",
        "FB_ADS_CAMPAIGN_SPEND_CAP_MAX": "<FB_ADS_CAMPAIGN_SPEND_CAP_MAX>",
        "FB_LOG_LEVEL": "<FB_LOG_LEVEL>"
      }
    }
  }
}
.vscode/mcp.json
{
  "servers": {
    "facebook-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@ivanbaev/[email protected]"
      ],
      "env": {
        "FB_SYSTEM_TOKEN": "<FB_SYSTEM_TOKEN>",
        "FB_ACCESS_TOKEN": "<FB_ACCESS_TOKEN>",
        "FB_PAGE_TOKEN": "<FB_PAGE_TOKEN>",
        "FB_APP_ID": "<FB_APP_ID>",
        "FB_APP_SECRET": "<FB_APP_SECRET>",
        "FB_PAGE_ID": "<FB_PAGE_ID>",
        "FB_API_VERSION": "<FB_API_VERSION>",
        "FB_ADS_API_VERSION": "<FB_ADS_API_VERSION>",
        "FB_REQUEST_TIMEOUT_MS": "<FB_REQUEST_TIMEOUT_MS>",
        "FB_HOST_CONCURRENCY": "<FB_HOST_CONCURRENCY>",
        "FB_MAX_RESULT_CHARS": "<FB_MAX_RESULT_CHARS>",
        "FB_WRITE_MODE": "<FB_WRITE_MODE>",
        "FB_CONFIRM_TOKEN": "<FB_CONFIRM_TOKEN>",
        "FB_MEDIA_DIR": "<FB_MEDIA_DIR>",
        "FB_JOURNAL_PATH": "<FB_JOURNAL_PATH>",
        "FB_ACTIVITY_STATE_PATH": "<FB_ACTIVITY_STATE_PATH>",
        "FB_EXPORT_DIR": "<FB_EXPORT_DIR>",
        "FB_TOOL_PACKAGES": "<FB_TOOL_PACKAGES>",
        "FB_PACKAGES_DENY": "<FB_PACKAGES_DENY>",
        "FB_PACKAGES_READONLY": "<FB_PACKAGES_READONLY>",
        "FB_TRANSPORT": "<FB_TRANSPORT>",
        "FB_HTTP_TOKEN": "<FB_HTTP_TOKEN>",
        "FB_HTTP_PORT": "<FB_HTTP_PORT>",
        "FB_AD_ACCOUNT_ID": "<FB_AD_ACCOUNT_ID>",
        "FB_ADS_BUDGET_CEILING": "<FB_ADS_BUDGET_CEILING>",
        "FB_ADS_CAMPAIGN_SPEND_CAP_MAX": "<FB_ADS_CAMPAIGN_SPEND_CAP_MAX>",
        "FB_LOG_LEVEL": "<FB_LOG_LEVEL>"
      }
    }
  }
}

Replace the values in angle brackets with your own. Keys stay on your machine; we never see them.

Tools

This server runs locally, so its tools are listed by your MCP client once it starts.

Environment variables

NameDescription
FB_SYSTEM_TOKEN
Optional, secret
System-user access token (Business Manager). Takes precedence over FB_ACCESS_TOKEN and FB_PAGE_TOKEN when several are set.
FB_ACCESS_TOKEN
Optional, secret
Primary user access token. At least one of FB_SYSTEM_TOKEN, FB_ACCESS_TOKEN or FB_PAGE_TOKEN must be set.
FB_PAGE_TOKEN
Optional, secret
Long-lived Page access token used as a fallback credential when no user or system-user token is configured. It belongs to exactly one Page, so set FB_PAGE_ID to that Page ID alongside it (the doctor / facebook_whoami reports it as the acting Page); a Page token without its Page ID is bound to nothi…
FB_APP_ID
Optional
Meta app ID; combined with FB_APP_SECRET it forms the app access token used to authorize /debug_token inspection.
FB_APP_SECRET
Optional, secret
Meta app secret. When set, appsecret_proof is attached to every call so a stolen bare token cannot be used on its own.
FB_PAGE_ID
Optional
Default Facebook Page ID, used when a tool call omits an explicit profile argument. Required when FB_PAGE_TOKEN is the only credential: it names the Page that token belongs to.
FB_API_VERSION
Optional
Graph API version to target. Defaults to the tested pinned version; other values are accepted verbatim as an escape hatch but are not tested.
FB_ADS_API_VERSION
Optional
Marketing API version the ads tools target (ad accounts, campaigns, ad sets, ads, insights, async reports). The Marketing API retires versions on its own, shorter schedule, so it is pinned separately from FB_API_VERSION. Other values are accepted verbatim as an escape hatch but are not tested.
FB_REQUEST_TIMEOUT_MS
Optional
Per-request timeout in milliseconds; integer in [1, 600000].
FB_HOST_CONCURRENCY
Optional
Maximum number of in-flight requests per Graph host; integer in [1, 64].
FB_MAX_RESULT_CHARS
Optional
Character budget applied by the result shaper before a tool result is truncated; integer in [500, 10000000].
FB_WRITE_MODE
Optional
Write gating mode: plan (validating dry-run preview, the default) or apply. It never covers the irreversible and spend tiers, which always need a per-call apply plus a plan_id.
FB_CONFIRM_TOKEN
Optional, secret
Operator confirmation token for out-of-band approval of irreversible or spend actions. The server prompts through MCP elicitation where the client supports it; otherwise the caller passes this value as the confirm_token tool argument. At least 16 characters — a shorter value fails startup; mint one…
FB_MEDIA_DIR
Optional
Directory permitted for local media uploads. Unset means URL-only uploads and no local file access at all.
FB_JOURNAL_PATH
Optional
Path to the append-only write journal. Defaults to the XDG/%APPDATA% state path; the file is created owner-only (0600) and rotates by size.
FB_ACTIVITY_STATE_PATH
Optional
Path to the small JSON file where facebook_get_activity_since keeps, per Page, the horizon of the last complete read. Defaults to the XDG/%APPDATA% state path next to the journal; the file holds Page ids and timestamps only and is written atomically, owner-only (0600).
FB_EXPORT_DIR
Optional
Directory where the insights tools write a CSV or JSON file when called with `output`. Defaults to `exports/` under the XDG/%APPDATA% state path. Files are written atomically and owner-only (0600) and are never overwritten; a name collision gets a numeric suffix.
FB_TOOL_PACKAGES
Optional
Comma-separated tool packages or profiles to expose (e.g. core,posts,reader, or the profiles core|all|reader|publisher|moderator|ads). Omit for the default profile, which excludes ads.
FB_PACKAGES_DENY
Optional
Comma-separated packages OR profiles to exclude even when FB_TOOL_PACKAGES enables them; deny wins over allow. Profile names expand here exactly as they do in FB_TOOL_PACKAGES, and a profile beats a same-spelled package, so FB_PACKAGES_DENY=core denies the whole six-package core profile rather than…
FB_PACKAGES_READONLY
Optional
Comma-separated packages OR profiles whose write tools are not registered at all; the read tools of those packages stay available. Profile names expand as they do in FB_TOOL_PACKAGES, so FB_PACKAGES_READONLY=core makes every default package read-only in one token. An unrecognized name is a startup…
FB_TRANSPORT
Optional
Transport protocol: stdio (default) or http. The http transport binds 127.0.0.1 only and fails closed without FB_HTTP_TOKEN.
FB_HTTP_TOKEN
Optional, secret
Bearer token guarding the HTTP transport; required when FB_TRANSPORT=http (the server refuses to start without it). At least 16 characters — a shorter value is refused (under stdio it is dropped with a warning); mint one with openssl rand -hex 32.
FB_HTTP_PORT
Optional
Port for the HTTP transport (loopback only); used when FB_TRANSPORT=http. Integer in [1, 65535].
FB_AD_ACCOUNT_ID
Optional
Default ad account ID (act_… or the bare numeric id) for the opt-in ads package.
FB_ADS_BUDGET_CEILING
Optional
Hard ceiling for any ads budget write, in minor units of the ad account's own currency (e.g. cents for USD). Non-negative integer; a write above it is refused. No currency conversion: size it for the account's currency (1000 is $10 but only 1000 JPY).
FB_ADS_CAMPAIGN_SPEND_CAP_MAX
Optional
Largest campaign spend_cap (the lifetime total a campaign may spend) that an ads write may set, in minor units of the ad account's own currency. Non-negative integer; a cap above it is refused, never clamped. Unset: every write that sets a campaign spend cap is refused. No currency conversion, same…
FB_LOG_LEVEL
Optional
Stderr log verbosity: debug, info, warn or error. Logs never go to stdout — that is the stdio protocol channel.

Details

Package@ivanbaev/[email protected] (NPM, stdio)
First published28 Oct 2026
Last updated28 Oct 2026
Registry nameio.github.IvanBBaev/facebook-mcp

More communication servers See all

Listing data from the official MCP registry. Status and tools from NestDaddy's daily check. Browse all MCP servers.