Skip to main content
Glama
maximhq

Bifrost MCP Gateway

Official
by maximhq

Bifrost AI Gateway

Discord badge codecov Docker Pulls Artifact Hub License

构建永不停机 AI 应用的最快方式

Bifrost 是一个高性能 AI 网关,通过统一的 OpenAI 兼容 API 接入 23+ 家提供商(OpenAI、Anthropic、AWS Bedrock、Google Vertex 等)。零配置即可在数秒内部署,并具备自动故障转移、负载均衡、语义缓存和企业级功能。

Related MCP server: MCPGate

快速开始

开始使用

在不到一分钟内从零开始构建生产级 AI 网关。

步骤 1: 启动 Bifrost 网关

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

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

步骤 2: 通过 Web UI 配置

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

步骤 3: 发起您的第一个 API 调用

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!"}]
  }'

就是这样! 您的 AI 网关已运行,并带有用于可视化配置、实时监控和分析的 Web 界面。

完整设置指南:


企业级部署

Bifrost 支持为大规模运行生产 AI 系统的团队提供企业级私有化部署。除了私有网络、自定义安全控制和治理之外,企业级部署还解锁了自适应负载均衡、集群、防护栏、MCP 网关等高级功能,专为企业级规模和可靠性而设计。


主要特性

核心基础设施

  • 统一接口 - 适用于所有提供商的统一 OpenAI 兼容 API

  • 多提供商支持 - OpenAI、Anthropic、AWS Bedrock、Google Vertex、Azure、Cerebras、Cohere、Mistral、Ollama、Groq 等

  • 自动故障转移 - 提供商和模型之间无缝故障转移,零停机

  • 负载均衡 - 跨多个 API 密钥和提供商的智能请求分发

高级功能

  • 模型上下文协议 (MCP) - 使 AI 模型能够使用外部工具(文件系统、网络搜索、数据库)

  • 语义缓存 - 基于语义相似性的智能响应缓存,降低成本和延迟

  • 多模态支持 - 支持文本、图像、音频和流式传输,全部通过统一接口实现。

  • 自定义插件 - 可扩展的中间件架构,用于分析、监控和自定义逻辑

  • 治理 - 使用量跟踪、速率限制和细粒度访问控制

企业级与安全

  • 预算管理 - 通过虚拟密钥、团队和客户预算实现分层成本控制

  • 用户预置 (OIDC) - 支持 OAuth 2.0 / OIDC 登录,并针对团队、角色和业务部门进行后台目录同步

  • 可观测性 - 原生 Prometheus 指标、分布式追踪和全面的日志记录

  • 密钥管理 - 通过环境变量和部署密钥实现安全的 API 密钥管理

开发者体验


仓库结构

Bifrost 采用模块化架构,实现最大灵活性:

bifrost/
├── npx/                 # NPX script for easy installation
├── core/                # Core functionality and shared components
│   ├── providers/       # Provider-specific implementations (OpenAI, Anthropic, etc.)
│   ├── schemas/         # Interfaces and structs used throughout Bifrost
│   └── bifrost.go       # Main Bifrost implementation
├── framework/           # Framework components for data persistence
│   ├── configstore/     # Configuration storage backends
│   ├── logstore/        # Request logging storage backends
│   └── vectorstore/     # Vector storages
├── transports/          # HTTP gateway and other interface layers
│   └── bifrost-http/    # HTTP transport implementation
├── ui/                  # Web interface for HTTP gateway
├── plugins/             # Extensible plugin system
│   ├── governance/      # Budget management and access control
│   ├── jsonparser/      # JSON parsing and manipulation utilities
│   ├── logging/         # Request logging and analytics
│   ├── maxim/           # Maxim's observability integration
│   ├── mocker/          # Mock responses for testing and development
│   ├── semanticcache/   # Intelligent response caching
│   └── telemetry/       # Monitoring and observability
├── docs/                # Documentation and guides
└── tests/               # Comprehensive test suites

入门选项

选择适合您需求的部署方式:

1. 网关(HTTP API)

