MCP Server Plugin (#335)

This commit is contained in:
Gregory Schier
2025-12-31 08:41:57 -08:00
committed by GitHub
parent 58eff84f43
commit 6b9b207e1c
44 changed files with 2144 additions and 191 deletions

View File

@@ -0,0 +1,26 @@
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import * as z from 'zod/v4';
import type { McpServerContext } from '../types.js';
export function registerWorkspaceTools(server: McpServer, ctx: McpServerContext) {
server.registerTool(
'list_workspaces',
{
title: 'List Workspaces',
description: 'List all open workspaces in Yaak',
inputSchema: z.object({}),
},
async () => {
const workspaces = await ctx.yaak.workspace.list();
return {
content: [
{
type: 'text' as const,
text: JSON.stringify(workspaces, null, 2),
},
],
};
},
);
}