Back to Browse

Facebook MCP Server

Marketing & SocialLow Risk10.0MCP RegistryLocal
Free

Server data from the Official MCP Registry

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

About

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

Security Report

10.0
Low Risk10.0Low Risk

Valid MCP server (2 strong, 2 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry. Trust signals: 3 highly-trusted packages.

4 files analyzed · 1 issue found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

file_system

Check that this permission is expected for this type of plugin.

What You'll Need

Set these up before or after installing:

System-user access token (Business Manager). Takes precedence over FB_ACCESS_TOKEN and FB_PAGE_TOKEN when several are set.Required

Environment variable: FB_SYSTEM_TOKEN

Primary user access token. At least one of FB_SYSTEM_TOKEN, FB_ACCESS_TOKEN or FB_PAGE_TOKEN must be set.Required

Environment variable: FB_ACCESS_TOKEN

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

Environment variable: FB_PAGE_TOKEN

Meta app ID; combined with FB_APP_SECRET it forms the app access token used to authorize /debug_token inspection.Optional

Environment variable: FB_APP_ID

Meta app secret. When set, appsecret_proof is attached to every call so a stolen bare token cannot be used on its own.Required

Environment variable: FB_APP_SECRET

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

Environment variable: FB_PAGE_ID

Graph API version to target. Defaults to the tested pinned version; other values are accepted verbatim as an escape hatch but are not tested.Optional

Environment variable: FB_API_VERSION

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

Environment variable: FB_ADS_API_VERSION

Per-request timeout in milliseconds; integer in [1, 600000].Optional

Environment variable: FB_REQUEST_TIMEOUT_MS

Maximum number of in-flight requests per Graph host; integer in [1, 64].Optional

Environment variable: FB_HOST_CONCURRENCY

Character budget applied by the result shaper before a tool result is truncated; integer in [500, 10000000].Optional

Environment variable: FB_MAX_RESULT_CHARS

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

Environment variable: FB_WRITE_MODE

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 with openssl rand -hex 32.Required

Environment variable: FB_CONFIRM_TOKEN

Directory permitted for local media uploads. Unset means URL-only uploads and no local file access at all.Optional

Environment variable: FB_MEDIA_DIR

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

Environment variable: FB_JOURNAL_PATH

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

Environment variable: FB_ACTIVITY_STATE_PATH

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

Environment variable: FB_EXPORT_DIR

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

Environment variable: FB_TOOL_PACKAGES

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 the single core package. The core package is then forced back on regardless, because its identity and diagnostic tools are what you need to debug the surface you just narrowed. An unrecognized name is a startup error, not a silently ignored token.Optional

Environment variable: FB_PACKAGES_DENY

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

Environment variable: FB_PACKAGES_READONLY

Transport protocol: stdio (default) or http. The http transport binds 127.0.0.1 only and fails closed without FB_HTTP_TOKEN.Optional

Environment variable: FB_TRANSPORT

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

Environment variable: FB_HTTP_TOKEN

Port for the HTTP transport (loopback only); used when FB_TRANSPORT=http. Integer in [1, 65535].Optional

Environment variable: FB_HTTP_PORT

Default ad account ID (act_… or the bare numeric id) for the opt-in ads package.Optional

Environment variable: FB_AD_ACCOUNT_ID

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

Environment variable: FB_ADS_BUDGET_CEILING

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 as FB_ADS_BUDGET_CEILING.Optional

Environment variable: FB_ADS_CAMPAIGN_SPEND_CAP_MAX

Stderr log verbosity: debug, info, warn or error. Logs never go to stdout — that is the stdio protocol channel.Optional

Environment variable: FB_LOG_LEVEL

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-ivanbbaev-facebook-mcp": {
      "env": {
        "FB_APP_ID": "your-fb-app-id-here",
        "FB_PAGE_ID": "your-fb-page-id-here",
        "FB_HTTP_PORT": "your-fb-http-port-here",
        "FB_LOG_LEVEL": "your-fb-log-level-here",
        "FB_MEDIA_DIR": "your-fb-media-dir-here",
        "FB_TRANSPORT": "your-fb-transport-here",
        "FB_APP_SECRET": "your-fb-app-secret-here",
        "FB_EXPORT_DIR": "your-fb-export-dir-here",
        "FB_HTTP_TOKEN": "your-fb-http-token-here",
        "FB_PAGE_TOKEN": "your-fb-page-token-here",
        "FB_WRITE_MODE": "your-fb-write-mode-here",
        "FB_API_VERSION": "your-fb-api-version-here",
        "FB_ACCESS_TOKEN": "your-fb-access-token-here",
        "FB_JOURNAL_PATH": "your-fb-journal-path-here",
        "FB_SYSTEM_TOKEN": "your-fb-system-token-here",
        "FB_AD_ACCOUNT_ID": "your-fb-ad-account-id-here",
        "FB_CONFIRM_TOKEN": "your-fb-confirm-token-here",
        "FB_PACKAGES_DENY": "your-fb-packages-deny-here",
        "FB_TOOL_PACKAGES": "your-fb-tool-packages-here",
        "FB_ADS_API_VERSION": "your-fb-ads-api-version-here",
        "FB_HOST_CONCURRENCY": "your-fb-host-concurrency-here",
        "FB_MAX_RESULT_CHARS": "your-fb-max-result-chars-here",
        "FB_PACKAGES_READONLY": "your-fb-packages-readonly-here",
        "FB_ADS_BUDGET_CEILING": "your-fb-ads-budget-ceiling-here",
        "FB_REQUEST_TIMEOUT_MS": "your-fb-request-timeout-ms-here",
        "FB_ACTIVITY_STATE_PATH": "your-fb-activity-state-path-here",
        "FB_ADS_CAMPAIGN_SPEND_CAP_MAX": "your-fb-ads-campaign-spend-cap-max-here"
      },
      "args": [
        "-y",
        "@ivanbaev/facebook-mcp"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

facebook-mcp — Facebook Pages MCP Server

CICodeQLLicense: MITnodeMCP
statuslast commitdocsSponsor

📖 Documentation site →

A local-first TypeScript Model Context Protocol (MCP) server for the Meta Graph API, focused on Facebook Pages — publishing, reading & insights, and comment/message moderation — driven from an MCP client (Claude, VS Code, the Inspector…) and operated locally by a Page admin using their own Meta developer app. Least-privilege tokens, plan-and-apply write safety, and no telemetry.

🚧 Status: pre-1.0, in active development. Published on npm as @ivanbaev/facebook-mcp — and the version number is the warning.

All seven tool packages are implemented — see the tool table for the exact surface. Nothing has been verified against the live Graph API yet. Every test in this repository runs against fakes and recorded fixtures behind a network fence that throws on a real fetch, so "the tests pass" means "the code does what the fixtures say", not "Meta accepted it". A live smoke harness exists (scripts/smoke/) but has not been run against a real Page as part of any released state. Treat every capability below as implemented but unproven, expect breaking changes until 1.0, and read Known limitations before you rely on anything.

Contents: Features · Requirements · Setup · Client compatibility · Configure credentials · Permissions · Tools · How this compares · Known limitations · Not in scope · Your responsibilities · Roadmap · Security notes · Documentation · Support · Trademark · License

Features

Implementation status only — see the status note above for what "implemented" does and does not mean.

AreaCapabilityStatus
Core & diagnosticsIdentity, Page listing, rate-limit usage, doctor pre-flight check✅ Implemented, not live-verified
ReadingPage & post reads, Reels, reactions, cursor pagination✅ Implemented, not live-verified
PublishingText / link / photo / video / Reels posts, scheduling, edit & delete✅ Implemented, not live-verified
InsightsPage & post insights, flat rows + per-metric summaries, deprecation-aware✅ Implemented, not live-verified
ModerationComment reads, replies, hide/delete, private reply, block/unblock✅ Implemented, not live-verified
MessagingConversation reads and replies within the 24-hour window✅ Implemented, not live-verified
AdsCampaign/adset/ad reads, insights, status & budget control — off by default✅ Implemented, not live-verified
Live verificationEvery tool exercised against a real Page and a real ad account❌ Not done — see the status note
npm / MCPB releasenpx @ivanbaev/facebook-mcp, attested bundle, registry listing✅ Published — 0.8.0

The default profile exposes a deliberately small, curated tool surface — each tool wraps one real capability rather than mirroring every Graph edge.

  • Local-first, no telemetry. Only three Meta hosts are ever reached (graph, graph-video, rupload); nothing phones home.
  • Least-privilege credentials. Works with a never-expiring System User token (Business Manager) or a long-lived Page token — no App Review required for an admin operating their own assets.
  • Safe writes. Tiered plan-and-apply gating; irreversible and spend actions require out-of-band confirmation and are never bypassed by an env flag.
  • Secret hygiene. Value-based redaction at a single choke-point across logs, errors, tool results, and the write journal.
  • Layered architecture. Lint-enforced core ← api ← mcp ← tools layering, tools-as-data with a central package registry.

Requirements

  • Node.js ≥ 22 (enforced by engines and a runtime guard in the launcher; the project targets the version in .nvmrc).
  • A Meta (Facebook) developer app — a Business-type app at Standard Access is enough; no App Review is needed to operate your own assets.
  • A Facebook Page (and, for the opt-in ads package, an ad account) you administer.

Setup

The first run is five steps, in this order. Budget about 20 minutes; most of it is Meta's app UI. docs/runbooks/onboarding.md is the long form with troubleshooting.

  1. Meta app — create a Business-type app at https://developers.facebook.com/apps and note its App ID and App Secret (Settings → Basic). setup-token needs both.

  2. Short-lived token — in the Graph API Explorer pick your app, User Token, tick the scopes you need (at least pages_show_list and pages_read_engagement), and Generate Access Token. It lives 1–2 hours, so do step 3 right away.

  3. Exchange it and write the env file — setup-token swaps it for a ~60-day token, resolves your Page and writes the env file:

    FB_APP_ID='<app id>' FB_APP_SECRET='<app secret>' \
    FB_SETUP_TOKEN='<explorer token>' \
      npx -y @ivanbaev/facebook-mcp setup-token
    

    Success is status: completed in the Run block and status: written in the Env file block. The file lands at ~/.config/facebook-mcp/.env ($XDG_CONFIG_HOME if set) or %APPDATA%\facebook-mcp\.env on Windows, mode 0600. The server reads it on every start, so the client config below needs no env block. More than one Page? Re-run with --page=<id> --force.

  4. Pre-flight — every package you plan to use should be usable:

    npx -y @ivanbaev/facebook-mcp doctor
    
  5. Register the server with your client and make the first call — see the next two subsections, then ask the client to "run facebook_whoami". A reply naming your token type and Page is the first successful tool call.

The doctor and setup-token reports name commands in the form you launched with (npx -y @ivanbaev/facebook-mcp …, facebook-mcp … after a global install, or node build/index.js … from a source checkout). --help writes facebook-mcp …; substitute your launch form. Every subcommand takes --help without touching the network.

(a) Via npx

Claude Code — one command, then check /mcp inside a session:

claude mcp add facebook -- npx -y @ivanbaev/facebook-mcp

It is registered for the current project directory by default; add --scope user to have it everywhere. Or install it as a plugin, which wires up the same command:

/plugin marketplace add IvanBBaev/facebook-mcp
/plugin install facebook-mcp

Claude Desktop — Settings → Developer → Edit Config opens claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\). Add the server, save, then quit and restart Claude Desktop:

{
  "mcpServers": {
    "facebook": {
      "command": "npx",
      "args": ["-y", "@ivanbaev/facebook-mcp"]
    }
  }
}

Claude Desktop does not load your shell profile. If Node comes from a version manager (nvm, fnm, asdf) and the server fails to start, put the absolute path of npx (which npx) in command.

Any other stdio client takes the same command / args pair — see Client compatibility.

Claude Desktop bundle (alternative) — the .mcpb attached to the latest release installs by double-click. Its settings form lists every credential as optional: leave them blank to use the env file from step 3 (a blank field never overrides it). It carries a build-provenance attestation, so you can prove it came out of this repository's workflow before you install it:

gh attestation verify facebook-mcp-0.8.0.mcpb --repo IvanBBaev/facebook-mcp

(b) From source

For development, or to run a commit that is not released yet:

git clone https://github.com/IvanBBaev/facebook-mcp.git
cd facebook-mcp
npm install
npm run build
node build/index.js setup-token   # with the same FB_* variables as step 3
node build/index.js doctor        # pre-flight: token, scopes, package matrix
node build/index.js               # or: ./bin/facebook-mcp.mjs

Point your MCP client at that command with an absolute path. The env block is optional — without it the server reads the env file, and a non-blank value here overrides the file:

{
  "mcpServers": {
    "facebook": {
      "command": "node",
      "args": ["/absolute/path/to/facebook-mcp/build/index.js"],
      "env": { "FB_SYSTEM_TOKEN": "…", "FB_PAGE_ID": "…" }
    }
  }
}

(c) Instagram alongside: the sibling server

This server stays Pages-only. Instagram professional accounts are covered by the separate instagram-mcp-ai server (publishing, media, comments, insights, DMs). Run both side by side; each keeps its own credentials and env file (~/.config/instagram-mcp-ai/.env for Instagram, set up with npx instagram-mcp-ai login), so neither config below needs an env block.

Claude Code:

claude mcp add facebook -- npx -y @ivanbaev/facebook-mcp
claude mcp add instagram -- npx -y instagram-mcp-ai

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "facebook": {
      "command": "npx",
      "args": ["-y", "@ivanbaev/facebook-mcp"]
    },
    "instagram": {
      "command": "npx",
      "args": ["-y", "instagram-mcp-ai"]
    }
  }
}

