返回市场
方块基准-MCP插件

方块基准-MCP插件

作者:jasonjgardner20 星标更新:2025-11-22

项目介绍

Blockbench MCP

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

插件安装

打开Blockbench,进入文件 > 插件,点击“从URL加载插件”,然后粘贴以下URL:

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

模型上下文协议服务器

在Blockbench设置中配置实验性的MCP服务器:设置 > 常规 > MCP服务器端口MCP服务器端点

以下示例使用默认值 :3000/mcp

安装

Claude桌面

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"
        },
    }
}

插件开发

贡献

欢迎添加或修改工具、提示和资源。对于Blockbench贡献者/插件作者来说,这应该是一个相对熟悉的流程;然而,需要进行TypeScript编译。推荐使用Bun来完成此任务。

开发环境设置

bunx @modelcontextprotocol/inspector

可流式HTTP传输URL默认为 http://localhost:3000/mcp

cd ./src/mcp
bun install
bun run build

添加工具

// ./src/mcp/server/tools.ts
import { z } from "zod";
import { createTool } from "@/lib/factories";

createTool({
    name: "tool_name",
    description: "AI代理的工具描述"
    parameters: z.object({
        // 执行您的工具所需的参数:
        examples: z.array({
            // 使用Zod模式收集参数。
            // 不必与Blockbench一一对应
        })
    }),
    async execute({ examples }, { reportProgress }) {
        return JSON.stringify(examples.map((example, idx) => {
            reportProgress({
                progress: idx,
                total: examples.length
            });

            // 在当前上下文中使用参数执行某些操作。
            // 可以访问Blockbench、electron、FastMCP和其他API
            // 返回字符串化的结果以报告给AI代理上下文。

            return myExampleTransformFunction(example);
        }));
    }
});

添加资源

尚未创建工厂函数。参考FactMCP的文档中的资源示例

将与资源相关的代码添加到 ./src/mcp/server/resources.ts

添加提示

尚未创建工厂函数。参考FactMCP的文档中的提示示例

将与提示相关的代码添加到 ./src/mcp/server/prompts.ts