Getting Started with Xiaohongshu MCP: A Guide to Managing Content on Little Red Book
Have you ever wondered how to make posting content on Little Red Book easier, especially if you’re dealing with images and text? Little Red Book, known as Xiaohongshu in Chinese, is a popular platform for sharing lifestyle tips, travel stories, and more. If you’re a developer or someone who likes automating tasks, the xiaohongshu-mcp tool could be just what you need. This project integrates the Model Context Protocol, or MCP, to handle tasks like logging in and publishing posts through a simple HTTP setup.
In this guide, we’ll walk through everything step by step, from setting up the service to using it for real-world tasks. We’ll keep things straightforward, explaining terms as we go, so even if you’re not a tech expert, you can follow along. Think of MCP as a bridge that lets different tools talk to each other smoothly, here specifically for Little Red Book.
Understanding the Basics of Xiaohongshu MCP
The xiaohongshu-mcp is a tool designed for Little Red Book. Its main jobs are to help you log in to your account and publish posts that include both text and images. Right now, it focuses on these two features, with plans to add search capabilities later. This makes it useful for anyone who wants to automate content sharing on the platform without doing everything manually each time.
The service works over HTTP using a format called JSON-RPC, which is just a way for programs to send requests and get responses. You access it through specific addresses on your local computer: one for general API calls and another for the MCP protocol itself.
Here are the key access points:
-
HTTP API: http://localhost:18060/api/v1/* -
MCP Protocol: http://localhost:18060/mcp
To add this to tools like Claude Code CLI, you run a command that registers the HTTP endpoint. It’s like telling your computer, “Hey, connect to this service for Little Red Book tasks.”
Why Use This Tool for Little Red Book Content?
Posting on Little Red Book usually involves opening the app, typing your text, uploading photos, and hitting publish. But if you do this often—say, for marketing or sharing daily updates—it can get repetitive. The xiaohongshu-mcp simplifies that by letting you handle it through code or integrated tools. You log in once, start the service, and then use it to send posts automatically.
For example, you could pair it with content generation tools to create and publish in one go. This is especially handy for English-speaking users who might be sharing global content on a platform popular in China but accessible worldwide.
Keep in mind, the tool requires a login because Little Red Book needs user authentication for posting. Without it, nothing works—it’s the first step.
Step-by-Step Setup: Logging In and Starting the Service
Let’s break down how to get started. Assume you have basic tools like Go (a programming language) installed on your computer. The project is built with Go, so you’ll use commands to run it.
First: Handle the Login
You need to log in to your Little Red Book account manually the first time. This saves your session so future uses are seamless.
Run this command in your terminal:
go run cmd/login/main.go
This opens a process where you enter your credentials. Once done, the login state is stored locally. If you’re wondering why it’s manual, it’s to ensure security— you control the input directly.
After logging in, you can check if it’s successful later through the tool’s interface.
This image shows the process of verifying your login. It’s a quick way to confirm everything is set.
Next: Launch the MCP Service
With login complete, start the main service. Use this command:
go run . -headless=false
The “-headless=false” part means it runs with a visible browser window, which is helpful for seeing what’s happening. If you prefer it to run in the background without a window, you could change it to true, but the examples use false for clarity.
Once running, the service is active on your local port 18060. Now, other tools can connect to it for Little Red Book actions.
If you’re running this on a different machine or want remote access, replace “localhost” with the appropriate IP address in commands.
Verifying Your Setup: Using the Inspector Tool
How do you know if the service is working? There’s a handy tool called the inspector to check.
Run this in your terminal:
npx @modelcontextprotocol/inspector
This launches an interface. Look for the link it provides (often highlighted in red), open it in your browser, and enter http://localhost:18060/mcp. Click “Connect” to link up.
As shown here, this is how you set up the inspector configuration.
Once connected, click “List Tools” to see what’s available. You should see options for logging in and publishing image-text posts.
This step is like a health check—it lists all the tools and confirms the connection is good.
Publishing Content: How to Share Image-Text Posts
Now for the fun part: actually posting something. The tool supports publishing posts with text and images. For testing, examples use random images from sites like Unsplash.
In the inspector, select the publish tool, enter your text (like a title and description), and provide an image URL.
This animation walks through the steps: inputting details and sending the post.
After publishing, check your Little Red Book account to see the result. It should appear as a standard post with your text and the image.
Here’s an example of what a successful post looks like on the platform.
Detailed Steps for Publishing Via Inspector
-
Open the inspector as described. -
Connect to the MCP endpoint. -
Click “List Tools” and find the publish option. -
Fill in the fields: text content and image URL (e.g., from a public source like https://unsplash.com/). -
Execute the command. -
Verify on Little Red Book.
This process is straightforward and repeatable.
Integrating with Other Tools: Claude Code CLI Example
The real power comes from connecting this to other systems. Any tool that supports MCP can use it. One example is Claude Code CLI.
To add the service:
claude mcp add --transport http xiaohongshu-mcp http://localhost:18060/mcp
This registers it as an HTTP-based MCP server. If it’s not local, swap in the IP.
For a demo, use Claude Code with K2 (a model integration). The prompt might look like this:
“Help me write a post for Little Red Book. Use this image: https://cn.bing.com/th?id=OHR.MaoriRock_EN-US6499689741_UHD.jpg&w=3840. The image shows: ‘Ngātoroirangi Mine Bay Maori Rock Carvings at Lake Taupo, New Zealand (© Joppi/Getty Images)’. Publish using xiaohongshu-mcp.”
Claude generates the text, then uses the MCP to post it.
This gif illustrates the flow in Claude.
For a clearer view, check the high-definition version: Claude CLI Publishing
The end result is a polished post on Little Red Book, combining generated content with automated publishing.
Available Features in the MCP Toolset
Based on the setup, here are the tools you can use:
-
Login: Essential first step, checks and maintains your session. -
Publish Image-Text: Sends posts with descriptions and images.
Future additions might include search, but for now, stick to these.
To integrate into workflows, use the add command for CLI tools as shown.
Common Questions About Using Xiaohongshu MCP (FAQ)
You might have some questions as you get started. Let’s address them directly.
What is the Model Context Protocol for Little Red Book?
It’s a service that uses MCP to interact with Little Red Book, handling login and content publishing via HTTP.
How do I add this to Claude tools?
Use the command: claude mcp add –transport http xiaohongshu-mcp http://localhost:18060/mcp.
Why is login required every time?
Actually, it’s only manual the first time. The state is saved for ongoing use.
Does it support video posts?
No, currently only image-text posts. More features like search are planned.
Can I change the service port?
The project uses 18060 by default, but you might adjust it in the code if needed.
How does the inspector work?
Run the npx command, connect to the MCP URL, and list tools to see options.
What if publishing fails?
Double-check your login, network connection, or image URL validity.
Is remote access possible?
Yes, by using the server’s IP instead of localhost.
What’s the difference between MCP protocol and HTTP API?
The MCP is the main protocol endpoint, while the API is for versioned calls under /api/v1/.
What are the future plans for the tool?
Adding search functionality is on the list, but not yet implemented.
How-To Guide: Complete Workflow from Setup to Post
Need a full walkthrough? Here’s how to go from zero to published content.
How to Install and Prepare Xiaohongshu MCP
-
Get the project code (assume downloaded). -
Ensure Go is on your system. -
Run the login command to authenticate.
How to Start the Service
Execute go run . -headless=false to launch it.
How to Verify the Connection
Use the inspector tool: run npx, connect, and list tools.
How to Publish a Post
Via inspector: input text and image URL, execute.
Or via integration: add to Claude, provide a prompt.
How to Integrate with Claude
Add the MCP, then use prompts that specify publishing via xiaohongshu-mcp.
Digging Deeper: Practical Applications and Tips
Think about real uses. If you’re sharing travel photos, like the New Zealand rock carvings example, you can describe the scene in text and attach the image URL. The tool handles the upload.
For developers, this MCP integration means you can build scripts around it. For instance, generate content elsewhere and pipe it to the publish tool.
Key terms explained simply:
-
MCP: A way for models and tools to share context. -
JSON-RPC: A standard for remote calls, like sending instructions over the web. -
Headless: Running without a visible interface.
Challenges you might face:
-
If the service doesn’t start, check for port conflicts or Go installation issues. -
Image problems? Use public URLs that are accessible. -
Integration errors? Verify the add command syntax.
Case Study: Publishing with a Sample Image
Take the example from the project: Using a Bing image of Maori rock carvings. The prompt generates a post about New Zealand’s cultural sites, pairs it with the photo, and publishes. The result is a engaging share on Little Red Book.
Another test: Pick a random Unsplash image, add simple text, and post. It works reliably for quick shares.
Summarizing the Benefits
Using xiaohongshu-mcp saves time on repetitive tasks. From login to publish, it’s all streamlined. Whether you’re a casual user or building automations, it fits.
Expanding on Setup Details
Let’s revisit login. The command go run cmd/login/main.go prompts for your Little Red Book details. It’s secure because it’s local. Saved state means no repeated logins unless you change accounts.
For the service launch, -headless=false lets you watch the browser actions, which is great for learning. Switching to true hides it for production use.
Inspector Interface Breakdown
After running the npx command, the browser page has a connect button. Input the MCP URL, hit connect, then list tools. Each tool shows parameters—like for publish, text and image fields.
Executing a tool, like checking login, returns status info.
Publishing Parameters Explained
For image-text posts, you need:
-
Text: Your message or story. -
Image URL: A link to the photo, like from Getty or Unsplash.
No size limits specified, but follow Little Red Book’s general guidelines.
Claude Integration in Depth
The add command sets up the transport as HTTP. Then, in Claude, prompts can reference xiaohongshu-mcp directly.
The demo uses a specific image and description, generating a post about natural wonders. It’s a blend of AI content creation and automated publishing.
Tool Compatibility Notes
Works with any MCP-supporting system, not just Claude. This flexibility is a big plus.
Security and Performance Tips
Login data stays local—keep your machine secure. Performance is quick since it’s local, with no extra delays beyond network for publishing.
Customization Ideas
Want to tweak? Edit the code for port changes or add features, but stick to basics for now.
Manual vs. Automated Comparison
Manual: Log in app, write, upload, post.
Automated: Run service, input via tool, done.
Time saved adds up.
User Scenarios
-
Content creators: Daily posts automated. -
Testers: Quick image-text trials. -
Developers: Integrate into larger apps.
Quick Reference Table: Commands at a Glance
Command | Purpose | Notes |
---|---|---|
go run cmd/login/main.go | Log in to Little Red Book | Manual first time |
go run . -headless=false | Start MCP service | Use false for visible browser |
npx @modelcontextprotocol/inspector | Launch inspector | Check tools |
claude mcp add –transport http xiaohongshu-mcp http://localhost:18060/mcp | Integrate with Claude | For automated posts |
Step Lists for Key Tasks
Login Steps
-
Open terminal. -
Run command. -
Enter credentials. -
Confirm save.
Service Start
-
After login. -
Run go command. -
Wait for ready.
Verification
-
Run npx. -
Open link. -
Connect URL. -
List tools.
Publishing
-
In inspector or Claude. -
Input details. -
Execute. -
Check platform.
Extended FAQ
What functions does MCP support for Little Red Book?
Login and image-text publishing.
How to debug issues?
Use inspector for error messages.
Multiple accounts?
Run separate instances, perhaps.
Image requirements?
Public URLs, high quality.
Stopping the service?
Use Ctrl+C in terminal.
Updating the tool?
Pull new code if available.
Why Go language?
It’s efficient for this setup.
Comprehensive How-To: End-to-End Publishing
-
Prepare: Login via command. -
Launch: Start service. -
Verify: Inspector connect and list. -
Integrate: Add to Claude if using. -
Create: Input prompt or details. -
Publish: Execute and review.