The two servers share nothing at runtime: a post to a Page and a post to Instagram are two tool calls, each with its own preview. Tool names do not collide (facebook_* here).

Client compatibility

This is a standard stdio MCP server with no client-specific code, so it should work anywhere the protocol does. "Should" is the operative word: the table records the configuration each client needs and whether that path has actually been exercised — not a promise.

ClientHow you register itVerified?
Claude Desktopclaude_desktop_config.json → mcpServers, or a .mcpb bundle❌ Not yet — bundle never installed end-to-end
Claude Codeclaude mcp add, or the plugin marketplace in this repo❌ Not yet
VS Code (Copilot Chat / agent).vscode/mcp.json → servers❌ Not yet
Cursor~/.cursor/mcp.json → mcpServers❌ Not yet
Windsurf, Zed, Cline, …any client that speaks stdio JSON-RPC❌ Not yet
MCP Inspectorpoint it at node build/index.js❌ Not yet

What is verified, by automated test:

  • stdio framing — a test spawns the built server as a real subprocess, runs the full initialize → tools/list → tools/call handshake over pipes, and asserts that stdout carries protocol frames only (all logging goes to stderr).
  • Tool contracts — every tool's input/output schema, annotations, write tier and error mapping are unit-tested against fakes and recorded fixtures.
  • The HTTP transport — loopback binding, bearer-token rejection and session handling, again against a real local server.

