--bare mode: --channels server:X cannot resolve servers provided via --mcp-config
Summary
When using --bare mode with --mcp-config to provide an MCP server, --channels server:X cannot resolve the server because --bare skips loading user config (~/.claude.json) where the server would normally be registered.
Reproduction
claude --bare \
--dangerously-skip-permissions \
--dangerously-load-development-channels server:myserver \
--channels server:myserver \
--mcp-config '{"mcpServers":{"myserver":{"command":"myserver","args":["serve"]}}}' \
-p "call my_tool"
The MCP server loads correctly — tools are available and callable. But --channels server:myserver does not activate the channel, so notifications/claude/channel events from the MCP server are not surfaced as <channel> tags in the conversation.
Expected behavior
Servers provided via --mcp-config should be resolvable by --channels server:X. The server is already loaded and running — the channel flag just needs to find it by name.
Actual behavior
The MCP server's tools work (confirmed via E2E tests), but channel notifications are silently dropped. The agent never sees <channel> tags from the server.
Context
This blocks automated E2E testing of MCP servers that use channel notifications (like the Telegram plugin pattern). In --bare mode there's no way to register a server as a channel — --mcp-config adds the server but --channels can't find it, and --bare skips user config where it would normally be registered.
Workaround
None for --bare mode. In normal mode, claude mcp add + --channels server:X works because the server is in ~/.claude.json.
Environment
- Claude Code: latest
- OS: Windows 11, Ubuntu 24.04 (CI)
- Tested with custom Go MCP server using
claude/channelexperimental capability
5 Comments
Follow-up after more investigation:
The core issue may not be
--barevs--mcp-configat all. Even with.mcp.json(project config) and--dangerously-load-development-channels server:bifrost, channel push notifications don't arrive.Our MCP server correctly:
claude/channelincapabilities.experimentalnotifications/claude/channelwithcontentandmetafieldsBut the
<channel>tags never appear in the conversation. The server is written in Go usingmodelcontextprotocol/go-sdk, and channel notifications are written as raw JSON-RPC to stdout (the Go SDK doesn't expose a notification-sending API for custom methods). This might be the issue — perhaps the notification needs to go through the SDK's transport layer rather than raw stdout writes.Alternatively,
--dangerously-load-development-channels server:Xmay not work with the Go MCP SDK's stdio transport. All the official channel examples use the TypeScript SDK.Would appreciate clarification on whether Go MCP servers can function as channels, and whether raw JSON-RPC notification writes to stdout are expected to work for
notifications/claude/channel.Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Not a duplicate of any of those three:
Our issue is specifically:
notifications/claude/channelevents emitted by a Go MCP server via raw JSON-RPC writes to stdout are not surfaced as<channel>tags in the conversation. This may be a Go SDK interop issue, or a requirement that notifications go through the TypeScript SDK's transport layer.Found the root cause after investigating the Claude Code source:
--channels server:Xnever works for custom servers —kind:'server'withoutdev:truealways fails the allowlist check--dangerously-load-development-channels server:Xcorrectly setsdev:trueto bypass the allowlisti7()?.accessTokencheck blocks when using API key auth (ANTHROPIC_AUTH_TOKEN)This means channel push cannot be tested in CI with API keys. Only interactive sessions with claude.ai login work.
The notification format and raw JSON-RPC writes are actually fine — the transport processes them correctly. The gate is purely authentication.
Closing this issue as the behavior is documented ('They require claude.ai login. Console and API key authentication is not supported.'). The original title was misleading — it's not a --bare/--mcp-config issue, it's an auth requirement.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.