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_desktop_config.json__
{
"mcpServers": {
"blockbench": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:3000/mcp"
]
}
}
}VS代码
__.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: "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);
}));
}
});添加资源
尚未创建工厂函数。参见 FactMCP的资源示例文档.
将资源相关代码添加到 ./src/mcp/server/resources.ts
添加提示
尚未创建工厂函数。参见 FactMCP的Prompts示例文档.
添加提示相关代码 ./src/mcp/server/prompts.ts