None of that involves an MCP client or the Meta API. If you get it working with a client, say so in an issue — that is how this table turns into ✅.

Platform notes

CI runs the full check on Linux (Node 22/24/26) and Windows (Node 22). macOS is the primary development platform but is not in CI. Paths for the env file, the write journal and FB_MEDIA_DIR follow XDG on POSIX and %APPDATA% on Windows.

Configure credentials

facebook-mcp authenticates with a token you already control — there is no App Review, no OAuth callback server, and no hosted component. Provide at least one of the token variables below; the most specific wins (FB_SYSTEM_TOKEN → FB_ACCESS_TOKEN → FB_PAGE_TOKEN):

  • FB_SYSTEM_TOKEN — a never-expiring System User token (Business Manager). Recommended: it does not expire and is scoped to the assets you assign it.
  • FB_ACCESS_TOKEN — a Meta user access token (a long-lived one preferred).
  • FB_PAGE_TOKEN — a long-lived Page token, the no-Business-Manager fallback. It belongs to exactly one Page, so set FB_PAGE_ID to that Page alongside it (doctor / facebook_whoami reports it as the acting Page).

Grant only the permissions the packages you enable actually need (full list below), and set FB_APP_SECRET so appsecret_proof is attached to every call — that makes a stolen bare token unusable on its own. Settings are read from an env file at the XDG/%APPDATA% config path, or from real environment variables (which take precedence).

