AgentHubAgentHub

facebook MCP Setup & Guide

MCP ServerMCP RegistryOfficial

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

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

Copy the install config on this page first, then verify docs and permissions upstream.

Overview

Facebook Pages MCP server for the Meta Graph API — publishing, insights, moderation, messaging facebook-mcp is a MCP Server listed from MCP Registry. Transports: stdio. This page includes an overview, setup tutorial, install commands, and use cases for Trae, Tongyi Lingma, Cursor, Claude Code, and VS Code.

Use cases

AgentHub Verified AvailabilityTested & Ready

Automated pipeline validated install commands, protocol & client compatibility

Verified At2026-10-31
Install Snippets TestedCLI & JSON config syntax verified
Protocol Handshake ReadyComplies with JSON-RPC 2.0 specifications
Origin Registry ActiveSourced from official-mcp-registry
Verified ClientsClaude Code、Claude Desktop、Cursor 等
Security Tier: A+ 级 · 官方认证推荐 (A+)·Maintained by official/verified teams, audited for standard MCP protocol compliance.

Copy by platform

Choose your platform

  1. Open or create .cursor/mcp.json in your project root
  2. Click Copy config and paste; merge only this mcpServers entry if others exist
  3. Replace <placeholders> in env with real secrets (see Environment variables below)
  4. Save, then Cmd+Shift+P → Reload Window

Pre-fill Environment Variables (Optional)

secret
secret
secret
secret
secret
secret
Privacy Guarantee: Keys are replaced 100% locally in your browser memory and are NEVER uploaded or stored on any server.
Click to copy snippet
{
  "mcpServers": {
    "facebook-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ivanbaev/facebook-mcp"
      ]
    }
  }
}

Setup tutorial

  1. Open the facebook-mcp page and confirm this MCP Server (source: MCP Registry).
  2. Copy the Cursor, Claude Code, or VS Code snippet.
  3. Merge it into mcpServers and replace env placeholders with real secrets.
  4. Reload the window, then call the MCP tools from your agent chat.

Install commands

Install commands and setup steps are in the HTML so search engines and no-JS browsers can read them without running client JavaScript.

Claude Code (local)

  1. Install Claude Code CLI
  2. Copy the command below, replace <placeholders> with real env values, then run in terminal
  3. See Environment variables below if listed
claude mcp add facebook-mcp -- npx -y @ivanbaev/facebook-mcp

Cursor — .cursor/mcp.json (local)

  1. Open or create .cursor/mcp.json in your project root
  2. Click Copy config and paste; merge only this mcpServers entry if others exist
  3. Replace <placeholders> in env with real secrets (see Environment variables below)
  4. Save, then Cmd+Shift+P → Reload Window
{
  "mcpServers": {
    "facebook-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ivanbaev/facebook-mcp"
      ]
    }
  }
}

VS Code — .vscode/mcp.json (local)

  1. Install GitHub Copilot in VS Code with MCP support
  2. Open or create .vscode/mcp.json in your project root
  3. Click Copy config and paste; merge only this mcpServers entry if others exist
  4. Replace <placeholders> in env with real secrets
  5. Save and Developer: Reload Window
{
  "mcpServers": {
    "facebook-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ivanbaev/facebook-mcp"
      ]
    }
  }
}

Claude Desktop — claude_desktop_config.json (local)

  1. Open Claude Desktop claude_desktop_config.json (see remote guide for paths)
  2. Click Copy config and merge under mcpServers
  3. Replace <placeholders> in env with real secrets
  4. Fully quit and restart Claude Desktop
{
  "mcpServers": {
    "facebook-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ivanbaev/facebook-mcp"
      ]
    }
  }
}

Trae — .trae/mcp.json (local)

  1. Trae → Settings → MCP, or edit .trae/mcp.json / global mcp.json
  2. Click Copy config and merge mcpServers
  3. Replace <placeholders> in env with real secrets
  4. Save and reload Trae
{
  "mcpServers": {
    "facebook-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ivanbaev/facebook-mcp"
      ]
    }
  }
}

