
Facebook Publisher
io.github.anthonyjbolo由 GitHub 帳號 anthonyjbolo 發布v0.1.1更新於 Oct 24, 2026
Safe Facebook Pages publishing with brand-voice, image-required & anti-duplication checks.
概覽
本機 MCP 伺服器,讓助理透過 Meta Graph API 驗證、產生配圖,並向多個 Facebook 粉絲專頁發佈或排程貼文。
- 可以做什麼
- 在已設定的 Facebook 粉絲專頁上發佈或排程貼文,預設執行驗證,也可選擇略過。發佈前試跑全部防護規則,回傳放行或攔截的結論及各项檢查詳情。以詞 4-gram 相似度將草稿與專頁近期貼文比對,避免重複角度。透過 OpenAI 或 fal.ai 產生配圖並回傳可直接發佈的圖片網址。所有行為由依專頁設定的檔案驅動,包含品牌語氣、禁用話題和圖片政策。
- 適用情境
- 適合讓助理起草、檢查並發佈一個或多個 Facebook 粉絲專頁內容,例如代管客戶專頁的代理商、需要排程一個月貼文的獨立創業者,或依不同回溯期間輪換促銷的電商。
- 執行需求
- 以 stdio 在本機執行,從 PyPI 安裝(例如用 uvx)並在 MCP 用戶端中設定。需要長期有效的 Meta Graph API 使用者或專頁權杖,放在 META_USER_TOKEN;設定檔路徑放在 MCP_FB_PUBLISHER_CONFIG,或使用 MCP_FB_PUBLISHER_CONFIG_JSON 內嵌 JSON。圖片產生為選用,需要 OPENAI_API_KEY 或 FAL_KEY。需能存取 Meta Graph API 網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Facebook Publisher,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
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
來源:README.md,提交 fba681d
工具
0版本歷史
1- v0.1.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分