惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Cyberwarzone
Cyberwarzone
The GitHub Blog
The GitHub Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
小众软件
小众软件
Recent Announcements
Recent Announcements
博客园 - 三生石上(FineUI控件)
Security Archives - TechRepublic
Security Archives - TechRepublic
W
WeLiveSecurity
Cloudbric
Cloudbric
博客园 - 司徒正美
美团技术团队
N
News and Events Feed by Topic
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
PCI Perspectives
PCI Perspectives
宝玉的分享
宝玉的分享
H
Help Net Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
Help Net Security
Help Net Security
Last Week in AI
Last Week in AI
S
Schneier on Security
N
News | PayPal Newsroom
B
Blog RSS Feed
L
LINUX DO - 最新话题
T
Troy Hunt's Blog
S
Secure Thoughts
雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
L
Lohrmann on Cybersecurity
G
Google Developers Blog
Microsoft Azure Blog
Microsoft Azure Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
Tenable Blog
S
Securelist
L
LangChain Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
I
InfoQ
H
Heimdal Security Blog
Cisco Talos Blog
Cisco Talos Blog
F
Full Disclosure
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
K
Kaspersky official blog
T
Tailwind CSS Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
阮一峰的网络日志
阮一峰的网络日志
C
Cisco Blogs

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Using an MCP Gateway with Claude Code: A Practical Guide
Nakul T Kris · 2026-05-06 · via DEV Community

Learn how to integrate an MCP gateway with Claude Code to consolidate tool access, enforce governance policies, and reduce token consumption across connected MCP servers.

Claude Code has emerged as a standard terminal-based coding agent for engineering teams. Its built-in support for the Model Context Protocol (MCP) enables interaction with filesystems, databases, GitHub, web search, Slack, internal APIs, and an expanding ecosystem of community-hosted tool servers. While connecting Claude Code to a small number of MCP servers is straightforward, scaling to dozens of servers introduces operational complexity. Each server requires separate credentials, configuration, and approval handling, leading to tool sprawl, fragmented governance, and limited visibility into costs. An MCP gateway resolves this by acting as a unified access layer in front of all upstream tool servers. Bifrost, an open-source AI gateway developed by Maxim AI, is designed specifically for this architecture.

Role of an MCP Gateway in Claude Code Environments

An MCP gateway functions as both an aggregation and governance layer between Claude Code and upstream MCP servers. It establishes a single connection to each tool server while exposing a consolidated /mcp endpoint to Claude Code. All tool invocations pass through this layer, where policies related to access control, observability, and routing are enforced before reaching the underlying systems.

In the absence of a gateway, each MCP server must be configured independently within Claude Code. The gateway model simplifies this by reducing multiple connections into a single interface, centralizing operational concerns such as authentication, auditing, budgeting, and tool filtering. The Model Context Protocol itself is an open standard that enables AI systems to dynamically discover and execute external tools. It was initially introduced by Anthropic in November 2024 and is now broadly adopted across AI platforms.

Limitations of Scaling MCP Servers Without a Gateway

As the number of connected MCP servers increases, several systemic issues arise:

  • Configuration overhead: Each server requires its own configuration entry, transport setup, and credentials. Replicating this setup across teams introduces friction and inconsistency.
  • Lack of centralized governance: Claude Code can access any tool exposed by connected servers without a unified policy layer to restrict usage by user, team, or project.
  • Inefficient token usage: Every MCP server contributes its full set of tool definitions to the model context on each request. For example, five servers with thirty tools each result in 150 tool definitions being injected into every prompt. Anthropic has reported scenarios where this leads to 150,000 tokens per agent interaction.

An MCP gateway mitigates these challenges by introducing a centralized control plane.

Architecture of Bifrost’s MCP Gateway with Claude Code

Bifrost operates as both an MCP client and server. It connects upstream to MCP-compatible services such as filesystems, databases, GitHub, web search, internal APIs, Notion, and Slack, then aggregates these tools into a single /mcp endpoint. From Claude Code’s perspective, Bifrost appears as a single MCP server, while internally it manages multiple upstream connections.

In addition to tool aggregation, Bifrost also acts as a unified inference gateway, allowing Claude Code to route requests to non-Anthropic models without any client-side changes. This enables teams to use providers such as OpenAI, Azure OpenAI, Vertex AI, or open-weight models behind the same interface, while preserving Claude Code’s native workflow.

The MCP gateway in Bifrost supports three transport mechanisms:

  • STDIO: Executes a subprocess and communicates via standard input and output, suitable for local tools.
  • HTTP: Uses JSON-RPC to communicate with remote MCP servers, typically for cloud-hosted services.
  • SSE: Maintains persistent connections through Server-Sent Events for streaming use cases.

Upon registering a new upstream server, Bifrost automatically discovers available tools and synchronizes them. Claude Code does not require updates when new tools are added. Additional configuration guidance is available in the Claude Code integration resource.

Setting Up an MCP Gateway with Claude Code

The setup process is minimal and assumes Node.js 18+ and an authenticated Claude Code environment.

Step 1: Launch Bifrost

Bifrost can be started locally using NPX or Docker:

npx -y @maximhq/bifrost
# or
docker run -p 8080:8080 maximhq/bifrost

Enter fullscreen mode Exit fullscreen mode