Cherry Studio — MCP settings (local)

  1. Cherry Studio → Settings → MCP Servers → Add (STDIO)
  2. Or import JSON: click Copy config and merge mcpServers
  3. Replace <placeholders> in env; ensure Node.js / uv (npx, uvx) are installed
  4. Enable the server and check tools load
{
  "mcpServers": {
    "facebook-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ivanbaev/facebook-mcp"
      ]
    }
  }
}

Tongyi Lingma — MCP config (local)

  1. Lingma Settings → MCP → + → STDIO or config file
  2. Click Copy config and merge mcpServers
  3. Replace <placeholders> in env; need Node.js 18+ (npx) or uv (uvx)
  4. Confirm connected before using tools in agent chat
{
  "mcpServers": {
    "facebook-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ivanbaev/facebook-mcp"
      ]
    }
  }
}

Windsurf — mcp_config.json (local)

  1. Edit ~/.codeium/windsurf/mcp_config.json
  2. Click Copy config and merge mcpServers (stdio same as Cursor)
  3. Replace <placeholders> in env, save, refresh Cascade
{
  "mcpServers": {
    "facebook-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ivanbaev/facebook-mcp"
      ]
    }
  }
}

Cline — MCP Servers (local)

  1. Cline panel → Settings → MCP Servers
  2. Click Copy config and merge
  3. Replace <placeholders> in env, then save
{
  "mcpServers": {
    "facebook-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ivanbaev/facebook-mcp"
      ]
    }
  }
}

WorkBuddy — .workbuddy/mcp.json (local)

  1. Edit ~/.workbuddy/mcp.json (user) or project .workbuddy/mcp.json
  2. Or Plugins → MCP Servers → Configure MCP and paste the JSON below
  3. Replace <placeholders> in env; on Windows prefer absolute paths for command/scripts
  4. Save, restart WorkBuddy, confirm connector status is green
{
  "mcpServers": {
    "facebook-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ivanbaev/facebook-mcp"
      ]
    }
  }
}

Troubleshooting & Common ErrorsFAQ

Common connection errors and verified fixes for facebook-mcp

Getting 'connection closed' or exit code 1 in Cursor / Claude Code for facebook-mcp?

Usually caused by missing runtime paths or IDE environment inheritance. Fix steps: 1. Verify Node.js 18+ (npx) or Python 3.10+ (uvx) is installed; 2. Run 'which npx' or 'which uvx' in terminal, and replace 'command' with absolute path; 3. Reload or restart the client window after modifying config.

Fix Snippet
# Check binary path in terminal:
which npx
node -v
Getting 'spawn npx ENOENT' or 'command not found'?

The editor background process does not inherit your full terminal PATH. Solution: Globally install the package, or set the absolute binary path (e.g. C:\Program Files\nodejs\npx.cmd on Windows, or /usr/local/bin/npx on macOS).

Missing required environment variable or authentication failure?

facebook-mcp requires environment variables (FB_SYSTEM_TOKEN、FB_ACCESS_TOKEN、FB_PAGE_TOKEN、FB_APP_ID、FB_APP_SECRET、FB_PAGE_ID、FB_API_VERSION、FB_ADS_API_VERSION、FB_REQUEST_TIMEOUT_MS、FB_HOST_CONCURRENCY、FB_MAX_RESULT_CHARS、FB_WRITE_MODE、FB_CONFIRM_TOKEN、FB_MEDIA_DIR、FB_JOURNAL_PATH、FB_ACTIVITY_STATE_PATH、FB_EXPORT_DIR、FB_TOOL_PACKAGES、FB_PACKAGES_DENY、FB_PACKAGES_READONLY、FB_TRANSPORT、FB_HTTP_TOKEN、FB_HTTP_PORT、FB_AD_ACCOUNT_ID、FB_ADS_BUDGET_CEILING、FB_ADS_CAMPAIGN_SPEND_CAP_MAX、FB_LOG_LEVEL). Ensure you have added valid keys under the 'env' object in your config file without trailing whitespace.

Fix Snippet
// .cursor/mcp.json 或 claude_desktop_config.json
{
  "env": {
    "API_KEY": "your_actual_key_here"
  }
}

Tool Mock Playground

Sandbox

