From 5ab97673243d144fecb1c722b1708e9c6a431078 Mon Sep 17 00:00:00 2001 From: jiasheng Date: Thu, 20 Aug 2026 20:12:57 +0800 Subject: [PATCH 1/2] feat(proxy): expand read operations and improve operation handling logic --- src/proxy.ts | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/proxy.ts b/src/proxy.ts index aab3a05..40bea6e 100644 --- a/src/proxy.ts +++ b/src/proxy.ts @@ -1,7 +1,16 @@ import SuperJSON from 'superjson' import type { McpOperation } from './types.js' -const READ_OPERATIONS = new Set(['findMany', 'findFirst', 'findUnique', 'count']) +const READ_OPERATIONS = new Set([ + 'findMany', + 'findUnique', + 'findFirst', + 'count', + 'aggregate', + 'groupBy', +]) +const DELETE_OPERATIONS = new Set(['delete', 'deleteMany']) +const UPDATE_OPERATIONS = new Set(['update', 'updateMany', 'updateManyAndReturn']) export async function executeProxyOperation( proxyUrl: string, @@ -10,7 +19,8 @@ export async function executeProxyOperation( ): Promise { const { json, meta } = SuperJSON.serialize(operation.args ?? {}) const isRead = READ_OPERATIONS.has(operation.operation) - const isDelete = operation.operation === 'deleteMany' + const isDelete = DELETE_OPERATIONS.has(operation.operation) + const isUpdate = UPDATE_OPERATIONS.has(operation.operation) const query = `q=${encodeURIComponent(JSON.stringify(json))}${ meta && Object.keys(meta).length @@ -30,13 +40,7 @@ export async function executeProxyOperation( const authHeader = authorization.startsWith('Bearer ') ? authorization : `Bearer ${authorization}` const response = await fetch(url, { - method: isRead - ? 'GET' - : isDelete - ? 'DELETE' - : operation.operation === 'update' - ? 'PUT' - : 'POST', + method: isRead ? 'GET' : isDelete ? 'DELETE' : isUpdate ? 'PUT' : 'POST', headers: { Authorization: authHeader, 'Content-Type': 'application/json', From dc2e4986be09a2b8dc9534bc1619c170a0c1413c Mon Sep 17 00:00:00 2001 From: Jiasheng Date: Sun, 23 Aug 2026 09:02:41 +0800 Subject: [PATCH 2/2] Bump version from 1.1.0 to 1.2.0 (#6) --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index fd3246d..4cb11bf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@zenstackhq/studio-mcp-remote", - "version": "1.1.0", + "version": "1.2.0", "description": "Local stdio MCP server bridging client calls and ZenStack local database proxy", "type": "module", "main": "./dist/index.js", @@ -36,4 +36,4 @@ "engines": { "node": ">=18.0.0" } -} \ No newline at end of file +}