xhs-mcp-server
Verified Safeby IChouChiang
Overview
A full-stack AI Agent system for automating social media tasks, specifically Xiaohongshu (XHS). It provides a Canva-like visual editor and an AI Assistant chat box to design, modify, and publish posts across various platforms.
Installation
cd backend && python agent_server.pyEnvironment Variables
- OPENAI_API_KEY
- APP_ENV
- LLM_API_KEY
- LLM_MODEL
- LLM_BASE_URL
- BACKEND_STORAGE_PATH
- MCP_PINTEREST_TOKEN
- MCP_PLATFORM_TOKEN
- DEFAULT_RESEARCH_PLATFORM
Security Notes
The system heavily relies on browser automation and script injection via the MCP (Model Context Protocol) bridge. This inherently involves high privileges and potential risks if not configured securely. Key concerns include: 1. Hardcoded MCP Bridge Path: The path to `mcp-server-stdio.js` is hardcoded in Python scripts, requiring manual adjustment by the user. An incorrect or malicious path could lead to arbitrary code execution in the controlled browser. 2. Session Injection: `auth.json` (containing browser cookies and localStorage) is injected into the browser. If this file is compromised or contains malicious scripts, it could lead to XSS-like vulnerabilities in the controlled browser. 3. Script Injection Tools: Functions like `inject_session` and `extract_images_from_page` explicitly inject JavaScript into the browser. While these seem controlled internally, any vulnerability in how user inputs are handled by these injection points could be exploited. Overall, the system's power to control a browser requires strict adherence to security best practices during setup and operation. The reliance on local configuration files (`auth.json`, `searcher_api.txt`) that are not committed to source control is a good practice.
Similar Servers
playwright-mcp
Provides a Model Context Protocol (MCP) server for LLMs to automate browser interactions using Playwright's accessibility tree, avoiding pixel-based vision models.
fetcher-mcp
This MCP server is designed for fetching web page content using a Playwright headless browser, enabling intelligent content extraction, JavaScript execution, and flexible output formats.
mcp-accessibility-scanner
Automated web accessibility scanning and browser automation using Playwright and Axe-core, enabling LLMs to perform WCAG compliance checks and generate reports.
browser-devtools-mcp
This MCP server provides AI coding assistants with comprehensive browser automation and debugging capabilities using Playwright, enabling execution-level and visual debugging for web pages.