If you would rather not assemble the env file by hand, run npx -y @ivanbaev/facebook-mcp setup-token (node build/index.js setup-token from source) — the guided flow exchanges and classifies a token and writes the env file for you (--page=<id>, --env-file=<path>, --force to overwrite, --no-write/--dry-run to rehearse; pass the token via FB_SETUP_TOKEN rather than on the command line; the exchange also needs FB_APP_ID and FB_APP_SECRET). See docs/runbooks/onboarding.md for the full walkthrough.

Then run doctor (npx -y @ivanbaev/facebook-mcp doctor) before anything else: it inspects the token, reports type, expiry and granted scopes, and prints a per-package usable / partial / blocked matrix so you find a missing permission before a tool call does. It ends with a one-line verdict over everything it found.

The doctor is a report, so it exits 0 whatever it finds — a wrapper that runs it for the text keeps working. Add --strict to make it a gate instead:

VerdictWith --strictMeans
OKexit 0Nothing needs attention.
WARNexit 1The server will run, but something is degraded (partial scopes, a token about to expire, a world-readable env file, a metric name Graph no longer accepts).
UNKNOWNexit 1A check could not be completed — typically debug_token was unreachable, so the credential is unverified rather than bad.
FAILexit 2This configuration cannot serve requests: no token, a token Graph rejects, revoked asset access, or no usable package.

