mcp-telegram-facebook
This server exposes MCP tools to bridge Telegram and Facebook: discovering/downloading Telegram videos, managing Facebook Pages, publishing content, and getting insights, plus a combined repost workflow.
Telegram video discovery: list recent videos in a chat/channel/group with metadata (message ID, caption, filename, size, duration).
Telegram video download: download a specific video by chat and message ID to a local path for later publishing.
Facebook Page management: list Pages the account manages, with IDs and access tokens.
Facebook video publishing: post a downloaded video to a Page with optional title, description, and page/token overrides.
Facebook text/feed publishing: publish text posts with optional links to a Page feed.
Facebook Page insights: retrieve metrics like impressions, engagement, and fans for a Page.
Combined repost workflow: repost a Telegram video to a Facebook Page in one step.
OAuth-protected MCP access: tools require OAuth (PKCE S256) and return MCP OAuth challenges for ChatGPT compatibility.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-telegram-facebook Repost the latest video from @mychannel to my Facebook Page"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Telegram–Facebook v0.4.0
Serveur MCP distant pour ChatGPT, Telegram et Facebook Graph API, conçu pour exposer une surface d'outils stable et exploitable par les clients MCP.
Correctifs v0.4.0
31 outils enregistrés avant
connect()pour chaque session HTTP.Passage de l'ancienne API
server.tool()àserver.registerTool().Chaque outil possède un titre, des annotations MCP (
readOnlyHint,destructiveHint,idempotentHint,openWorldHint) et unoutputSchema.Chaque outil déclare OAuth via
securitySchemesdans_metapour la compatibilité des clients ChatGPT qui lisent ce champ de rétrocompatibilité.Les résultats renvoient à la fois
contentetstructuredContent.Les appels
tools/callsans token renvoient un résultat MCPisError: trueavec_meta["mcp/www_authenticate"], ce qui permet à ChatGPT de déclencher l'interface OAuth au niveau de l'outil.initializeettools/listrestent découvrables avant connexion OAuth : ChatGPT peut donc voir les outils et leurs métadonnées avant de demander l'autorisation.CORS autorise explicitement
Authorization.OAuth exige PKCE S256, vérifie issuer, audience, expiration et scope, et empêche la réutilisation d'un code d'autorisation pendant sa durée de vie.
Les Page Access Tokens Facebook sont résolus côté serveur et ne sont plus proposés comme arguments d'outils ni renvoyés au modèle.
/healthexpose le nombre et la liste des outils sans exposer de secrets.Les identifiants, tokens et secrets restent exclusivement dans les variables d'environnement Railway.
Related MCP server: Facebook MCP Server
Variables Railway
Conserver les variables déjà configurées. Le code n'écrase aucune valeur existante.
FACEBOOK_PAGE_ID=...
FACEBOOK_ACCESS_TOKEN=...
FACEBOOK_GRAPH_VERSION=...
MCP_PUBLIC_URL=https://mcp-telegram-facebook-production.up.railway.app
OAUTH_JWT_SECRET=...
MCP_AUTH_USERNAME=...
MCP_AUTH_PASSWORD=...Pour Telegram, conserver également les variables existantes (TELEGRAM_API_ID, TELEGRAM_API_HASH, TELEGRAM_SESSION, etc.).
Endpoints
POST /mcpetPOST /— Streamable HTTP MCP (les deux routes sont acceptées)GET /.well-known/oauth-protected-resource— Protected Resource MetadataGET /.well-known/oauth-authorization-server— Authorization Server MetadataGET /.well-known/openid-configuration— alias de découverte compatible OIDCGET /oauth/authorize— Authorization Code + PKCEPOST /oauth/authorize— validation des identifiants et émission du codePOST /oauth/token— échange PKCE contre access tokenGET /health— état public non sensible et liste des outils
Vérification rapide
Après déploiement, /health doit indiquer toolCount: 31 après qu'une instance MCP a créé son serveur, et tools doit contenir les 31 noms.
Dans ChatGPT, reconnecter le serveur avec l'URL MCP /mcp. La découverte doit d'abord retourner tools/list; au premier tools/call sans token, le serveur renvoie le challenge OAuth MCP au niveau du résultat.
Available Tools
7 toolsfacebook_list_pagesA
Liste les Pages Facebook gérées par le compte, avec leur ID, nom et Page Access Token.
Inputs: no named parameters.
facebook_page_insightsB
Récupère les statistiques d'une Page Facebook (vues, portée, engagement...).
Inputs: pageId (required), period, metrics.
facebook_post_feedC
Publie un post texte (avec lien optionnel) sur le fil d'une Page Facebook.
Inputs: message (required), link, pageId, pageAccessToken.
facebook_post_videoB
Publie une vidéo locale (téléchargée depuis Telegram) sur une Page Facebook, avec un titre et une description personnalisés.
Inputs: filePath (required), title, pageId, description, +1 more.
repost_telegram_to_facebookA
Workflow complet : télécharge une vidéo Telegram puis la republie directement sur une Page Facebook avec une description personnalisée. Combine download + post.
Inputs: chat (required), messageId (required), title, pageId, +2 more.
telegram_download_videoA
Télécharge une vidéo Telegram sur le disque local et retourne son chemin. Ce chemin sera passé à facebook_post_video pour la republier.
Inputs: chat (required), messageId (required).
telegram_list_videosA
Liste les vidéos récentes d'un chat, canal ou groupe Telegram. Retourne pour chacune : messageId, légende, nom de fichier, taille et durée. Utilisez ensuite telegram_download_video avec le messageId choisi.
Inputs: chat (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose: Telegram video listing and download, Facebook page listing, video posting, text posting, insights, and a combined workflow tool. No overlap or ambiguity.
Tools follow a consistent snake_case pattern with prefixes (telegram_, facebook_) and verb_noun format. The combined workflow tool 'repost_telegram_to_facebook' is a minor deviation but descriptive.
Seven tools are well-scoped for bridging Telegram and Facebook operations, covering both individual steps and a combined workflow without being excessive or insufficient.
Covers the core workflow of transferring videos from Telegram to Facebook, plus additional Facebook features (text post, insights). Missing a tool to list Telegram chats for easier targeting, but not critical for the main purpose.
Maintenance
Related MCP Connectors
Publish and schedule Facebook Page posts from your AI assistant.
Instagram and Facebook Pages for AI agents: publish, comments, DM by keyword, inbox, insights.
Let AI assistants post to your Telegram chats, groups and channels. Not affiliated with Telegram.
Instagram + Facebook Pages: read comments, reply, DM commenters, comment-to-DM Auto DM rules.
Related MCP Servers
- AlicenseBqualityDmaintenanceAutomates Facebook Page management through the Graph API, enabling content posting, comment moderation, analytics tracking, and engagement monitoring through natural language interactions.3013MIT
- AlicenseNot gradedqualityDmaintenanceAutomates Facebook Page management via Graph API, enabling posting, comment moderation, and analytics through AI agents.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to automate Facebook Page management including posting, commenting, and analytics via the Facebook Graph API.MIT
- AlicenseNot gradedqualityDmaintenanceEnables authentication with Facebook and provides tools to list pages, post text/images, upload videos, and create Reels on Facebook Pages.15 npmISC