--bare mode: --channels server:X cannot resolve servers provided via --mcp-config

Status Fixed / completed
Maintainer reply None cached
Activity 5 comments · opened Mar 28, 2026 · closed Mar 28, 2026

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/channel experimental capability

View original on GitHub ↗

5 Comments

marcfargas · 6 months ago

Follow-up after more investigation:

The core issue may not be --bare vs --mcp-config at all. Even with .mcp.json (project config) and --dangerously-load-development-channels server:bifrost, channel push notifications don't arrive.

Our MCP server correctly:

  1. Declares claude/channel in capabilities.experimental
  2. Sends notifications/claude/channel with content and meta fields
  3. Tools work fine (bifrost_whoami, bifrost_send, etc.)

But the <channel> tags never appear in the conversation. The server is written in Go using modelcontextprotocol/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:X may 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.

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/40064
  2. https://github.com/anthropics/claude-code/issues/38676
  3. https://github.com/anthropics/claude-code/issues/39419

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

marcfargas · 6 months ago

Not a duplicate of any of those three:

  • #40064 is about permission relay not working with server: channels — related but different (our issue is that channel notifications themselves don't arrive, not permission relay)
  • #38676 is about --bare loading user config — unrelated
  • #39419 is about --resume not spawning channel plugins — unrelated

Our issue is specifically: notifications/claude/channel events 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.

marcfargas · 6 months ago

Found the root cause after investigating the Claude Code source:

  1. --channels server:X never works for custom servers — kind:'server' without dev:true always fails the allowlist check
  2. --dangerously-load-development-channels server:X correctly sets dev:true to bypass the allowlist
  3. But channels require claude.ai OAuth login — i7()?.accessToken check 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.

github-actions[bot] · 6 months ago

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.