UNKNOWN outranks WARN on purpose: "nothing was established" must not hide behind "degraded". A platform without POSIX permission bits raises no finding for the credential file — there is no chmod to recommend there, and a warning nothing can clear would make --strict permanently red on Windows.

node build/index.js --version (or -v) prints the server, Node and MCP SDK versions on one line and exits — it needs no credential, so it still answers on an install that cannot start:

facebook-mcp 0.8.0 (node v22.23.0, darwin arm64, sdk 1.32.1)

The bare server version is always the second field, so --version | awk '{print $2}' keeps working. The same three versions plus the pinned Graph API version are reported by facebook_whoami in its server object (name, version, apiVersion, sdkVersion). --help (or -h) prints the command summary and a first-run recipe to stdout and exits 0, again without reading any credential; setup-token --help and doctor --help do the same instead of running. doctor, setup-token, --version and --help are the only arguments that exit on their own; anything else starts the stdio server and waits on JSON-RPC. An argument doctor does not recognise (say --stric) never gates, but the report names it — option names only, never a value — so a mistyped --strict in CI is visible.

Environment variables

Provide at least one token; everything else is optional tuning. Variables marked Secret are never logged or returned by a tool.

VariableRequiredDefaultDescription
FB_SYSTEM_TOKENone of¹—Secret. System User token (Business Manager). Recommended; wins over the other two.
FB_ACCESS_TOKENone of¹—Secret. Meta user access token (a long-lived one preferred).
FB_PAGE_TOKENone of¹—Secret. Long-lived Page token — the no-Business-Manager fallback. Belongs to exactly one Page: set FB_PAGE_ID to that Page alongside it, or no Page-scoped tool can use it.
FB_APP_IDno—Meta app ID. With FB_APP_SECRET it forms the app token used to inspect tokens.
FB_APP_SECRETno—Secret. When set, appsecret_proof is attached so a stolen bare token is unusable.
FB_PAGE_IDno—Default Page ID for Page-scoped tools when a call omits profile. Required when FB_PAGE_TOKEN is the only credential (it names the Page the token belongs to).
FB_API_VERSIONnov26.0Graph API version to pin. Off-default values are accepted, but only the default is tested.
FB_ADS_API_VERSIONnov26.0Marketing API version for the ads tools (own lifecycle, separate from FB_API_VERSION). Off-default values are accepted, but only the default is tested.
FB_REQUEST_TIMEOUT_MSno60000Per-request timeout in milliseconds (1–600000).
FB_HOST_CONCURRENCYno4Max parallel requests per Graph host (1–64).
FB_MAX_RESULT_CHARSno25000Character budget before a tool result is truncated (500–10000000).
FB_WRITE_MODEnoplanplan (default) previews a write without mutating; apply executes. Never covers the irreversible/spend tiers.
FB_CONFIRM_TOKENno—Secret. Out-of-band confirmation token authorizing gated write / spend actions, for clients that cannot prompt. At least 16 characters.
FB_MEDIA_DIRno—Directory permitted as a source for local media uploads. Unset ⇒ URL-only, local file access disabled.
FB_JOURNAL_PATHnoXDG / %APPDATA% state pathPath to the append-only, rotating write journal (0600).
FB_ACTIVITY_STATE_PATHnoXDG / %APPDATA% state pathPath to the local high-water marks of facebook_get_activity_since (0600).
FB_EXPORT_DIRnoXDG / %APPDATA% state pathDirectory for insights file exports (output argument; 0700 dir, 0600 files).
FB_TOOL_PACKAGESnocore profile (all packages except ads)Comma-separated packages or profiles to enable. core is always forced on; ads is opt-in.
FB_PACKAGES_DENYno—Packages or profiles to exclude even if FB_TOOL_PACKAGES enables them; the core package always survives.
FB_PACKAGES_READONLYno—Packages or profiles whose write tools are not registered; their read tools stay.
FB_TRANSPORTnostdiostdio (default) or http (loopback-only Streamable HTTP for local agent clients).
FB_HTTP_TOKENif http—Secret. Bearer token required by the http transport; it fails closed without it. At least 16 characters.
FB_HTTP_PORTno3000TCP port for the http transport (the bind host is fixed to loopback 127.0.0.1).
FB_AD_ACCOUNT_IDno—Ad account ID for the opt-in ads package.
FB_ADS_BUDGET_CEILINGno—Hard budget ceiling for ads writes, in minor units of the ad account currency (non-negative integer, no currency conversion).
FB_ADS_CAMPAIGN_SPEND_CAP_MAXno—Largest campaign spend cap an ads write may set, in minor units of the ad account currency (non-negative integer, no currency conversion).
FB_LOG_LEVELnoinfoStderr log verbosity: debug, info, warn, error.
FB_SETUP_TOKENno—Secret. Short-lived user token consumed once by setup-token; the safe alternative to passing it as a CLI argument.
FB_PROFILE_<NAME>_PAGE_IDno—Page ID for a named profile, e.g. FB_PROFILE_BRAND_A_PAGE_ID.
FB_PROFILE_<NAME>_TOKENno—Secret. Optional per-profile token override for the matching FB_PROFILE__PAGE_ID.

