blockbench-mcp-plugin

blockbench-mcp-plugin

0

Blockbench MCP is a plugin designed for Blockbench, allowing users to configure a local Model Context Protocol (MCP) server. It supports integration with applications such as Claude Desktop and VS Code, and invites contributions for tool and resource development.

Blockbench MCP

https://github.com/user-attachments/assets/ab1b7e63-b6f0-4d5b-85ab-79d328de31db

Plugin Installation

Open Blockbench, go to File > Plugins and click the "Load Plugin from URL" and paste in this URL:

https://jasonjgardner.github.io/blockbench-mcp-plugin/plugins/mcp/mcp.js

Model Context Protocol Server

Configure experimental MCP server under Blockbench settings: Settings > General > MCP Server Port and MCP Server Endpoint

The following examples use the default values of :3000/mcp

Installation

Claude Desktop

claude_desktop_config.json

{
  "mcpServers": {
    "blockbench": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://localhost:3000/mcp"
      ]
    }
  }
}
VS Code

.vscode/mcp.json

{
    "servers": {
        "blockbench": {
            "url": "http://localhost:3000/mcp"
        },
    }
}

Plugin Development

Contribution

Addition or modification of tools, prompts and resources is welcome. It should be a relatively-familiar process for Blockbench contributor/plugin authors; however, does require TypeScript compilation. Bun is recommended for the task.

Dev Setup

bunx @modelcontextprotocol/inspector

The Streamable HTTP transport URL defaults to http://localhost:3000/mcp

cd ./src/mcp
bun install
bun run build
Adding Tools
// ./src/mcp/server/tools.ts
import { z } from "zod";
import { createTool } from "@/lib/factories";

createTool({
    name: "tool_name",
    description: "Tool description for the AI agent"
    parameters: z.object({
        // Parameters required to execute your tool:
        examples: z.array({
            // Zod schema to collect arguments.
            // Does not have to be 1:1 with Blockbench
        })
    }),
    async execute({ examples }, { reportProgress }) {
        return JSON.stringify(examples.map((example, idx) => {
            reportProgress({
                progress: idx,
                total: examples.length
            });

            // Do something with parameters within current context.
            // Has access to Blockbench, electron, FastMCP, and other API
            // Return stringified results to report to AI agent context.

            return myExampleTransformFunction(example);
        }));
    }
});
Adding Resources

No factory function has been created yet. Refer to FactMCP's documentation for Resource examples.

Add resource-related code to ./src/mcp/server/resources.ts

Adding Prompts

No factory function has been created yet. Refer to FactMCP's documentation for Prompts examples.

Add prompt-related code to ./src/mcp/server/prompts.ts