MCP Server
Connect Blockend to your AI coding assistant through the Model Context Protocol (MCP) to discover, analyze, and install backend blocks directly into your projects.
MCP Server
Blockend includes a built-in Model Context Protocol (MCP) server that allows AI coding assistants to interact with the Blockend CLI directly.
Instead of manually searching for blocks or running CLI commands yourself, your AI assistant can:
- Discover available Blockend blocks
- Analyze your current project
- Install production-ready backend blocks
- Automate backend scaffolding without leaving your editor
How it works
The MCP server exposes a small set of tools over the standard input/output (Stdio) transport.
When connected, your AI assistant can call these tools instead of asking you to run CLI commands manually.
AI Client
│
▼
Blockend MCP Server
│
▼
Blockend CLI
│
▼
Your ProjectSupported AI Clients
Blockend can automatically generate configuration files for the following clients:
| Client | Configuration |
|---|---|
| Claude Code | .mcp.json |
| Cursor | .cursor/mcp.json |
| VS Code | .vscode/settings.json |
| Codex CLI | .codex/config.toml |
| Windsurf | .windsurf/mcp.json |
Configure MCP
Initialize MCP for your preferred client.
Interactive setup
npx blockend-cli mcp initYou'll be prompted to choose your AI client.
Configure a specific client
npx blockend-cli mcp init --client cursorSupported values:
claude
cursor
vscode
codex
windsurfSkip confirmation prompts
npx blockend-cli mcp init --client cursor --yesOverwrite existing configuration
npx blockend-cli mcp init --client cursor --forcePreview without writing files
npx blockend-cli mcp init --dry-runThis prints the generated configuration without modifying your project.
Starting the MCP server
Once configured, your AI client starts the server automatically.
The command executed is:
npx -y blockend-cli mcpThe server communicates using the standard MCP Stdio transport.
Available Tools
list_blocks
Returns every Blockend block available for installation.
Example prompts:
- "Show all available authentication blocks."
- "List all logging-related blocks."
- "Find caching blocks."
detect_project
Analyzes your current project and detects its runtime environment.
The AI can understand things like:
- Framework
- Runtime
- Package manager
- Project structure
Example prompts:
- "Analyze this project."
- "What framework am I using?"
- "Inspect the current repository."
add_block
Installs a Blockend block directly into your project.
Example prompts:
- "Install the logger block."
- "Add the rate-limit block."
- "Install the error-handler block."
The server internally executes the equivalent of:
npx blockend-cli add <block-name>Example Workflow
After connecting Blockend to your AI assistant, you can use natural language.
Analyze this project.↓
The assistant calls detect_project.
What authentication blocks are available?↓
The assistant calls list_blocks.
Install the logger block.↓
The assistant calls add_block.
Everything happens directly inside your project without manually running CLI commands.
Generated Configuration
Depending on your selected client, Blockend generates the appropriate configuration automatically.
Example JSON configuration:
{
"mcpServers": {
"blockend": {
"command": "npx",
"args": ["-y", "blockend-cli", "mcp"]
}
}
}Example TOML configuration (Codex CLI):
[mcp_servers.blockend]
command = "npx"
args = ["-y", "blockend-cli", "mcp"]CLI Reference
Initialize MCP
npx blockend-cli mcp initInitialize for a specific client
npx blockend-cli mcp init --client cursorPreview configuration
npx blockend-cli mcp init --dry-runForce overwrite
npx blockend-cli mcp init --forceSkip prompts
npx blockend-cli mcp init --yesNext Steps
After configuring MCP:
- Restart your AI editor or client if necessary.
- Open your project.
- Ask your AI assistant to analyze the project or install Blockend blocks.
- The assistant will automatically communicate with the Blockend MCP server to perform the requested actions.