@gutchain/mcp
v0.0.1
Published
MCP server that pushes an article + image into Gutchain platform drafts via the browser extension.
Readme
@gutchain/mcp
An MCP server that lets a Claude agent push an article + image into a platform draft (Xiaohongshu / Douyin / WeChat) using the user's logged-in browser, via the Gutchain browser extension.
The server never touches the platforms directly. It hands the content to the extension over a localhost WebSocket; the extension reuses its existing draft-filling pipeline (open the creator page, upload the image, fill title and body) so the user only has to review and publish.
Claude agent ──(MCP stdio)──→ @gutchain/mcp ──(ws://127.0.0.1)──→ extension ──→ platform draftSetup
- Install the Gutchain extension in Chrome and log in to the target platforms.
- Start the MCP server (see config below). On startup it prints a token to stderr.
- Open the extension options → MCP Bridge, paste the token, set the port, and enable the bridge.
Tool
gutchain_share
| arg | type | notes |
| -------------- | -------------------------------------- | -------------------------------------------------- |
| image | string (required) | data URL, local file path, or raw base64 |
| targets | ("xhs" \| "douyin" \| "wechat")[] | required, at least one |
| title | string | optional; derived from text if omitted |
| body | string | optional; falls back to text |
| text | string | source text used to derive title/body |
| authorName | string | optional |
| authorHandle | string | optional |
| imageMimeType| string | hint when image is bare base64 (default png) |
Config (env vars)
| var | default | meaning |
| ----------------------- | -------------- | -------------------------------- |
| GUTCHAIN_BRIDGE_PORT | 8765 | localhost WebSocket port |
| GUTCHAIN_BRIDGE_TOKEN | random per run | set a fixed token to avoid repaste |
Claude Code (local dev, before publishing)
Build first:
pnpm --filter @gutchain/mcp buildRegister with the Claude Code CLI (run once; --scope user makes it available in all projects):
claude mcp add gutchain --scope user \
--env GUTCHAIN_BRIDGE_PORT=8765 \
--env GUTCHAIN_BRIDGE_TOKEN=my-dev-secret \
-- node /Users/xuxinyu/projects/web/gutchain-web/packages/mcp/dist/index.jsVerify it was added:
claude mcp listTo remove:
claude mcp remove gutchain --scope userClaude Desktop / Claude config (after publishing to npm)
{
"mcpServers": {
"gutchain": {
"command": "npx",
"args": ["-y", "@gutchain/mcp"],
"env": {
"GUTCHAIN_BRIDGE_PORT": "8765",
"GUTCHAIN_BRIDGE_TOKEN": "choose-a-stable-secret"
}
}
}
}Security
- The WebSocket binds to
127.0.0.1only. - The extension must present the shared token before any share request is
accepted. Set a stable
GUTCHAIN_BRIDGE_TOKENso you paste it once.