facebook-mcp Tool Interface Simulation · Preview tool schema & outputs without local runtime

Sandbox Ready
fn: facebook_mcpExecute the core tool interface of facebook-mcp
Request ArgumentsJSON Schema
{
  "target": "facebook-mcp",
  "action": "execute",
  "options": {
    "mode": "standard",
    "timeoutMs": 5000
  }
}
💡Parameters generated dynamically by Agent runtime
Agent Tool Output

Click 'Run Mock' above

to preview the raw response returned to the LLM

Env: AgentHub Virtual SandboxJSON-RPC 2.0

Decision Guide: Why & When to Use

Assess suitability before installing to save trial-and-error time

Best Suited For
  • PR review
  • Changelog generation
  • Cross-repo issue search
When NOT to Use
  • Replacing human security audit
  • Unauthorized repo access
Recommended Workflow Pairing:View Scenario →

facebook-mcp + Scenario Prompt → Complete Agent Automation

MCP hands-on: install to visible results

Follow the full lab (expected UI/output + contrast checks). After installing this item, verify with the tutorial prompts.

Open tutorial →

Related resources

Often paired with

中文公文写作

v2.0.46

SkillClawHub7210.6k

io.clawhub.gongyu0918-debug/chinese-official-writing

用于中文公文、事务性材料和新闻稿件的起草、改写、压缩、润色、审校、文种核对、去口语化、降 AI 味及 Word 格式处理,适用于机关、企事业单位、学校和新闻机构。涵盖申请、请示、报告、通知、通告、意见、决定、决议、议案、公报、命令、函、复函、批复、说明、方案、纪要、公告、公示、通报、制度、规定、办法、细则、操作规程、工作要点、总结、调研、讲话、致辞、主持词、述职、可研、审查材料、技术需求、新闻消息、编者按、新闻评论,以及采购、整改、反馈和 AI 算力等场景。

source

Keep exploring AgentHub

Most people compare similar tools or check scenario guides before installing—start here.

Listing badge: put AgentHub on your site

Copy either snippet into your project homepage, docs, or GitHub README. The badge is a hotlinked SVG — nothing to host — and it links back to this page so visitors can find the install steps.

PreviewListed on AgentHub: facebook-mcp
HTML
<a href="https://myagenthub.cn/p/io.github.IvanBBaev/facebook-mcp" title="Listed on AgentHub: facebook-mcp" target="_blank" rel="noopener">
  <img src="https://myagenthub.cn/badge/io.github.IvanBBaev/facebook-mcp?lang=en" alt="Listed on AgentHub: facebook-mcp" height="20" style="border:0"/>
