Merge pull request #202 from jbjardine/cojbdev/kicad-mcp-backend-state

Add backend state MCP tool
This commit is contained in:
mixelpixx
2026-05-24 08:51:34 -04:00
committed by GitHub
6 changed files with 304 additions and 1 deletions

View File

@@ -165,6 +165,7 @@ export const directToolNames = [
"sync_schematic_to_board",
// UI management
"get_backend_state",
"check_kicad_ui",
];

View File

@@ -7,6 +7,25 @@ import { z } from "zod";
import { logger } from "../logger.js";
export function registerUITools(server: McpServer, callKicadScript: Function) {
// Get MCP/KiCAD backend and loaded file state
server.tool(
"get_backend_state",
"Return the active backend, realtime status, loaded project/board paths, and dirty state.",
{},
async () => {
logger.info("Getting KiCAD backend state");
const result = await callKicadScript("get_backend_state", {});
return {
content: [
{
type: "text",
text: JSON.stringify(result, null, 2),
},
],
};
},
);
// Check if KiCAD UI is running
server.tool("check_kicad_ui", "Check if KiCAD UI is currently running", {}, async () => {
logger.info("Checking KiCAD UI status");