适用场景: 语言无关的集成、微服务和生产部署

# NPX - Get started in 30 seconds
npx -y @maximhq/bifrost

# Docker - Production ready
docker run -p 8080:8080 -v $(pwd)/data:/app/data maximhq/bifrost

功能: Web UI、实时监控、多提供商管理、零配置启动

了解更多: 网关设置指南

2. Go SDK

适用场景: 需要极致性能和控制的直接 Go 集成

go get github.com/maximhq/bifrost/core

功能: 原生 Go API、嵌入式部署、自定义中间件集成

了解更多: Go SDK 指南

3. 即插即用替代

适用场景: 零代码更改迁移现有应用

# OpenAI SDK
- base_url = "https://api.openai.com"
+ base_url = "http://localhost:8080/openai"

# Anthropic SDK
- base_url = "https://api.anthropic.com"
+ base_url = "http://localhost:8080/anthropic"

# Google GenAI SDK
- api_endpoint = "https://generativelanguage.googleapis.com"
+ api_endpoint = "http://localhost:8080/genai"

了解更多: 集成指南


性能

Bifrost 为您的 AI 请求增加的开销几乎为零。在持续 5,000 RPS 的基准测试中,网关每个请求仅增加 11 µs 的开销。

指标

t3.medium

t3.xlarge

提升

新增延迟(Bifrost 开销)

59 µs

11 µs

-81%

5k RPS 下的成功率

100%

100%

无失败请求

平均队列等待时间

47 µs

1.67 µs

-96%

平均请求延迟(含提供商)

2.12 s

1.61 s

-24%

关键性能亮点:

  • 完美成功率 - 即使在 5k RPS 下也能实现 100% 的请求成功率

  • 极低开销 - 每个请求的额外延迟低于 15 微秒

  • 高效队列 - 亚微秒级平均等待时间

  • 快速密钥选择 - 选择加权 API 密钥约需 10 纳秒

完整基准测试: 性能分析


文档

完整文档: https://docs.getbifrost.ai

快速开始

功能特性

集成

企业版


需要帮助?

加入我们的 Discord 获取社区支持与讨论。

获取以下帮助:

  • 快速设置协助和故障排除

  • 最佳实践和配置技巧

  • 社区讨论与支持

  • 集成的实时帮助


贡献

我们欢迎各种形式的贡献!查看我们的贡献指南,了解:

  • 设置开发环境

  • 代码规范和最佳实践

  • 如何提交拉取请求

  • 本地构建和测试

有关开发要求和构建说明,请参阅开发环境设置指南


许可证

本项目采用 Apache 2.0 许可证 - 详情请参阅 LICENSE 文件。

Maxim 用 ❤️ 构建

A
license - permissive license
Not graded
quality - not tested
Not graded
maintenance - not tested

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    C
    quality
    D
    maintenance
    A powerful gateway for the Model Context Protocol (MCP) that unifies AI toolchains by federating multiple MCP servers, wrapping REST APIs as MCP tools, and supporting multiple transport methods with an admin dashboard.
    1
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCPGate aggregates multiple MCP servers into a single unified endpoint, enabling centralized tool management with granular filtering, automatic namespacing, and observability. Features a real-time web dashboard and optional PostgreSQL-backed audit trails for monitoring and controlling AI tool access across local and remote deployments.
    17
    Apache 2.0
  • F
    license
    Not graded
    quality
    A
    maintenance
    A production-ready MCP gateway and control plane that provides credential vault, policy engine, audit logging, and managed runtime for routing tool calls between AI agents and downstream MCP servers.
    57
  • A
    license
    Not graded
    quality
    A
    maintenance
    An open-source MCP gateway for AI operators, connecting any LLM to a hot-reloadable connector registry with production-grade approval gates and a built-in control plane for session management.
    MIT

View all related MCP servers

Related MCP Connectors

  • Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.

  • Enterprise AI Control Plane: governance, guardrails, spend tracking, compliance & smart routing.

  • Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/maximhq/bifrost'

If you have feedback or need assistance with the MCP directory API, please join our Discord server