
Facebook Publisher
io.github.anthonyjboloPublished by GitHub account anthonyjbolov0.1.1Updated Oct 24, 2026
Safe Facebook Pages publishing with brand-voice, image-required & anti-duplication checks.
Overview
A local MCP server that lets an assistant validate, generate images for, and publish or schedule posts to multiple Facebook Pages via the Meta Graph API.
- What you can do
- Publish or schedule posts on configured Facebook Pages, with validation on by default and an option to skip it. Dry-run all guardrails before publishing and get a go or block verdict with per-check details. Compare a draft against a page's recent posts using word 4-gram similarity to catch repeated angles. Generate a post image through OpenAI or fal.ai and get back a URL ready for publishing. All behavior is driven by a per-page config file with brand voice, banned topics and image policy.
- When to use it
- Useful when an assistant should draft, check and publish Facebook Page content across one or several pages, such as an agency managing client pages, a solo founder scheduling a month of posts, or a shop rotating promos with different lookback windows.
- Requirements
- Runs locally over stdio, installed from PyPI (for example with uvx) and configured in the MCP client. Requires a long-lived Meta Graph API user or page token in META_USER_TOKEN, and a config file path in MCP_FB_PUBLISHER_CONFIG or inline JSON in MCP_FB_PUBLISHER_CONFIG_JSON. Image generation is optional and needs OPENAI_API_KEY or FAL_KEY. Network access to the Meta Graph API.
Installation
In SourceWeft
- Open Facebook Publisher in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
mcp-fb-publisher
An MCP server that lets Claude (or any MCP-compatible LLM) safely publish posts to multiple Facebook Pages through the Meta Graph API, with built-in guardrails: brand-voice config, banned-topic blocklists, image-required enforcement, and anti-duplication checks across recent feed posts.
[Tests] [License: MIT] [Python 3.12+] [#BuiltOnClaudeCode]
Why this exists
Letting an LLM agent post directly to your Facebook Pages is a footgun unless you put guardrails in front. Common failure modes I have hit running 5+ pages:
- Token expired silently — post fails at midnight, nobody notices for 3 days.
- Same angle posted twice in 14 days — audience tunes out, reach drops.
- Text-only post when the brand voice mandates an image — engagement craters.
- Banned topic leaked — competitor name, internal codename, or deprecated product mentioned.
mcp-fb-publisher ships an MCP server that wraps the Meta Graph API behind 4 deterministic tools, all driven by a single config.yaml. Every publish call goes through validation by default. Validation is pure-Python (no LLM), reproducible in CI, and runs offline.
What it does
4 MCP tools:
5-minute quickstart
Wire it into Claude Desktop / Claude Code
Add to your claude_desktop_config.json:
Then ask Claude things like:
"Post on the marketing page: 'New collection drops Friday'. Generate an image first, validate, then publish."
Claude will call fb_generate_post_with_image → fb_validate_pre_publish → fb_publish_post.
Architecture
The split between generation, validation and publish is intentional: it lets the LLM iterate on the visual without burning Meta API quota, and it makes the guardrails inspectable in CI without a Meta account.
Anti-duplication strategy
We compare the candidate message against every post within anti_duplicate_lookback_days (per-page, default 14) using Jaccard similarity over word 4-grams:
- Normalize: lowercase, strip accents (NFKD), drop URLs, drop punctuation, collapse whitespace.
- Build the set of word-level 4-grams for both texts.
similarity = |A ∩ B| / |A ∪ B|- If
similarity >= similarity_threshold(default 0.5), block.
Why this and not embeddings: deterministic, free, no extra API key, fast enough for 50 candidates per call. If you want LLM-grade semantic comparison, add another layer on top — the fb_validate_pre_publish tool returns the score so your agent can decide.
Brand voice config
Note: the brand_voice field is informational — it's surfaced to the calling LLM via the tool description but the server itself does not LLM-validate against it. This is by design (tests must run offline). Layer your own LLM check on top if you want enforcement.
Use cases
1. Multi-page agency
You manage 5 Facebook pages for clients. Each has its own brand voice, banned topics (competitor names), and image policy. Configure them all in one config.yaml, give Claude the tool, and let the agent draft + validate + publish across all of them with safety rails.
2. Solo founder
You run a single product page and want Claude to schedule the next 30 days of posts. Set image_required: true, give the agent your product brief, and use fb_anti_duplicate_check to make sure no two posts land on the same angle within a fortnight.
3. E-commerce
You rotate flash promos. Set anti_duplicate_lookback_days: 7 for the promo page and 14 for the evergreen content page. Combine with scheduled_at to queue a week's worth of posts in one shot.
Development
All tests use httpx.MockTransport and pytest-mock. No real Meta API calls in tests.
Security
- The Meta token is read from
META_USER_TOKENonly. Never hard-code it. - Token strings are redacted from error messages (
***REDACTED***) before they leave the process. - The validator is sync and offline — safe to run in CI without exposing credentials.
config.yamlis in.gitignore. Onlyconfig.example.yamlis committed.
Roadmap
- Instagram Graph API support (the validator already works, only the meta_client publish path needs adapting).
- Optional ntfy webhook on publish failure.
- LLM-grade brand-voice scoring as an opt-in tool.
- Token rotation helper (
fb_check_token_expiry).
En français — pourquoi ce projet
Construit en Nouvelle-Calédonie pour gérer 5 pages FB en parallèle (auto-école, marketplace de bingo, atelier d'apps, marque de tee-shirts, page média). Tous les écueils ci-dessus sont des bugs que j'ai vraiment vécus. Le serveur MCP est la couche que j'aurais aimé avoir le premier jour — maintenant elle est libre.
License
MIT — see LICENSE.
Contributing
Issues + PRs welcome. Please run pytest and ruff check . before opening a PR. For substantial features, open an issue first to discuss.
#BuiltOnClaudeCode
Source: README.md at commit fba681d
Tools
0Version history
1- v0.1.1LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts