diff --git a/backend/apps/agents/core/mcp_preflight.py b/backend/apps/agents/core/mcp_preflight.py index 9e78b126..a9383302 100644 --- a/backend/apps/agents/core/mcp_preflight.py +++ b/backend/apps/agents/core/mcp_preflight.py @@ -66,6 +66,16 @@ CURATED_SHORTLIST: list[CuratedEntry] = [ "title": "Reddit", "description": "Browse, search, post, comment, vote, save, subscribe, and DM on Reddit from the user's own logged-in session; for reading or acting on Reddit.", }, + { + "id": "X", + "title": "X (Twitter)", + "description": "Read the timeline, search, post/reply/quote, like, retweet, bookmark, follow, and DM on X (Twitter) from the user's own logged-in session; for reading or acting on X.", + }, + { + "id": "TikTok", + "title": "TikTok", + "description": "Browse the feed, search, read videos/comments, like, comment, follow, and favorite on TikTok from the user's own logged-in session; for reading or acting on TikTok.", + }, { "id": "YouTube", "title": "YouTube", diff --git a/backend/apps/tools_lib/mcp_config.py b/backend/apps/tools_lib/mcp_config.py index d1b3efa1..898ba531 100644 --- a/backend/apps/tools_lib/mcp_config.py +++ b/backend/apps/tools_lib/mcp_config.py @@ -151,8 +151,8 @@ def derive_mcp_config(tool: ToolDefinition) -> Optional[dict]: existing_pp = env.get("PYTHONPATH") or os.environ.get("PYTHONPATH", "") env["PYTHONPATH"] = (p_project_root + os.pathsep + existing_pp) if existing_pp else p_project_root - # Reddit MCP runs as a Python shim (backend.apps.reddit_mcp_shim) that borrows the user's live browser session via the backend's cookie bridge, so it needs the localhost port + auth token, plus PYTHONPATH to import itself. - if tool.name.lower() == "reddit" and config.get("type") == "stdio": + # The session-borrow social shims (reddit/x/tiktok) each run as a Python shim that borrows the user's live browser session via the backend's cookie bridge, so they need the localhost port + auth token, plus PYTHONPATH to import themselves. + if tool.name.lower() in {"reddit", "x", "tiktok"} and config.get("type") == "stdio": from backend.auth import get_auth_token env = config.setdefault("env", {}) env["OPENSWARM_PORT"] = os.environ.get("OPENSWARM_PORT", "8324") diff --git a/frontend/src/app/pages/Tools/integrations.tsx b/frontend/src/app/pages/Tools/integrations.tsx index cc2747f7..eda5cf49 100644 --- a/frontend/src/app/pages/Tools/integrations.tsx +++ b/frontend/src/app/pages/Tools/integrations.tsx @@ -22,6 +22,34 @@ export interface Integration { } export const INTEGRATIONS: Integration[] = [ + { + id: 'x', + name: 'X', + description: 'Read your timeline, search, post, reply, quote, like, retweet, bookmark, follow, and DM, all from your own logged-in X (Twitter) session. No API key.', + mcp_config: { type: 'stdio', command: 'python', args: ['-m', 'backend.apps.x_mcp_shim'] }, + color: '#000000', + website: 'https://x.com', + connectInstructions: 'Uses your own X account: open x.com in an OpenSwarm browser card and sign in once. Nothing is stored, the integration borrows your live session per request and paces itself to stay within human limits.', + icon: ( + + + + ), + }, + { + id: 'tiktok', + name: 'TikTok', + description: 'Browse the For You feed, search, read videos and comments, like, comment, follow, and favorite, all from your own logged-in TikTok session. No API key.', + mcp_config: { type: 'stdio', command: 'python', args: ['-m', 'backend.apps.tiktok_mcp_shim'] }, + color: '#FE2C55', + website: 'https://www.tiktok.com', + connectInstructions: 'Uses your own TikTok account: open tiktok.com in an OpenSwarm browser card and sign in once. Nothing is stored. Note: TikTok signs every request, so signed writes and uploads route to the OpenSwarm browser agent (also free, using your real session).', + icon: ( + + + + ), + }, { id: 'reddit', name: 'Reddit', diff --git a/linter/config/config.json b/linter/config/config.json index 88c953e5..20ae95f8 100644 --- a/linter/config/config.json +++ b/linter/config/config.json @@ -143,6 +143,9 @@ "max-folder-items": [ "backend", "backend/apps", + "backend/apps/reddit_mcp_shim", + "backend/apps/x_mcp_shim", + "backend/apps/tiktok_mcp_shim", "backend/apps/agents", "backend/apps/agents/core", "backend/apps/agents/manager",