sbuilder-mcp-tools

Defines the authoring contract for adding MCP tools to the sbuilder-mcp server.

Updated Aug 28, 2026
One-click install
npx skills add https://github.com/vuluu2k/sbuilder-mcp --skill sbuilder-mcp-tools-vuluu2k
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sbuilder-mcp-tools
Source: https://github.com/vuluu2k/sbuilder-mcp/tree/main/.claude/skills/sbuilder-mcp-tools
Command: npx skills add https://github.com/vuluu2k/sbuilder-mcp --skill sbuilder-mcp-tools-vuluu2k

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Contributors to the sbuilder-mcp repository need consistent rules for where a tool lives, how it answers, how credentials are routed, and where a new tool must be registered, otherwise tools corrupt the MCP channel, leak tokens, or silently skip publishing. ## Core Features & Use Cases - Tool authoring rules: Enforces answering through text()/image() helpers, console.error-only logging, .js ESM imports, and MCP annotations like readOnlyHint and destructiveHint. - Safe write defaults: Requires every writing tool to take dry_run defaulting to true and return a redacted would_send payload, and to publish through PageSession.applyAndPublish so live editors see changes. - Credential routing: Documents the path-prefix rule in credentialFor(path) mapping /api/v1 to SB_TOKEN, /api/auth to none, and everything else to the rotating session JWT. - Use Case: When adding a new endpoint tool under src/tools/, follow this contract to register it in src/server.ts, both docs/tools.md files, both README tool tables, and add a test before claiming it works. ## Quick Start Ask the agent to add a new MCP tool to sbuilder-mcp following the authoring contract in this skill.

Frequently Asked Questions about sbuilder-mcp-tools

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new MCP tool to sbuilder-mcp?▼

Create or extend a group file under src/tools/*.ts exporting registerXTools(server, ctx), then register it in src/server.ts, docs/tools.md, docs/tools.vi.md, both README tool tables, and add a test under test/. Run npm run build && npm test && npm run smoke before claiming it works.

How should a writing MCP tool handle dry_run?▼

A writing tool must accept a dry_run parameter defaulting to true and return { dry_run: true, would_send: redact(...) }. The redact() helper keys off field names rather than value shapes, so token format changes do not leak secrets.

Why does console.log break an MCP stdio server?▼

stdout is the MCP protocol channel, so a console.log corrupts the message stream for every client. The symptom appears as a client parse failure rather than an error in the server, which is why only console.error is allowed.

How does credential routing work for sbuilder API paths?▼

credentialFor(path) in src/transport/credential.ts routes by prefix: /api/v1 uses the SB_TOKEN key, /api/auth uses none, and everything else uses the session JWT. The session token must be read per use via ctx.session.token() because it rotates roughly every 15 minutes.

Why must tools use PageSession.applyAndPublish instead of doc.apply?▼

doc.apply only mutates the local document, so humans watching the live editor see nothing happen. PageSession.applyAndPublish applies patches locally and puts the batch on the live-edit wire when the agent has joined a room.

Can I hand-edit the generated catalog files in sbuilder-mcp?▼

No, src/catalog/*.generated.ts files must never be hand-edited. Regenerate them with WB_REPO=/path/to/web_builder npm run codegen, following the separate sbuilder-codegen skill.