@cofoundy/docs
v0.1.0
Published
CLI for docs.cofoundy.dev — installs the MCP server config + publish skill into Claude Code / Cursor / Codex.
Downloads
27
Maintainers
Readme
@cofoundy/docs
CLI for docs.cofoundy.dev. One command installs the MCP server config + publish skill into Claude Code, Cursor, or Codex.
Install
npx @cofoundy/docs installAuto-detects the editor by walking up the CWD for .claude/, .cursor/, or .codex/. Override with --target=claude|cursor|codex|all.
Idempotent — re-run safely. Existing MCP server entries in your config are preserved.
Commands
install [--target=auto|claude|cursor|codex|all]
Writes the cofoundy-docs MCP server entry into your editor's MCP config:
| Platform | Config path |
|---|---|
| Claude Code | .mcp.json (project) or ~/.claude.json |
| Cursor | .cursor/mcp.json (project) or ~/.cursor/mcp.json |
| Codex | .codex/config.toml (project) or ~/.codex/config.toml |
For Claude Code, the publish skill is additionally copied to ~/.claude/plugins/cofoundy-docs/skills/publish/.
login [--scope=team/<proj>/] [--ttl-days=N] [--url=https://docs.cofoundy.dev]
Opens the browser to https://docs.cofoundy.dev/api/agent/login?scope=…&ttl_days=…. After Cloudflare Access SSO, you'll see a one-time token block. Paste it back when the CLI prompts.
The token is stored at ~/.cofoundy/token with mode 0600 (verified post-write).
For non-interactive use:
npx @cofoundy/docs login --token=ct_xxxhttp:// URLs are refused (§9.7 — login tokens MUST travel over HTTPS).
whoami
Reads ~/.cofoundy/token, decodes the claims locally (no signature verify — that's docs-ai's job at request time), prints sub, scope, exp. Exits non-zero if the token is missing or expired.
Security
- §9.4 — the published npm artifact never bundles a token. The
filesfield inpackage.jsonwhitelists onlydist/,src/assets/, and docs. - §9.5 —
~/.cofoundy/tokenis created with mode0600. Parent directory is0700. - §9.6 —
installMERGES into existing MCP config files (JSON or TOML). It never overwrites unrelated entries. - §9.7 —
loginrejects non-https://URLs to prevent token interception.
Token environment variable
After login, your MCP client reads the token via the COFOUNDY_DOCS_TOKEN env var (the config entry contains Authorization: Bearer ${COFOUNDY_DOCS_TOKEN}). Either:
- Let the MCP client read it directly (some editors source
~/.cofoundy/tokenautomatically), or - Export it manually:
export COFOUNDY_DOCS_TOKEN="$(cat ~/.cofoundy/token)"License
MIT
