Enjoying Blockend?

Give us a star on GitHub

Star on GitHub
blockend

Blockend

01 getting started

MCP server

Connect an AI coding client to Blockend and let it inspect, preview, and install blocks.

Blockend includes a Model Context Protocol server. It exposes CLI operations as tools over the stdio transport, so a supported AI client can list blocks, inspect a project, preview files, and install blocks without you typing each command.

The tools run the Blockend CLI in your project. They can write files and install packages, so review the proposed changes.

Quick start

Generate a project-local MCP config:

pnpm dlx blockend-cli mcp init --client cursor

Replace cursor with claude, codex, vscode, or windsurf. Restart the client, open the project, and ask it to list blocks or inspect the project.

Preview the config without writing files:

pnpm dlx blockend-cli mcp init --client cursor --dry-run

Supported clients

ClientConfig fileFormat
Claude Code.mcp.jsonJSON
Cursor.cursor/mcp.jsonJSON
VS Code.vscode/settings.jsonJSON with mcp.mcpServers
Codex CLI.codex/config.tomlTOML
Windsurf.windsurf/mcp.jsonJSON

The generated server command is:

npx -y blockend-cli mcp

Example JSON for Claude, Cursor, or Windsurf:

{
  "mcpServers": {
    "blockend": {
      "command": "npx",
      "args": ["-y", "blockend-cli", "mcp"]
    }
  }
}

VS Code uses the same server under mcp.mcpServers:

{
  "mcp.mcpServers": {
    "blockend": {
      "command": "npx",
      "args": ["-y", "blockend-cli", "mcp"]
    }
  }
}

Codex uses TOML:

[mcp_servers.blockend]
command = "npx"
args = ["-y", "blockend-cli", "mcp"]

Commands

mcp init

pnpm dlx blockend-cli mcp init

Without --client, the CLI asks which client to configure. It merges the Blockend server into an existing JSON config. For Codex, it writes the TOML file directly.

OptionDefaultDescription
--clientPromptclaude, codex, cursor, vscode, or windsurf.
--dry-runfalsePrint the target path and config without writing.
--forcefalseSkip the overwrite confirmation for an existing config.
--yesfalseSkip prompts and default to Claude Code.

Both --force and --yes skip the overwrite confirmation. JSON configs are merged, not replaced.

mcp

pnpm dlx blockend-cli mcp

Starts the stdio server. Your AI client normally runs this command for you.

Tools

ToolWhat it does
list_blocksLists block names, descriptions, and variants. Takes an optional projectPath.
list_recipesLists published recipes: curated, ordered stacks of blocks.
detect_projectReturns framework, language, package manager, and project structure.
add_blockInstalls one block into a project. Requires blockName and an absolute projectPath.
add_blocksInstalls several blocks. Requires blockNames and an absolute projectPath.
add_recipeInstalls every block in a recipe, in integration order. Requires recipe and projectPath.
diff_blockPreviews new, modified, and unchanged files without writing.
doctorChecks blockend.json, framework detection, and project layout.
update_checkCompares installed blocks with registry versions.
update_applyApplies available updates and rewrites imports.

add_block runs the equivalent of:

blockend add <block> --yes --json

That means it installs missing dependencies and overwrites conflicting files without asking. Use diff_block first. projectPath must be an absolute path; in a monorepo, use the workspace package path (see Monorepos). add_blocks runs the same command once per name, in order, and returns one result per block.

list_recipes lists the published recipes. add_recipe runs the equivalent of:

blockend add --recipe <recipe> --yes --json

It installs every block in the recipe in integration order. Optional blocks are skipped in this non-interactive mode.

Example prompts:

  • "List the blocks available for this project."
  • "What recipes are available?"
  • "Set up the authenticated-api recipe."
  • "Preview the logger block."
  • "Add the rate-limiter block with its memory store."
  • "Check whether installed blocks have updates."

Use registry keys in tool arguments: rate-limiter, logger, error-handler, and so on. rate-limit and pino-logger are not valid keys.

Monorepos

In a monorepo, each workspace package has its own blockend.json, and a block installs into the package its config belongs to. Point projectPath at the specific package, not the repo root.

  • detect_project on the workspace root returns a workspace object with the manager, root, and a packages[] list (each entry has a dir).
  • Pass projectPath as <root>/<dir> (for example <root>/apps/api) to add_block, add_blocks, add_recipe, diff_block, doctor, update_check, and update_apply.
  • list_blocks also takes an optional projectPath for this.
  • add_block, add_blocks, add_recipe, diff_block, update_check, update_apply, and list_blocks aimed at a workspace root return a message listing the packages and the --cwd command to run instead of guessing.
  • Two tools behave differently by design: detect_project returns the workspace discovery itself (as above), and doctor searches upward for blockend.json and reports it missing at a root, so point it at a package path.

Safety

  • Block tools write into your repository. Review the diff before accepting an install.
  • add_block and add_blocks use --yes, so they can overwrite existing block files.
  • Dependency installation can change package.json and your lockfile.
  • MCP does not add authentication or sandboxing. Run the client in a project where file writes are acceptable.
  • Keep blockend.json under version control so configuration changes are visible.

Troubleshooting

If the client cannot start the server, run the generated command directly:

npx -y blockend-cli mcp

If it exits immediately, check Node.js 20 or newer and network access to npm and GitHub. Tools that accept projectPath need an absolute path; in a monorepo, pass the workspace package. list_blocks falls back to the directory where the MCP server started when projectPath is omitted.

Use --dry-run to confirm which file the CLI would write. Use --force only after backing up an existing MCP config.

On this page