mcp-bastion · gowthaman90 — Claude Code MCP server: what it does, how to install
A proxy that sits between your MCP client and your servers: it watches connections, restarts dropped ones, and hands the agent tools to recover them itself.
claude mcp add mcp-bastion -- npx -y mcp-bastionWhat mcp-bastion does
Your client talks to Bastion instead of talking to each server directly, and Bastion talks to those servers for it. Nothing changes on the server side, and undoing the setup is a config revert. For stdio servers it runs health checks and reconnects with capped exponential backoff.
The part that matters in long sessions: bastion__status and bastion__reconnect. Without them a dropped server looks like a tool that never existed, and only a human can bring it back. With them the agent checks connection health and revives the server on its own. Tool names from different servers get namespaced, so one server cannot shadow another.
There is runtime security too. Tool definitions are pinned, and a server that changes a tool after approval gets blocked. Audit events can go to the console, a file, or a webhook. Node.js 20 or newer is required to run it.
What it helps with
- recover a crashed MCP server without restarting the session
- tell why a tool disappeared from the list mid-session
- merge several MCP servers into one connection without name clashes
- block a server from redefining a tool after approval
- keep a log of tool calls for review
Example prompts for the agent
- Check the MCP servers with bastion__status
- Reconnect the dropped server using bastion__reconnect
- Route all my MCP servers through mcp-bastion and list the tools that are available
How to install mcp-bastion
Platform CLI
claude mcp add mcp-bastion -- npx -y mcp-bastionPlatform CLI
codex mcp add mcp-bastion -- npx -y mcp-bastionConfig file
{
"mcpServers": {
"mcp-bastion": {
"command": "npx",
"args": [
"-y",
"mcp-bastion"
]
}
}
}Config file
{
"servers": {
"mcp-bastion": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-bastion"
]
}
}
}Platform CLI
gemini mcp add mcp-bastion npx -y mcp-bastionStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mcp-bastion
How do I install mcp-bastion in Claude Code?
Run claude mcp add mcp-bastion -- npx -y mcp-bastion. The package is fetched by npx, so there is nothing to install beforehand.
What does mcp-bastion do?
It proxies MCP traffic between your client and your servers, health-checks them, reconnects dropped ones, and exposes bastion__status and bastion__reconnect so the agent can fix a drop itself.
What do I need to run mcp-bastion?
Node.js 20 or newer. It starts with npx -y mcp-bastion, and your real servers go into a separate config file.
Similar MCP servers
All MCP servers for Agent setup: memory, context, orchestration →mcp-bastion by other authors comes first.