Skip to content

Add --no-log argument to make it work with IntelliJ #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://server-url> [callback-port] [--debug]')
parseCommandLineArgs(process.argv.slice(2), 'Usage: npx tsx client.ts <https://server-url> [callback-port] [--debug] [-no-log]')
.then(({ serverUrl, callbackPort, headers, transportStrategy, host, staticOAuthClientMetadata, staticOAuthClientInfo }) => {
return runClient(serverUrl, callbackPort, headers, transportStrategy, host, staticOAuthClientMetadata, staticOAuthClientInfo)
})
Expand Down
7 changes: 7 additions & 0 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)

Expand Down