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:
| Transport | When to use | Config trigger |
|---|---|---|
| stdio | Local subprocess (most public MCP servers today) | command field |
| SSE (Server-Sent Events) | Legacy remote MCP servers over HTTP | url containing /sse |
| WebSocket | Bidirectional streaming remote servers | ws:// or wss:// URL |
| Streamable HTTP | Newer 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 bahulamYou’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.
Popular servers to try
| Server | What it does |
|---|---|
@modelcontextprotocol/server-filesystem | File operations on a scoped root |
@modelcontextprotocol/server-postgres | Query and inspect Postgres |
@modelcontextprotocol/server-github | GitHub API — issues, PRs, code search |
@modelcontextprotocol/server-brave-search | Web search via Brave |
@modelcontextprotocol/server-slack | Read/post Slack messages |
@modelcontextprotocol/server-google-drive | Read 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.jsonin 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.