mcp-blockend
Scaffolds Express-specific backend blocks such as request validation, error handling, structured logging, and response formatting into a project.
Scaffolds Fastify-specific backend blocks such as request validation, error handling, structured logging, and response formatting into a project.
Scaffolds Hono-specific backend blocks such as request validation, error handling, structured logging, and response formatting into a project.
Provides a Redis storage option for the rate limiter block, enabling token bucket rate limiting backed by Redis.
Blockend
Blockend copies backend source files into your project. You choose a block, and the CLI writes its code into your repository. The code is yours: read it, change it, commit it, or remove it.
The CLI supports Express, Fastify, Next.js App Router, and Hono. The add command requires TypeScript.
Quick start
npx blockend-cli init
npx blockend-cli add request-validatorinit creates blockend.json with your framework, blocks directory, package manager, and import style. add writes the selected block.
import express from "express";
import { z } from "zod";
import { expressValidator } from "@/blocks/request-validator/adapters/express";
const app = express();
app.use(express.json());
const validate = expressValidator({
body: z.object({
name: z.string().min(1),
email: z.string().email()
})
});
app.post("/users", validate, (req, res) => {
const { body } = validate.validated(req);
res.status(201).json({ user: body });
});
app.listen(3000);If your blockend.json uses a different alias, import from that path instead. With no alias, use the relative path under paths.blocks.
Related MCP server: backgen-mcp
Blocks
Block | What it does |
Fixed-window limits with memory and Redis stores. | |
Classifies errors, hides internal details, and returns one response shape. | |
Pino logger with request IDs and async context. | |
Validates body, query, and params with Zod. | |
Success, error, and pagination envelopes. | |
Validates environment variables with Zod at startup. | |
Dependency checks with per-check timeouts and a JSON health report. | |
Drains requests and closes resources in priority order. | |
Deduplicates retries with an atomic store lock. | |
Argon2id hashing with a server-side pepper and rehash detection. | |
JWT access tokens and rotating refresh tokens. |
How it works
initdetects your project and writesblockend.json.addfilters the registry by framework, asks for a variant, and checks dependencies.The CLI copies source files into your blocks directory and rewrites imports.
The block is recorded in
blockend.jsonsoupdatecan compare versions.
There is no Blockend runtime dependency. Installed blocks use normal packages such as zod, pino, or jose.
CLI
Command | Description |
| Create |
| Write a block into the project. |
| Choose a block interactively. |
| Choose several blocks. |
| List blocks for your framework. |
| Report framework, language, package manager, and project settings. |
| Preview files without writing. |
| Check config and project health. |
| Compare installed blocks with registry versions. |
| Apply selected updates. |
| Start the MCP server. |
| Write MCP client config. |
See the CLI reference for options.
MCP
Blockend includes an MCP server for Claude Code, Cursor, VS Code, Codex CLI, and Windsurf.
npx blockend-cli mcp init --client cursorThe server exposes block listing, project detection, diff preview, install, update, and doctor tools. Installs run with --yes, so preview with the diff tool before writing.
Local development
Prerequisites:
Node.js 20 or newer
pnpm
git clone https://github.com/codewithnuh/blockend.git
cd blockend
pnpm install
pnpm build
pnpm devUseful commands:
pnpm test
pnpm lint
pnpm typecheck
pnpm validateRepository layout
blockend/
├── apps/
│ └── web/ Documentation site
├── blocks/ Block source code
│ ├── error-handler/
│ ├── env-config/
│ ├── graceful-shutdown/
│ ├── health-check/
│ ├── idempotency/
│ ├── logger/
│ ├── password-hash/
│ ├── rate-limiter/
│ ├── request-validator/
│ ├── response-formatter/
│ └── token-service/
├── packages/
│ └── cli/ CLI that copies blocks into projects
├── registry/
│ ├── config.json Registry format version
│ └── index.json Generated block metadata and file mappings
├── scripts/
├── turbo.json
└── pnpm-workspace.yamlEach block usually contains:
block.jsonwith metadata and file topologycore/or a core file with framework-agnostic logicadapters/for Express, Fastify, and Honovariants/for storage implementationstests next to the source
Each block's block.json maps its source files to the paths the CLI writes. The checked-in registry/index.json is generated from those declarations. Some blocks also provide framework-specific tests and SQL.
Contributing
Read CONTRIBUTING.md before adding a block. A block should solve a common backend problem, keep its core framework-independent, and include tests for each adapter it ships.
Docs
License
MIT. See LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
A full backend your AI coding agent can set up over MCP
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
The OpenZeppelin Solidity Contracts MCP server integrates OpenZeppelin's security and style rules into AI-driven development workflows, enabling AI assistants to generate safe, correct, and production-ready smart contracts. It automatically validates generated code against OpenZeppelin standards (including imports, modifiers, naming conventions, and security checks) and supports various contract types including ERC-20, ERC-721, ERC-1155, Stablecoins, RWA, Governor, and Account contracts through prompt-driven workflows.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Related MCP Servers
- AlicenseBqualityDmaintenanceProduction-grade MCP server that gives AI agents safe access to your local dev environment: filesystem, databases, processes, and OpenAPI specs.1533 npm3MIT
- AlicenseAqualityCmaintenanceBackGen's MCP server lets AI assistants scaffold production-ready Express.js + TypeScript backend projects with your choice of ORM (Prisma, Drizzle, Mongoose), install auth/payment/storage plugins, generate CRUD resources, and run health checks — all through natural language conversation.1020 npm4MIT
- AlicenseAqualityCmaintenanceMCP server for Shadcn Dashboard that enables AI to discover, search, and install UI blocks directly into projects without copy-paste.69 npmMIT
- FlicenseNot gradedqualityAmaintenanceA local-first MCP server that gives AI coding agents durable project memory, dependency graphs, and impact analysis to answer team knowledge and cross-file change questions before editing.2 npm1-