Skip to content

Commit 3aeb4c7

Browse files
committed
feat: strictly enforce server mode, removing fallback to both
1 parent 3b1bc48 commit 3aeb4c7

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

mcp/dist/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19575,7 +19575,7 @@ var toolOwnerMap = /* @__PURE__ */ new Map();
1957519575
server.setRequestHandler(ListToolsRequestSchema, async () => {
1957619576
let aggregatedTools = [];
1957719577
toolOwnerMap.clear();
19578-
if (!mode || mode === "notebook") {
19578+
if (mode === "notebook") {
1957919579
if (notebookClient) {
1958019580
try {
1958119581
const response = await notebookClient.listTools();
@@ -19595,7 +19595,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
1959519595
aggregatedTools.push(...LOCAL_TOOLS);
1959619596
}
1959719597
}
19598-
if (!mode || mode === "visualization") {
19598+
if (mode === "visualization") {
1959919599
if (vizClient) {
1960019600
try {
1960119601
const response = await vizClient.listTools();
@@ -19779,7 +19779,7 @@ async function run() {
1977919779
}
1978019780
if (ideName) {
1978119781
const proxyCmd = path3.resolve(path3.dirname(fileURLToPath2(import.meta.url)), "../bin/mcp_proxy_bundle.cjs");
19782-
if (!mode || mode === "notebook") {
19782+
if (mode === "notebook") {
1978319783
try {
1978419784
const notebookTransport = new StdioClientTransport({
1978519785
command: process.execPath,
@@ -19792,7 +19792,7 @@ async function run() {
1979219792
notebookClient = null;
1979319793
}
1979419794
}
19795-
if (!mode || mode === "visualization") {
19795+
if (mode === "visualization") {
1979619796
try {
1979719797
const vizTransport = new StdioClientTransport({
1979819798
command: process.execPath,

mcp/server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
243243
let aggregatedTools: any[] = [];
244244
toolOwnerMap.clear();
245245

246-
if (!mode || mode === 'notebook') {
246+
if (mode === 'notebook') {
247247
if (notebookClient) {
248248
try {
249249
const response = await notebookClient.listTools();
@@ -263,7 +263,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
263263
}
264264
}
265265

266-
if (!mode || mode === 'visualization') {
266+
if (mode === 'visualization') {
267267
if (vizClient) {
268268
try {
269269
const response = await vizClient.listTools();
@@ -472,7 +472,7 @@ async function run() {
472472
const proxyCmd = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../bin/mcp_proxy_bundle.cjs');
473473

474474
// Connect to Notebooks proxy
475-
if (!mode || mode === 'notebook') {
475+
if (mode === 'notebook') {
476476
try {
477477
const notebookTransport = new StdioClientTransport({
478478
command: process.execPath,
@@ -487,7 +487,7 @@ async function run() {
487487
}
488488

489489
// Connect to Visualization proxy
490-
if (!mode || mode === 'visualization') {
490+
if (mode === 'visualization') {
491491
try {
492492
const vizTransport = new StdioClientTransport({
493493
command: process.execPath,

0 commit comments

Comments
 (0)