¹ Provide at least one of FB_SYSTEM_TOKEN, FB_ACCESS_TOKEN or FB_PAGE_TOKEN. A full, commented template lives in .env.example.

Permissions you need to grant

Grant only what the packages you actually enable require. The scopes below are the ones this server asks for; node build/index.js doctor compares them against what your token really has and prints a per-package usable / partial / blocked matrix. business_management is deliberately not in this list — it is a setup-only permission that should never ride on a runtime token.

PackageRequired Graph permissions
corepages_show_listpages_read_engagement
readerpages_read_engagementpages_read_user_contentpages_show_list
postspages_manage_postspages_read_engagement
insightsread_insightspages_read_engagement
moderationpages_read_engagementpages_read_user_contentpages_manage_engagementpages_messagingpages_manage_metadata
messagespages_messagingpages_manage_metadatapages_read_engagementpages_read_user_content
adsads_readads_managementpages_read_engagement
page_adminpages_manage_metadatapages_read_engagement
ToolRequired Graph permissions
facebook_whoami(none — the token itself is enough)
facebook_list_pagespages_show_list
facebook_get_pagepages_read_engagement
facebook_usage(none — the token itself is enough)
facebook_list_postspages_read_engagement
facebook_get_postpages_read_engagement
facebook_list_reelspages_read_engagement
facebook_get_reactionspages_read_engagement
facebook_list_storiespages_read_engagement, pages_show_list
facebook_list_albumspages_read_engagement
facebook_list_photospages_read_engagement, pages_show_list
facebook_create_postpages_manage_posts
facebook_create_photo_postpages_manage_posts
facebook_create_video_postpages_manage_posts
facebook_create_reelpages_manage_posts
facebook_create_storypages_manage_posts
facebook_update_postpages_manage_posts
facebook_delete_postpages_manage_posts
facebook_list_scheduled_postspages_read_engagement
facebook_get_video_statuspages_read_engagement
facebook_page_insightsread_insights
facebook_post_insightsread_insights
facebook_reel_insightsread_insights
facebook_get_page_reportread_insights, pages_read_engagement
facebook_get_posts_insightsread_insights, pages_read_engagement
facebook_list_commentspages_read_engagement, pages_read_user_content
facebook_get_commentpages_read_engagement, pages_read_user_content
facebook_triage_commentspages_read_engagement, pages_read_user_content
facebook_reply_to_commentpages_manage_engagement
facebook_comment_on_postpages_manage_engagement
facebook_edit_commentpages_manage_engagement
facebook_hide_commentpages_manage_engagement
facebook_reply_and_hide_commentpages_manage_engagement, pages_read_engagement
facebook_like_commentpages_manage_engagement
facebook_delete_commentpages_manage_engagement, pages_read_user_content
facebook_private_replypages_messaging, pages_read_engagement, pages_read_user_content
facebook_block_userpages_manage_engagement
facebook_unblock_userpages_manage_engagement
facebook_get_moderation_settingspages_manage_metadata
facebook_set_moderation_settingspages_manage_metadata
facebook_list_conversationspages_messaging, pages_manage_metadata
facebook_get_conversationpages_messaging, pages_manage_metadata
facebook_send_messagepages_messaging
facebook_react_to_messagepages_messaging
facebook_upload_message_attachmentpages_messaging
facebook_get_activity_sincepages_read_engagement, pages_read_user_content, pages_messaging
facebook_list_saved_replies(none — the token itself is enough)
facebook_save_reply(none — the token itself is enough)
facebook_delete_saved_reply(none — the token itself is enough)
facebook_list_labelspages_manage_metadata
facebook_create_labelpages_manage_metadata
facebook_assign_labelpages_manage_metadata
facebook_delete_labelpages_manage_metadata
facebook_list_campaignsads_read
facebook_list_adsetsads_read
facebook_list_adsads_read
facebook_get_ad_objectads_read
facebook_get_ad_previewads_read
facebook_ads_insightsads_read
facebook_ads_report_statusads_read
facebook_update_ad_objectads_management
facebook_archive_ad_objectads_management
facebook_delete_ad_objectads_management
facebook_upload_ad_imageads_management
facebook_get_ad_set_targetingads_read
facebook_update_ad_set_targetingads_management
facebook_duplicate_ad_objectads_management
facebook_boost_postads_management, pages_read_engagement
facebook_update_page_profilepages_manage_metadata, pages_read_engagement

Tools

Packages are the unit of exposure: you enable and disable whole packages with FB_TOOL_PACKAGES, and FB_PACKAGES_READONLY drops a package's write tools while keeping its reads.

Documentation truncated — see the full README on GitHub.

Reviews

No reviews yet

Be the first to review this server!