</a>
Markdown (GitHub README)
[![Listed on AgentHub: facebook-mcp](https://myagenthub.cn/badge/io.github.IvanBBaev/facebook-mcp?lang=en)](https://myagenthub.cn/p/io.github.IvanBBaev/facebook-mcp)

Badges are generated on the fly from /badge/<package-id>, so name and listing changes propagate automatically. Keep the link target unchanged — it is what counts as the referral.

Unified Manifest

{
  "id": "io.github.IvanBBaev/facebook-mcp",
  "type": "mcp-server",
  "version": "0.8.0",
  "displayName": "facebook-mcp",
  "description": "Facebook Pages MCP server for the Meta Graph API — publishing, insights, moderation, messaging",
  "repository": {
    "url": "https://github.com/IvanBBaev/facebook-mcp",
    "source": "github"
  },
  "homepage": "https://ivanbbaev.github.io/facebook-mcp/",
  "distribution": {
    "packages": [
      {
        "registryType": "npm",
        "identifier": "@ivanbaev/facebook-mcp",
        "version": "0.8.0",
        "transport": "stdio",
        "environmentVariables": [
          {
            "name": "FB_SYSTEM_TOKEN",
            "description": "System-user access token (Business Manager). Takes precedence over FB_ACCESS_TOKEN and FB_PAGE_TOKEN when several are set.",
            "isSecret": true
          },
          {
            "name": "FB_ACCESS_TOKEN",
            "description": "Primary user access token. At least one of FB_SYSTEM_TOKEN, FB_ACCESS_TOKEN or FB_PAGE_TOKEN must be set.",
            "isSecret": true
          },
          {
            "name": "FB_PAGE_TOKEN",
            "description": "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.",
            "isSecret": true
          },
          {
            "name": "FB_APP_ID",
            "description": "Meta app ID; combined with FB_APP_SECRET it forms the app access token used to authorize /debug_token inspection."
          },
          {
            "name": "FB_APP_SECRET",
            "description": "Meta app secret. When set, appsecret_proof is attached to every call so a stolen bare token cannot be used on its own.",
            "isSecret": true
          },
          {
            "name": "FB_PAGE_ID",
            "description": "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."
          },
          {
            "name": "FB_API_VERSION",
            "description": "Graph API version to target. Defaults to the tested pinned version; other values are accepted verbatim as an escape hatch but are not tested."
          },
          {
            "name": "FB_ADS_API_VERSION",
            "description": "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."
          },
          {
            "name": "FB_REQUEST_TIMEOUT_MS",
            "description": "Per-request timeout in milliseconds; integer in [1, 600000]."
          },
          {
            "name": "FB_HOST_CONCURRENCY",
            "description": "Maximum number of in-flight requests per Graph host; integer in [1, 64]."
          },
          {
            "name": "FB_MAX_RESULT_CHARS",
            "description": "Character budget applied by the result shaper before a tool result is truncated; integer in [500, 10000000]."
          },
          {
            "name": "FB_WRITE_MODE",
            "description": "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."
          },
          {
            "name": "FB_CONFIRM_TOKEN",
            "description": "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.",
            "isSecret": true
          },
          {
            "name": "FB_MEDIA_DIR",
            "description": "Directory permitted for local media uploads. Unset means URL-only uploads and no local file access at all."
          },
          {
            "name": "FB_JOURNAL_PATH",
            "description": "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."
          },
          {
            "name": "FB_ACTIVITY_STATE_PATH",
            "description": "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)."
          },
          {
            "name": "FB_EXPORT_DIR",
            "description": "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."
          },
          {
            "name": "FB_TOOL_PACKAGES",
            "description": "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."
          },
          {
            "name": "FB_PACKAGES_DENY",
            "description": "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."
          },
          {
            "name": "FB_PACKAGES_READONLY",
            "description": "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."
          },
          {
            "name": "FB_TRANSPORT",
            "description": "Transport protocol: stdio (default) or http. The http transport binds 127.0.0.1 only and fails closed without FB_HTTP_TOKEN."
          },
          {
            "name": "FB_HTTP_TOKEN",
            "description": "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.",
            "isSecret": true
          },
          {
            "name": "FB_HTTP_PORT",
            "description": "Port for the HTTP transport (loopback only); used when FB_TRANSPORT=http. Integer in [1, 65535]."
          },
          {
            "name": "FB_AD_ACCOUNT_ID",
            "description": "Default ad account ID (act_… or the bare numeric id) for the opt-in ads package."
          },
          {
            "name": "FB_ADS_BUDGET_CEILING",
            "description": "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)."
          },
          {
            "name": "FB_ADS_CAMPAIGN_SPEND_CAP_MAX",
            "description": "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."
          },
          {
            "name": "FB_LOG_LEVEL",
            "description": "Stderr log verbosity: debug, info, warn or error. Logs never go to stdout — that is the stdio protocol channel."
          }
        ]
      }
    ],
    "remotes": []
  },
  "dependencies": [],
  "installTargets": [
    "claude-code",
    "claude-desktop",
    "cursor",
    "vscode",
    "trae",
    "cherry-studio",
    "lingma",
    "windsurf",
    "cline",
    "workbuddy"
  ],
  "keywords": [],
  "provenance": {
    "origin": "official-mcp-registry",
    "originalId": "io.github.IvanBBaev/facebook-mcp",
    "originalUrl": "https://registry.modelcontextprotocol.io/v0.1/servers/io.github.IvanBBaev%2Ffacebook-mcp/versions/latest",
    "isOfficial": true,
    "status": "active"
  }
}
facebook MCP Setup & Guide - AgentHub