Access the dashboard at http://localhost:8080. Deployment is also supported on Kubernetes, Docker Swarm, and bare metal environments.

Step 2: Register Upstream MCP Servers

Within the Bifrost dashboard, navigate to the MCP section and add each upstream server. Specify the connection type and provide the required endpoint or command. For HTTP-based servers, authentication headers such as API keys can be configured directly. Bifrost handles tool discovery and synchronization automatically. Detailed instructions are available in the MCP connection documentation.

Step 3: Define Virtual Keys with Scoped Permissions

Virtual keys serve as the primary governance mechanism. Each key defines which tools are accessible, along with constraints such as budgets, rate limits, and routing policies. Tool access is scoped at a granular level, enabling selective permissions within the same server. For example, a key may allow crm_lookup_customer while restricting crm_delete_customer. Refer to the virtual keys documentation for implementation details.

Step 4: Connect Claude Code to the Gateway

Add Bifrost as an MCP server in Claude Code:

claude mcp add --transport http bifrost http://localhost:8080/mcp

Enter fullscreen mode Exit fullscreen mode

Verify the connection using /mcp within Claude Code. All permitted tools associated with the virtual key will be available. Future additions to Bifrost are automatically reflected without further configuration.

Governance and Access Control in Production

In production environments, unrestricted tool access is rarely acceptable. Bifrost enforces governance through two mechanisms:

  • Virtual key scoping: Each key restricts access to a defined set of tools.
  • MCP Tool Groups: Logical groupings of tools that can be assigned to users, teams, or services, enabling scalable permission management.

Every tool invocation is logged with metadata including tool name, server origin, input parameters, output, latency, associated virtual key, and the originating LLM request. This level of observability supports compliance requirements such as SOC 2 Type II, GDPR, HIPAA, and ISO 27001, as outlined in the Bifrost governance layer.

This centralized control plane is particularly critical in regulated industries, where access to sensitive systems must be tightly scoped, audited, and attributable to specific users or services. By enforcing policy at the gateway layer, teams can ensure consistent compliance across all MCP-connected tools without relying on per-server controls

For external deployments, Bifrost supports OAuth 2.1 with automatic client discovery and per-user identity mapping via OAuth authentication. This aligns with the MCP specification update released in March 2025.

Reducing Token Usage with Code Mode

A significant cost factor in multi-server MCP environments is context inflation caused by large tool catalogs. By default, all tool definitions are included in every request, increasing token usage substantially.

Bifrost’s Code Mode addresses this by representing MCP tools as a Python API. Instead of preloading all tool definitions, Claude Code dynamically invokes only the required tools for a given task. This approach minimizes context size, filters outputs before they reach the model, and consolidates multi-step workflows into a single execution cycle.

In environments with multiple MCP servers, this results in approximately 50 percent reduction in token usage and 30 to 40 percent improvement in latency. Additional insights on reducing token usage are detailed in the article on reducing token costs using Bifrost.

Recommended Operational Practices

Effective MCP gateway deployments typically follow these practices:

  • Enable enforce_auth_on_inference to ensure all requests are authenticated via virtual keys.
  • Deploy Bifrost behind HTTPS using a reverse proxy such as nginx or Cloudflare.
  • Activate Code Mode when managing large tool catalogs to optimize cost and performance.
  • Route both LLM and tool traffic through the same gateway to maintain unified observability and governance.
  • Configure routing rules to support fallback across providers such as Vertex AI, AWS Bedrock, or Azure.

Bifrost introduces minimal latency overhead, measured at approximately 11 microseconds per request under sustained load of 5,000 RPS, ensuring it does not become a bottleneck.

Getting Started with Bifrost and Claude Code

Adopting an MCP gateway with Claude Code requires minimal configuration yet delivers significant operational benefits. Bifrost consolidates multiple tool connections into a single endpoint, introduces structured governance through virtual keys, and reduces token costs via Code Mode.

GitHub logo maximhq / bifrost

Fastest enterprise AI gateway (50x faster than LiteLLM) with adaptive load balancer, cluster mode, guardrails, 1000+ models support & <100 µs overhead at 5k RPS.

Bifrost AI Gateway

Go Report Card Discord badge codecov Docker Pulls Run In Postman Artifact Hub License

The fastest way to build AI applications that never go down

Bifrost is a high-performance AI gateway that unifies access to 15+ providers (OpenAI, Anthropic, AWS Bedrock, Google Vertex, and more) through a single OpenAI-compatible API. Deploy in seconds with zero configuration and get automatic failover, load balancing, semantic caching, and enterprise-grade features.

Quick Start

Get started

Go from zero to production-ready AI gateway in under a minute.

Step 1: Start Bifrost Gateway

# Install and run locally
npx -y @maximhq/bifrost

# Or use Docker
docker run -p 8080:8080 maximhq/bifrost

Enter fullscreen mode Exit fullscreen mode

Step 2: Configure via Web UI

# Open the built-in web interface
open http://localhost:8080

Enter fullscreen mode Exit fullscreen mode

Step 3: Make your first API call

curl -X POST http://localhost:8080/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4o-mini",
    "messages": [{"role": "user", "content": "Hello, Bifrost!"}]
  }'

Enter fullscreen mode Exit fullscreen mode

That's it! Your AI gateway is running with a web interface for visual configuration…

To evaluate this architecture within your own infrastructure, book a demo with the Bifrost team.