Install
Add to ~/Library/Application Support/Claude/claude_desktop_config.json
Windows / Linux path
%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json{
"mcpServers": {
"io-github-ivanbbaev-facebook-mcp": {
"command": "npx",
"args": [
"-y",
"@ivanbaev/facebook-mcp"
],
"env": {
"FB_SYSTEM_TOKEN": "<YOUR_VALUE>",
"FB_ACCESS_TOKEN": "<YOUR_VALUE>",
"FB_PAGE_TOKEN": "<YOUR_VALUE>",
"FB_APP_ID": "<VALUE>",
"FB_APP_SECRET": "<YOUR_VALUE>",
"FB_PAGE_ID": "<VALUE>",
"FB_API_VERSION": "v23.0",
"FB_ADS_API_VERSION": "v26.0",
"FB_REQUEST_TIMEOUT_MS": "60000",
"FB_HOST_CONCURRENCY": "4",
"FB_MAX_RESULT_CHARS": "25000",
"FB_WRITE_MODE": "plan",
"FB_CONFIRM_TOKEN": "<YOUR_VALUE>",
"FB_MEDIA_DIR": "<VALUE>",
"FB_JOURNAL_PATH": "XDG / %APPDATA% state path",
"FB_ACTIVITY_STATE_PATH": "<VALUE>",
"FB_EXPORT_DIR": "<VALUE>",
"FB_TOOL_PACKAGES": "core profile (all packages except ads)",
"FB_PACKAGES_DENY": "<VALUE>",
"FB_PACKAGES_READONLY": "<VALUE>",
"FB_TRANSPORT": "stdio",
"FB_HTTP_TOKEN": "<YOUR_VALUE>",
"FB_HTTP_PORT": "3000",
"FB_AD_ACCOUNT_ID": "<VALUE>",
"FB_ADS_BUDGET_CEILING": "<VALUE>",
"FB_ADS_CAMPAIGN_SPEND_CAP_MAX": "<VALUE>",
"FB_LOG_LEVEL": "info",
"FB_SETUP_TOKEN": "<VALUE>"
}
}
}
}
Restart Claude Desktop to activate the new server.
Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
Windows / Linux path
.cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global).cursor/mcp.json (project) or ~/.cursor/mcp.json (global){
"mcpServers": {
"io-github-ivanbbaev-facebook-mcp": {
"command": "npx",
"args": [
"-y",
"@ivanbaev/facebook-mcp"
],
"env": {
"FB_SYSTEM_TOKEN": "<YOUR_VALUE>",
"FB_ACCESS_TOKEN": "<YOUR_VALUE>",
"FB_PAGE_TOKEN": "<YOUR_VALUE>",
"FB_APP_ID": "<VALUE>",
"FB_APP_SECRET": "<YOUR_VALUE>",
"FB_PAGE_ID": "<VALUE>",
"FB_API_VERSION": "v23.0",
"FB_ADS_API_VERSION": "v26.0",
"FB_REQUEST_TIMEOUT_MS": "60000",
"FB_HOST_CONCURRENCY": "4",
"FB_MAX_RESULT_CHARS": "25000",
"FB_WRITE_MODE": "plan",
"FB_CONFIRM_TOKEN": "<YOUR_VALUE>",
"FB_MEDIA_DIR": "<VALUE>",
"FB_JOURNAL_PATH": "XDG / %APPDATA% state path",
"FB_ACTIVITY_STATE_PATH": "<VALUE>",
"FB_EXPORT_DIR": "<VALUE>",
"FB_TOOL_PACKAGES": "core profile (all packages except ads)",
"FB_PACKAGES_DENY": "<VALUE>",
"FB_PACKAGES_READONLY": "<VALUE>",
"FB_TRANSPORT": "stdio",
"FB_HTTP_TOKEN": "<YOUR_VALUE>",
"FB_HTTP_PORT": "3000",
"FB_AD_ACCOUNT_ID": "<VALUE>",
"FB_ADS_BUDGET_CEILING": "<VALUE>",
"FB_ADS_CAMPAIGN_SPEND_CAP_MAX": "<VALUE>",
"FB_LOG_LEVEL": "info",
"FB_SETUP_TOKEN": "<VALUE>"
}
}
}
}
Cursor usually picks up config changes automatically; if the server does not appear, reload the window.
Add to .mcp.json (project) or ~/.claude.json (global)
Windows / Linux path
.mcp.json (project) or %USERPROFILE%\.claude.json (global).mcp.json (project) or ~/.claude.json (global){
"mcpServers": {
"io-github-ivanbbaev-facebook-mcp": {
"command": "npx",
"args": [
"-y",
"@ivanbaev/facebook-mcp"
],
"env": {
"FB_SYSTEM_TOKEN": "<YOUR_VALUE>",
"FB_ACCESS_TOKEN": "<YOUR_VALUE>",
"FB_PAGE_TOKEN": "<YOUR_VALUE>",
"FB_APP_ID": "<VALUE>",
"FB_APP_SECRET": "<YOUR_VALUE>",
"FB_PAGE_ID": "<VALUE>",
"FB_API_VERSION": "v23.0",
"FB_ADS_API_VERSION": "v26.0",
"FB_REQUEST_TIMEOUT_MS": "60000",
"FB_HOST_CONCURRENCY": "4",
"FB_MAX_RESULT_CHARS": "25000",
"FB_WRITE_MODE": "plan",
"FB_CONFIRM_TOKEN": "<YOUR_VALUE>",
"FB_MEDIA_DIR": "<VALUE>",
"FB_JOURNAL_PATH": "XDG / %APPDATA% state path",
"FB_ACTIVITY_STATE_PATH": "<VALUE>",
"FB_EXPORT_DIR": "<VALUE>",
"FB_TOOL_PACKAGES": "core profile (all packages except ads)",
"FB_PACKAGES_DENY": "<VALUE>",
"FB_PACKAGES_READONLY": "<VALUE>",
"FB_TRANSPORT": "stdio",
"FB_HTTP_TOKEN": "<YOUR_VALUE>",
"FB_HTTP_PORT": "3000",
"FB_AD_ACCOUNT_ID": "<VALUE>",
"FB_ADS_BUDGET_CEILING": "<VALUE>",
"FB_ADS_CAMPAIGN_SPEND_CAP_MAX": "<VALUE>",
"FB_LOG_LEVEL": "info",
"FB_SETUP_TOKEN": "<VALUE>"
}
}
}
}
The server will be available in the next Claude Code session.
Add to .vscode/mcp.json
Windows / Linux path
.vscode\mcp.json.vscode/mcp.json{
"servers": {
"io-github-ivanbbaev-facebook-mcp": {
"command": "npx",
"args": [
"-y",
"@ivanbaev/facebook-mcp"
],
"env": {
"FB_SYSTEM_TOKEN": "<YOUR_VALUE>",
"FB_ACCESS_TOKEN": "<YOUR_VALUE>",
"FB_PAGE_TOKEN": "<YOUR_VALUE>",
"FB_APP_ID": "<VALUE>",
"FB_APP_SECRET": "<YOUR_VALUE>",
"FB_PAGE_ID": "<VALUE>",
"FB_API_VERSION": "v23.0",
"FB_ADS_API_VERSION": "v26.0",
"FB_REQUEST_TIMEOUT_MS": "60000",
"FB_HOST_CONCURRENCY": "4",
"FB_MAX_RESULT_CHARS": "25000",
"FB_WRITE_MODE": "plan",
"FB_CONFIRM_TOKEN": "<YOUR_VALUE>",
"FB_MEDIA_DIR": "<VALUE>",
"FB_JOURNAL_PATH": "XDG / %APPDATA% state path",
"FB_ACTIVITY_STATE_PATH": "<VALUE>",
"FB_EXPORT_DIR": "<VALUE>",
"FB_TOOL_PACKAGES": "core profile (all packages except ads)",
"FB_PACKAGES_DENY": "<VALUE>",
"FB_PACKAGES_READONLY": "<VALUE>",
"FB_TRANSPORT": "stdio",
"FB_HTTP_TOKEN": "<YOUR_VALUE>",
"FB_HTTP_PORT": "3000",
"FB_AD_ACCOUNT_ID": "<VALUE>",
"FB_ADS_BUDGET_CEILING": "<VALUE>",
"FB_ADS_CAMPAIGN_SPEND_CAP_MAX": "<VALUE>",
"FB_LOG_LEVEL": "info",
"FB_SETUP_TOKEN": "<VALUE>"
}
}
}
}
Reload the VS Code window to activate.
Add to ~/.codeium/windsurf/mcp_config.json
Windows / Linux path
%USERPROFILE%\.codeium\windsurf\mcp_config.json~/.codeium/windsurf/mcp_config.json{
"mcpServers": {
"io-github-ivanbbaev-facebook-mcp": {
"command": "npx",
"args": [
"-y",
"@ivanbaev/facebook-mcp"
],
"env": {
"FB_SYSTEM_TOKEN": "<YOUR_VALUE>",
"FB_ACCESS_TOKEN": "<YOUR_VALUE>",
"FB_PAGE_TOKEN": "<YOUR_VALUE>",
"FB_APP_ID": "<VALUE>",
"FB_APP_SECRET": "<YOUR_VALUE>",
"FB_PAGE_ID": "<VALUE>",
"FB_API_VERSION": "v23.0",
"FB_ADS_API_VERSION": "v26.0",
"FB_REQUEST_TIMEOUT_MS": "60000",
"FB_HOST_CONCURRENCY": "4",
"FB_MAX_RESULT_CHARS": "25000",
"FB_WRITE_MODE": "plan",
"FB_CONFIRM_TOKEN": "<YOUR_VALUE>",
"FB_MEDIA_DIR": "<VALUE>",
"FB_JOURNAL_PATH": "XDG / %APPDATA% state path",
"FB_ACTIVITY_STATE_PATH": "<VALUE>",
"FB_EXPORT_DIR": "<VALUE>",
"FB_TOOL_PACKAGES": "core profile (all packages except ads)",
"FB_PACKAGES_DENY": "<VALUE>",
"FB_PACKAGES_READONLY": "<VALUE>",
"FB_TRANSPORT": "stdio",
"FB_HTTP_TOKEN": "<YOUR_VALUE>",
"FB_HTTP_PORT": "3000",
"FB_AD_ACCOUNT_ID": "<VALUE>",
"FB_ADS_BUDGET_CEILING": "<VALUE>",
"FB_ADS_CAMPAIGN_SPEND_CAP_MAX": "<VALUE>",
"FB_LOG_LEVEL": "info",
"FB_SETUP_TOKEN": "<VALUE>"
}
}
}
}
Restart Windsurf (or refresh its MCP servers panel) to activate the new server.
Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.
Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Windows / Linux path
%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json{
"mcpServers": {
"io-github-ivanbbaev-facebook-mcp": {
"command": "npx",
"args": [
"-y",
"@ivanbaev/facebook-mcp"
],
"env": {
"FB_SYSTEM_TOKEN": "<YOUR_VALUE>",
"FB_ACCESS_TOKEN": "<YOUR_VALUE>",
"FB_PAGE_TOKEN": "<YOUR_VALUE>",
"FB_APP_ID": "<VALUE>",
"FB_APP_SECRET": "<YOUR_VALUE>",
"FB_PAGE_ID": "<VALUE>",
"FB_API_VERSION": "v23.0",
"FB_ADS_API_VERSION": "v26.0",
"FB_REQUEST_TIMEOUT_MS": "60000",
"FB_HOST_CONCURRENCY": "4",
"FB_MAX_RESULT_CHARS": "25000",
"FB_WRITE_MODE": "plan",
"FB_CONFIRM_TOKEN": "<YOUR_VALUE>",
"FB_MEDIA_DIR": "<VALUE>",
"FB_JOURNAL_PATH": "XDG / %APPDATA% state path",
"FB_ACTIVITY_STATE_PATH": "<VALUE>",
"FB_EXPORT_DIR": "<VALUE>",
"FB_TOOL_PACKAGES": "core profile (all packages except ads)",
"FB_PACKAGES_DENY": "<VALUE>",
"FB_PACKAGES_READONLY": "<VALUE>",
"FB_TRANSPORT": "stdio",
"FB_HTTP_TOKEN": "<YOUR_VALUE>",
"FB_HTTP_PORT": "3000",
"FB_AD_ACCOUNT_ID": "<VALUE>",
"FB_ADS_BUDGET_CEILING": "<VALUE>",
"FB_ADS_CAMPAIGN_SPEND_CAP_MAX": "<VALUE>",
"FB_LOG_LEVEL": "info",
"FB_SETUP_TOKEN": "<VALUE>"
}
}
}
}
Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.
Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.
Configuration
Environment variables this server reads. Secrets stay on your machine.
| Name | Required | Description |
|---|---|---|
| FB_SYSTEM_TOKEN secret | No | System User token (Business Manager). Recommended; wins over the other two. |
| FB_ACCESS_TOKEN secret | No | Meta user access token (a long-lived one preferred). |
| FB_PAGE_TOKEN secret | No | Long-lived Page token — the no-Business-Manager fallback. |
| FB_APP_ID | No | Meta app ID. With FB_APP_SECRET it forms the app token used to inspect tokens. |
| FB_APP_SECRET secret | No | When set, appsecret_proof is attached so a stolen bare token is unusable. |
| FB_PAGE_ID | No | Default Page ID for Page-scoped tools when a call omits profile. |
| FB_API_VERSION | No | Graph API version to pin. Off-default values are accepted, but only the default is tested. Default: v23.0 |
| FB_ADS_API_VERSION | No | 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. Default: v26.0 |
| FB_REQUEST_TIMEOUT_MS | No | Per-request timeout in milliseconds (1–600000). Default: 60000 |
| FB_HOST_CONCURRENCY | No | Max parallel requests per Graph host (1–64). Default: 4 |
| FB_MAX_RESULT_CHARS | No | Character budget before a tool result is truncated (500–10000000). Default: 25000 |
| FB_WRITE_MODE | No | plan (default) previews a write without mutating; apply executes. Never covers the irreversible/spend tiers. Default: plan |
| FB_CONFIRM_TOKEN secret | No | Out-of-band confirmation token authorizing gated write / spend actions, for clients that cannot prompt. |
| FB_MEDIA_DIR | No | Directory permitted as a source for local media uploads. Unset ⇒ URL-only, local file access disabled. |
| FB_JOURNAL_PATH | No | Path to the append-only, rotating write journal (0600). Default: XDG / %APPDATA% state path |
| FB_ACTIVITY_STATE_PATH | No | 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 | No | 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 | No | Comma-separated packages or profiles to enable. core is always forced on; ads is opt-in. Default: core profile (all packages except ads) |
| FB_PACKAGES_DENY | No | Packages to exclude even if enabled by FB_TOOL_PACKAGES. |
| FB_PACKAGES_READONLY | No | Packages whose write tools are not registered; their read tools stay. |
| FB_TRANSPORT | No | stdio (default) or http (loopback-only Streamable HTTP for local agent clients). Default: stdio |
| FB_HTTP_TOKEN secret | No | Bearer token required by the http transport; it fails closed without it. |
| FB_HTTP_PORT | No | TCP port for the http transport (the bind host is fixed to loopback 127.0.0.1). Default: 3000 |
| FB_AD_ACCOUNT_ID | No | Ad account ID for the opt-in ads package. |
| FB_ADS_BUDGET_CEILING | No | Hard budget ceiling for ads writes, in minor currency units (non-negative integer). |
| FB_ADS_CAMPAIGN_SPEND_CAP_MAX | No | 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. |
| FB_LOG_LEVEL | No | Stderr log verbosity: debug, info, warn, error. Default: info |
| FB_SETUP_TOKEN | No | Short-lived user token consumed once by setup-token; the safe alternative to passing it as a CLI argument. |