# How to Configure xiaohongshu-mcp for Cursor or VSCode: Complete Setup Guide

> Easily configure xiaohongshu-mcp for Cursor or VSCode. Follow our guide to set up the JSON file and reload your editor for seamless integration.

- Repository: [zy/xiaohongshu-mcp](https://github.com/xpzouying/xiaohongshu-mcp)
- Tags: how-to-guide
- Published: 2026-03-09

---

**Configure xiaohongshu-mcp by creating a JSON configuration file that points to `http://localhost:18060/mcp` and reloading your editor to register the tools.**

The **xiaohongshu-mcp** repository (`xpzouying/xiaohongshu-mcp`) provides an HTTP-based Model Context Protocol (MCP) server that enables AI assistants to interact with Xiaohongshu (Little Red Book) through tools for login, publishing, searching, and commenting. When you configure xiaohongshu-mcp for Cursor or VSCode, you bridge the local MCP server running on port 18060 with your editor's AI chat interface, allowing natural language commands like "publish this note to Xiaohongshu" to trigger actual API calls.

## Prerequisites

Before configuring your editor, ensure the MCP server is running locally.

### Start the MCP Server

Clone the repository and start the server using Go or a pre-built binary:

```bash

# Clone the repository

git clone https://github.com/xpzouying/xiaohongshu-mcp.git
cd xiaohongshu-mcp

# Run from source

go run .

# Or use a pre-built binary

chmod +x xiaohongshu-mcp-linux-amd64
./xiaohongshu-mcp-linux-amd64

```

The server starts on `http://localhost:18060/mcp` by default, as defined in [`main.go`](https://github.com/xpzouying/xiaohongshu-mcp/blob/main/main.go). Verify it is running with:

```bash
curl http://localhost:18060/mcp

```

## Configure xiaohongshu-mcp for Cursor

Cursor supports MCP through JSON configuration files that register external tool servers.

### Project-Level Configuration

Create a `.cursor` directory in your project root and add an [`mcp.json`](https://github.com/xpzouying/xiaohongshu-mcp/blob/main/mcp.json) file:

```bash
mkdir -p .cursor
cat > .cursor/mcp.json <<'EOF'
{
  "mcpServers": {
    "xiaohongshu-mcp": {
      "url": "http://localhost:18060/mcp",
      "description": "小红书内容发布服务 - MCP Streamable HTTP"
    }
  }
}
EOF

```

### Global Configuration

For system-wide availability, place the same JSON content in `~/.cursor/mcp.json` in your home directory.

### Verify the Connection

After saving the configuration, **completely restart Cursor**. Open the AI chat panel and look for the **Available Tools** section. You should see xiaohongshu-mcp tools listed, such as `check_login_status`, `publish_note`, and `search_notes`.

## Configure xiaohongshu-mcp for VSCode

VSCode implements MCP through workspace settings or the Command Palette interface.

### Using the Configuration File

Create a `.vscode` directory in your workspace and add an [`mcp.json`](https://github.com/xpzouying/xiaohongshu-mcp/blob/main/mcp.json) file:

```bash
mkdir -p .vscode
cat > .vscode/mcp.json <<'EOF'
{
  "servers": {
    "xiaohongshu-mcp": {
      "url": "http://localhost:18060/mcp",
      "type": "http"
    }
  },
  "inputs": []
}
EOF

```

### Using the Command Palette

Alternatively, use VSCode's graphical interface:

1. Open **Command Palette** (`Ctrl+Shift+P` or `Cmd+Shift+P`)
2. Type **"MCP: Add Server"** and select it
3. Choose **HTTP** as the transport type
4. Enter the URL: `http://localhost:18060/mcp`
5. Name the server: `xiaohongshu-mcp`

### Verify the Connection

After configuration, **reload VSCode** using `Ctrl+Shift+P` → **"Developer: Reload Window"**. Open the Copilot chat or any AI assistant panel. The xiaohongshu-mcp tools should appear in the tool registry, allowing commands like "帮我发布这篇笔记到小红书" to trigger the `publish_note` function defined in the `pkg/` directory.

## Troubleshooting Common Configuration Issues

When you configure xiaohongshu-mcp for Cursor or VSCode, you may encounter these common problems:

- **Server not reachable**: The MCP server must be running before the editor starts. Verify with `curl http://localhost:18060/mcp`. If the port is occupied, check [`main.go`](https://github.com/xpzouying/xiaohongshu-mcp/blob/main/main.go) for the default port configuration.

- **Editor shows "No tools available"**: The configuration file path must be exact. Cursor requires [`.cursor/mcp.json`](https://github.com/xpzouying/xiaohongshu-mcp/blob/main/.cursor/mcp.json) (project) or `~/.cursor/mcp.json` (global). VSCode requires [`.vscode/mcp.json`](https://github.com/xpzouying/xiaohongshu-mcp/blob/main/.vscode/mcp.json). JSON syntax errors will prevent registration.

- **"Login required" errors**: The tool execution fails if the cookie store is empty. Use the `check_login_status` tool or run the login CLI (`xiaohongshu-login-*`) to refresh authentication cookies stored in `configs/`.

- **Image or video upload failures**: When publishing notes, use absolute local paths without spaces or Unicode characters. The `pkg/` implementation processes these paths server-side; HTTP URLs must be publicly accessible.

## Summary

To configure xiaohongshu-mcp for Cursor or VSCode:

- Start the HTTP MCP server locally on `http://localhost:18060/mcp` using `go run .` or the binary
- Create a JSON configuration file at [`.cursor/mcp.json`](https://github.com/xpzouying/xiaohongshu-mcp/blob/main/.cursor/mcp.json) (Cursor) or [`.vscode/mcp.json`](https://github.com/xpzouying/xiaohongshu-mcp/blob/main/.vscode/mcp.json) (VSCode) pointing to the server URL
- Restart your editor to register the tools and verify they appear in the Available Tools panel
- Ensure valid Xiaohongshu authentication cookies are present to avoid login errors when invoking tools

## Frequently Asked Questions

### What is the default URL for xiaohongshu-mcp?

The default URL is `http://localhost:18060/mcp`. This endpoint is defined in [`main.go`](https://github.com/xpzouying/xiaohongshu-mcp/blob/main/main.go) and uses the Streamable HTTP transport protocol. Both Cursor and VSCode configurations must point to this URL to establish the MCP connection.

### Can I run xiaohongshu-mcp on a different port?

Yes, you can modify the port by changing the configuration in [`main.go`](https://github.com/xpzouying/xiaohongshu-mcp/blob/main/main.go) or setting environment variables before starting the server. However, you must update the URL in your Cursor or VSCode configuration file to match the new port (e.g., `http://localhost:8080/mcp`).

### Why does VSCode show "No tools available" after configuration?

This typically occurs when the [`.vscode/mcp.json`](https://github.com/xpzouying/xiaohongshu-mcp/blob/main/.vscode/mcp.json) file contains syntax errors, the server URL is incorrect, or the xiaohongshu-mcp server is not running. Verify the JSON structure matches the example in the README, ensure the server is active on port 18060, and reload VSCode using "Developer: Reload Window".

### Is xiaohongshu-mcp compatible with other MCP clients?

Yes, because xiaohongshu-mcp implements the standard Model Context Protocol over HTTP, it is compatible with any MCP client that supports Streamable HTTP transport. This includes Claude Desktop, other AI editors, and custom MCP clients, provided they can reach the `http://localhost:18060/mcp` endpoint.