CodeMCP (user config)

MCP — Model Context Protocol

Bahulam includes a full Model Context Protocol client. Any MCP server you add appears as first-class tools inside the agent loop — same permission model, same approval flow, same tool telemetry.

Four transports supported:

TransportWhen to useConfig trigger
stdioLocal subprocess (most public MCP servers today)command field
SSE (Server-Sent Events)Legacy remote MCP servers over HTTPurl containing /sse
WebSocketBidirectional streaming remote serversws:// or wss:// URL
Streamable HTTPNewer MCP HTTP transport (POST + SSE response)url without /sse

Auto-detected from the shape of your server config.

Add a server

Edit ~/.bahulam/config.json and add an entry under mcpServers:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/you/projects"]
    },
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres"],
      "env": {
        "DATABASE_URL": "postgresql://localhost/mydb"
      }
    },
    "context7-remote": {
      "url": "https://mcp.context7.com/sse"
    }
  }
}

Bahulam picks up config changes on the next session start. The agent sees the server’s tools listed alongside built-in tools; permission model is identical (HITL prompts for writes, auto-approve for reads).

Protocol version

Bahulam pins MCP protocol version 2024-11-05. Newer servers should still work as long as they support this baseline — if a server rejects the handshake, upgrade the server or file a bug on Bahulam to advance the pinned version.

Debugging

Set MCP_DEBUG=1 in your environment for verbose transport logging:

MCP_DEBUG=1 bahulam

You’ll see the JSON-RPC frames going both directions, plus timing per request. Useful when a remote server hangs the handshake or returns errors the CLI swallows.

Tools exposed

For each connected server, its declared MCP tools appear in the tool registry as <server-name>.<tool-name>. The agent picks them up automatically — no per-tool wiring.

Bahulam also ships one built-in MCP-native tool:

  • ReadMcpResource — reads any resource by URI (file://..., mcp://server/resource, etc.) across all connected servers.
ServerWhat it does
@modelcontextprotocol/server-filesystemFile operations on a scoped root
@modelcontextprotocol/server-postgresQuery and inspect Postgres
@modelcontextprotocol/server-githubGitHub API — issues, PRs, code search
@modelcontextprotocol/server-brave-searchWeb search via Brave
@modelcontextprotocol/server-slackRead/post Slack messages
@modelcontextprotocol/server-google-driveRead Google Drive files

Full catalog: modelcontextprotocol.io/servers.

Security notes

  • Every MCP tool call goes through the same HITL approval flow as a built-in write tool. Nothing hits your database or GitHub without a prompt (unless you’ve explicitly auto-approved it via /settings).
  • Environment variables passed to stdio servers (via env) inherit from the CLI process. Don’t put secrets in ~/.bahulam/config.json in plain text — use env vars in your shell and reference them (see Settings for the pattern).
  • Remote MCP servers see your prompts and tool arguments. Trust them the way you’d trust any third-party API you send data to.