Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- E2E tests now run under the Bun runtime (in addition to Node.js); use `./test/e2e/run.sh --runtime bun` or `npm run test:e2e:bun`

### Fixed
- `logging-set-level` JSON output no longer includes a `success` field; output is now `{"level":"<level>"}` consistent with the project's convention of indicating errors via exit codes
- `--header` / `-H` option is now specific to the `connect` command instead of being shown as a global option in `mcpc --help`
- Bridge now forwards `logging/message` notifications from the MCP server to connected clients, so `logging-set-level` actually takes effect in interactive shell sessions
- IPC buffer between CLI and bridge process is now capped at 10 MB; sockets are destroyed if the limit is exceeded, preventing unbounded memory growth
- `validateOptions()` no longer includes subcommand-specific options (`--full`, `--x402`, `--proxy`, etc.) in global known-options list; misplaced flags now produce clear "Unknown option" errors instead of confusing Commander rejections
- Sessions requiring authentication now correctly show as `expired` instead of `live` when the server rejects unauthenticated connections
Expand Down
14 changes: 13 additions & 1 deletion src/bridge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ import { OAuthProvider } from '../lib/auth/oauth-provider.js';
import { storeKeychainOAuthTokenInfo, readKeychainOAuthTokenInfo } from '../lib/auth/keychain.js';
import { updateAuthProfileRefreshedAt } from '../lib/auth/profiles.js';
import { readKeychainProxyBearerToken } from '../lib/auth/keychain.js';
import type { Tool, Resource, Prompt } from '@modelcontextprotocol/sdk/types.js';
import {
LoggingMessageNotificationSchema,
type Tool,
type Resource,
type Prompt,
} from '@modelcontextprotocol/sdk/types.js';
import { createRequire } from 'module';
const { version: mcpcVersion } = createRequire(import.meta.url)('../../package.json') as {
version: string;
Expand Down Expand Up @@ -587,6 +592,13 @@ class BridgeProcess {
logger.info('Connected to MCP server');
logger.debug('MCP client created successfully, authProvider was:', !!clientConfig.authProvider);

// Forward server logging messages to connected IPC clients
this.client
.getSDKClient()
.setNotificationHandler(LoggingMessageNotificationSchema, (notification) => {
this.broadcastNotification('logging/message', notification.params);
});

// Update session with protocol version, MCP session ID, and lastSeenAt
const serverDetails = await this.client.getServerDetails();
const newMcpSessionId = this.client.getMcpSessionId();
Expand Down
10 changes: 1 addition & 9 deletions src/cli/commands/logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,7 @@ export async function setLogLevel(
if (options.outputMode === 'human') {
console.log(formatSuccess(`Server log level set to: ${level}`));
} else {
console.log(
formatOutput(
{
level,
success: true,
},
'json'
)
);
console.log(formatOutput({ level }, 'json'));
}
});
}
Loading