From 9fb3cd017ab5a559d2350013e230570a4c0f8278 Mon Sep 17 00:00:00 2001 From: Daniel Imber Date: Mon, 21 Jul 2025 18:50:36 +0100 Subject: [PATCH 1/2] Add `--no-log` argument to make it work with IntelliJ IntelliJ fails to connect if output is sent to STDERR --- README.md | 6 ++++++ src/client.ts | 2 +- src/lib/utils.ts | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8cce8d6..3b42fec 100644 --- a/README.md +++ b/README.md @@ -208,6 +208,12 @@ As of version `0.48.0`, Cursor supports unauthed SSE servers directly. If your M [Official Docs](https://docs.codeium.com/windsurf/mcp). The configuration file is located at `~/.codeium/windsurf/mcp_config.json`. +### JetBrains IntelliJ + +IntelliJ supports MCP servers however, you must disable logging (which this package does by default to STDERR). Do this +by adding the `--no-log` argument. + + ## Building Remote MCP Servers For instructions on building & deploying remote MCP servers, including acting as a valid OAuth client, see the following resources: diff --git a/src/client.ts b/src/client.ts index d9a7343..873eda7 100644 --- a/src/client.ts +++ b/src/client.ts @@ -158,7 +158,7 @@ async function runClient( } // Parse command-line arguments and run the client -parseCommandLineArgs(process.argv.slice(2), 'Usage: npx tsx client.ts [callback-port] [--debug]') +parseCommandLineArgs(process.argv.slice(2), 'Usage: npx tsx client.ts [callback-port] [--debug] [-no-log]') .then(({ serverUrl, callbackPort, headers, transportStrategy, host, staticOAuthClientMetadata, staticOAuthClientInfo }) => { return runClient(serverUrl, callbackPort, headers, transportStrategy, host, staticOAuthClientMetadata, staticOAuthClientInfo) }) diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 5aa4c84..6d9f526 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -32,6 +32,9 @@ const pid = process.pid // Global debug flag export let DEBUG = false +// Global no-log flag +export let NO_LOG = false + // Helper function for timestamp formatting function getTimestamp(): string { const now = new Date() @@ -71,6 +74,10 @@ export function debugLog(message: string, ...args: any[]) { } export function log(str: string, ...rest: unknown[]) { + if(NO_LOG) { + return + } + // Using stderr so that it doesn't interfere with stdout console.error(`[${pid}] ${str}`, ...rest) From b7f8ce33ec9c8883f4a546f878fdaccd6a5188f6 Mon Sep 17 00:00:00 2001 From: Daniel Imber <80687249+dimber-cais@users.noreply.github.com> Date: Tue, 22 Jul 2025 15:57:28 +0100 Subject: [PATCH 2/2] Update src/client.ts Co-authored-by: Benoit Condaminet --- src/client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index 873eda7..c47e80b 100644 --- a/src/client.ts +++ b/src/client.ts @@ -158,7 +158,7 @@ async function runClient( } // Parse command-line arguments and run the client -parseCommandLineArgs(process.argv.slice(2), 'Usage: npx tsx client.ts [callback-port] [--debug] [-no-log]') +parseCommandLineArgs(process.argv.slice(2), 'Usage: npx tsx client.ts [callback-port] [--debug] [--no-log]') .then(({ serverUrl, callbackPort, headers, transportStrategy, host, staticOAuthClientMetadata, staticOAuthClientInfo }) => { return runClient(serverUrl, callbackPort, headers, transportStrategy, host, staticOAuthClientMetadata, staticOAuthClientInfo) })