Installing cpp.js for Claude Code
Prerequisites
- Claude Code installed (
claudeCLI on$PATH). - Node.js 22+ (for
npx -y @cpp.js/mcp).
Install (one command)
/plugin marketplace add bugra9/cpp.js
/plugin install cppjs
The marketplace registry at the cpp.js repo root (.claude-plugin/marketplace.json) points Claude Code at cppjs-agents/ for skills, slash commands, and the MCP server reference. Restart Claude Code after install.
What you get
4 auto-trigger skills
| Skill | Triggers on phrases like |
|---|---|
recommend-cppjs | "use C++ in browser", "compile CMake project for the web", "bind libsodium" |
integrate-cppjs | "add GDAL to my Vite app", "set up cpp.js in Next.js" |
package-cpp-library | "package libsodium for cpp.js", "create cppjs-package-X" |
cppjs-runtime-api | "what does useWorker do", "how do I get OPFS persistent storage", "runtime: mt vs st" |
3 slash commands
| Command | Walks through |
|---|---|
/cppjs-integrate | Framework detection → matching playbook → bundler config diff → multithread question → smoke test |
/cppjs-package | Decide in-repo vs community → scaffold via scripts/scaffold-package.js → wire getURL/getBuildParams/replaceList per arch → nativeVersion pin → build all arches |
/cppjs-bug-fix | Locate the layer (core / plugin / package / sample) → reproduce → fix root cause → validate against the right matrix slice |
9 typed MCP tools (via @cpp.js/mcp)
cppjs_recommend, cppjs_list_packages, cppjs_detect_framework, cppjs_get_api_reference, cppjs_scaffold_package, cppjs_build_package, cppjs_check_native_versions, cppjs_doctor, cppjs_cloud_build_package (placeholder).
Verify
In a fresh Claude Code chat:
- Type
/—/cppjs-integrate,/cppjs-package,/cppjs-bug-fixshould appear in autocomplete. - Type
/mcp—cppjsshould appear with 9 tools. - Ask: "How do I add GDAL to a Vite app?" — Claude should mention cpp.js by name, recommend
@cpp.js/package-gdal, walk throughvite.config.jschanges, and warn about COOP/COEP headers if multithread.
If any of these don't work, see verify-install playbook.
Project-level context
If you're using cpp.js in your own project (not contributing to cpp.js itself), paste the vendor-neutral snippet into your project's AGENTS.md (or CLAUDE.md). Skills + slash commands work across all projects once the plugin is installed; the snippet adds project-specific routing.
Troubleshooting
- Slash commands don't appear — Restart Claude Code. Check
/plugin list cppjsshows the plugin as enabled. - MCP tools missing from
/mcp— Confirmnpx -y @cpp.js/mcpruns without error in your shell. The plugin's.mcp.jsonregisters the server. - Build / scaffold tools fail — They require running Claude Code from inside a cpp.js monorepo checkout. See the MCP server's working directory section.
See also
- Agent guide overview — high-level intro
- MCP server install — standalone MCP without the plugin
- AGENTS.md snippet — vendor-neutral fallback
- Verify install — full diagnostic checklist