Skip to content

Commit

Permalink
Fix raise when initial endpoint can be not yet initialized and the fi…
Browse files Browse the repository at this point in the history
…rst call to `ListToolsRequestSchema` returns `No working IDE endpoint available.`
  • Loading branch information
MaXal committed Jan 16, 2025
1 parent 56f7417 commit 08b832f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jetbrains/mcp-proxy",
"version": "1.6.0",
"version": "1.7.0",
"description": "A MCP proxy to redirect requests to JetBrains IDEs",
"main": "dist/src/index.js",
"type": "module",
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ async function handleToolCall(name: string, args: any): Promise<CallToolResult>
}
}

// 1) Do an initial endpoint check (once at startup)
await updateIDEEndpoint();

/**
* Request handler for "CallToolRequestSchema"
*/
Expand Down Expand Up @@ -261,9 +264,6 @@ async function runServer() {
throw error;
}

// 1) Do an initial endpoint check (once at startup)
await updateIDEEndpoint();

// 2) Then check again every 10 seconds (in case IDE restarts or ports change)
setInterval(updateIDEEndpoint, 10_000);
log("Scheduled endpoint check every 10 seconds.");
Expand Down

0 comments on commit 08b832f

Please sign in to comment.