social-connect-mcp-poc
Enables MCP-driven testing and verification of Facebook and TikTok connections, including OAuth flows and connection status checks.
README
Social Connect MCP POC
Node.js 22 POC không cần npm dependency để test Facebook + TikTok connection, OAuth và MCP connection tools.
1. Chạy ngay bằng mock
cp .env.example .env
npm test
npm start
Mở http://localhost:3000, sau đó bấm Test Facebook, Test TikTok hoặc Run test-all.
.env.example mặc định MOCK_SOCIAL=true, nên demo được ngay mà chưa cần secret.
2. Test khả năng truy cập endpoint thật
npm run probe
HTTP 400/401 khi không có token vẫn có nghĩa là endpoint provider đang reachable.
3. Chạy Facebook LIVE
Tạo Meta Developer App, thêm Facebook Login và cấu hình:
MOCK_SOCIAL=false
META_GRAPH_VERSION=v26.0
META_APP_ID=...
META_APP_SECRET=...
META_REDIRECT_URI=http://localhost:3000/api/facebook/callback
OAuth scopes POC:
pages_show_list
pages_read_engagement
pages_manage_posts
pages_manage_engagement
pages_messaging
Sau đó mở:
http://localhost:3000/api/facebook/login
Callback đổi authorization code thành user access token, gọi /me và /me/accounts, rồi giữ token tạm trong memory.
Bạn cũng có thể bypass OAuth để test token/Page trực tiếp:
META_USER_ACCESS_TOKEN=...
# hoặc
META_PAGE_ID=...
META_PAGE_ACCESS_TOKEN=...
4. Chạy TikTok LIVE
Tạo TikTok Developer App + Login Kit và cấu hình:
MOCK_SOCIAL=false
TIKTOK_CLIENT_KEY=...
TIKTOK_CLIENT_SECRET=...
TIKTOK_REDIRECT_URI=http://localhost:3000/api/tiktok/callback
TIKTOK_SCOPES=user.info.basic,video.list
Mở:
http://localhost:3000/api/tiktok/login
Callback dùng endpoint token v2 và sau đó test /v2/user/info/. Nếu app có video.list, POC test luôn /v2/video/list/.
Hoặc test token trực tiếp:
TIKTOK_ACCESS_TOKEN=...
5. API nội bộ
GET /api/health
GET /api/facebook/login
GET /api/facebook/callback
GET /api/facebook/test
GET /api/tiktok/login
GET /api/tiktok/callback
GET /api/tiktok/test
POST /api/tiktok/upload/init
POST /api/tiktok/upload/status
GET /api/test-all
6. MCP POC
npm run mcp
Tools:
social_status
facebook_test_connection
tiktok_test_connection
src/mcp-server.js là minimal stdio JSON-RPC MCP implementation để POC không phụ thuộc package ngoài. Khi nâng lên production nên thay bằng official MCP SDK.
7. Production TODO
POC cố ý chỉ giữ OAuth token trong memory. Production cần database/encrypted secret store, refresh-token rotation, Meta/TikTok webhook verification, RBAC, audit log, rate-limit/retry, App Review và token revocation flow.
8. Git
Repo đã được git init sẵn. Để đẩy lên GitHub sau khi tạo remote repository:
git remote add origin git@github.com:<username>/social-connect-mcp-poc.git
git push -u origin main
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.