McGravity

McGravity

Unified load balancer and proxy for multiple MCP servers

68
Stars
3
Forks
68
Watchers
1
Issues
McGravity acts as a scalable unified proxy and load balancer for multiple MCP (Model Context Protocol) servers. It allows clients to connect through a single endpoint to access and manage multiple MCP servers efficiently. The tool offers load balancing, configuration via YAML, CLI and Docker support, and plans to evolve with features such as health checks and a web interface. Designed for modern GenAI infrastructure, it simplifies connection, balancing, and scalability of MCP server deployments.

Key Features

Connects to multiple MCP servers through a single endpoint
Balances load between MCP servers
Provides YAML-based configuration
Supports CLI and Docker deployment
Proxy capabilities from MCP servers
Customizable host and port settings
Integration testing with echo server
Automatic testing with GitHub Actions CI
Plugin system planned for custom integrations
Extensible for monitoring and health checks

Use Cases

Centralized access point for multiple context-aware model servers
Scaling and load balancing Model Context Protocol endpoints
Integrating GenAI infrastructure with unified proxying
Managing and monitoring multiple model backends in production
Testing MCP integration and proxy behavior with sample servers
Deploying scalable GenAI backends using Docker containers
Providing high availability for model-powered applications
Seamlessly configuring and updating backend server lists
Simplifying client integration with multiple MCP servers
Building a secure and authenticated gateway for GenAI model serving

README

McGravity

About

McGravity is a tool that connects multiple MCP (Model Context Protocol) servers into one unified service. It lets you reuse the same MCP server and scale underlying MCP server connections almost infinitely.

The current version works as a basic CLI tool, but McGravity will grow to become a full-featured proxy for MCP servers - like Nginx but for modern Gen AI tools and servers.

Why McGravity?

Without McGravity:
┌─────────┐     ┌─────────┐
│ Client  │────▶│MCP      │
│         │     │Server 1 │
└─────────┘     └─────────┘
    │
    │           ┌─────────┐
    └──────────▶│MCP      │
                │Server 2 │
                └─────────┘
With McGravity:
┌─────────┐     ┌─────────┐     ┌─────────┐
│ Client  │────▶│McGravity│────▶│MCP      │
│         │     │         │     │Server 1 │
└─────────┘     └─────────┘     └─────────┘
                     │
                     │          ┌─────────┐
                     └─────────▶│MCP      │
                                │Server 2 │
                                └─────────┘

McGravity solves these problems:

  • Connect to multiple MCP servers through one endpoint
  • Balance load between MCP servers
  • Provide a single point of access for your applications

Installation

bash
# Install dependencies
bun install

# Build the project into a single executable
bun build src/index.ts --compile --outfile mcgravity

Docker

McGravity is available on Docker Hub: tigranbs/mcgravity.

bash
docker pull tigranbs/mcgravity

# Basic usage
docker run -p 3001:3001 tigranbs/mcgravity http://mcp1.example.com http://mcp2.example.com

# With custom host and port
docker run -p 4000:4000 tigranbs/mcgravity --host 0.0.0.0 --port 4000 http://mcp1.example.com

Usage

Basic command:

bash
./mcgravity <mcp-server-address1> <mcp-server-address2> ...

With options:

bash
./mcgravity --host localhost --port 3001 http://mcp1.example.com http://mcp2.example.com

Using configuration file:

bash
./mcgravity --config config.yaml

Options

  • --host <host>: Host to bind the server to (default: localhost)
  • --port <port>: Port to bind the server to (default: 3001)
  • --config <path>: Path to the config file (default: config.yaml)
  • --mcp-version <version>: Version of the MCP server (default: 1.0.0)
  • --mcp-name <name>: Name of the MCP server (default: mcgravity)
  • --help: Show help information

Configuration

McGravity can be configured using a YAML file. See config.example.yaml for a sample configuration:

yaml
name: mcgravity
version: 1.0.0
description: A simple MCP server

servers:
  echo-server:
    url: http://localhost:3000/sse
    name: echo-server
    version: 1.0.0
    description: A simple echo server
    tags:
      - echo

You can run the included echo server example for testing:

bash
# Start the echo server first
bun examples/echo-server.ts

# Then start McGravity pointing to the echo server
./mcgravity --config config.yaml

Examples

Start McGravity with default settings:

bash
./mcgravity http://mcp1.example.com http://mcp2.example.com

Specify host and port:

bash
./mcgravity --host 0.0.0.0 --port 4000 http://mcp1.example.com http://mcp2.example.com

Running Tests

To run all tests:

bash
bun test

To run integration tests only:

bash
bun run test:integration

Integration Tests

The integration tests verify that McGravity can:

  1. Connect to an MCP server (the example echo server)
  2. Correctly proxy capabilities from the target MCP server
  3. Pass requests from clients to the target MCP server and return responses

For more details about the test suite, see the test README.

The tests are automatically run in GitHub Actions CI on push and PR events.

Future Plans

McGravity will expand to include:

  • Web interface for monitoring
  • Advanced load balancing
  • MCP server health checks
  • Authentication and access control
  • Plugin system for custom integrations

Development

TypeScript and Code Style

This project uses:

  • TypeScript with Bun runtime
  • ESLint for code linting with TypeScript-specific rules
  • Prettier for code formatting

The configuration is optimized for Bun with appropriate TypeScript settings for the runtime environment.

Run the following commands:

bash
# Format code with Prettier
bun run format

# Check if code is properly formatted
bun run format:check

# Lint code with ESLint
bun run lint

# Fix auto-fixable linting issues
bun run lint:fix

VS Code is configured to format code on save and provide linting information when the recommended extensions are installed.

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

Star History

Star History Chart

Repository Owner

tigranbs
tigranbs

User

Repository Details

Language TypeScript
Default Branch main
Size 276 KB
Contributors 1
License Apache License 2.0
MCP Verified Sep 1, 2025

Programming Languages

TypeScript
88.54%
JavaScript
8.19%
Dockerfile
3.27%

Tags

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • pluggedin-mcp-proxy

    pluggedin-mcp-proxy

    Unified proxy server for Model Context Protocol data exchanges and AI integrations

    Aggregates multiple Model Context Protocol (MCP) servers into a single, unified proxy interface, supporting real-time discovery, management, and orchestration of AI model resources, tools, and prompts. Enables seamless interaction between MCP clients such as Claude, Cline, and Cursor, while integrating advanced document search, AI document exchange, and workspace management. Provides flexible transport modes (STDIO and Streamable HTTP), robust authentication, and comprehensive security measures for safe and scalable AI data exchange.

    • 87
    • MCP
    • VeriTeknik/pluggedin-mcp-proxy
  • mcp-server-templates

    mcp-server-templates

    Deploy Model Context Protocol servers instantly with zero configuration.

    MCP Server Templates enables rapid, zero-configuration deployment of production-ready Model Context Protocol (MCP) servers using Docker containers and a comprehensive CLI tool. It provides a library of ready-made templates for common integrations—including filesystems, GitHub, GitLab, and Zendesk—and features intelligent caching, smart tool discovery, and flexible configuration options via JSON, YAML, environment variables, or CLI. Perfect for AI developers, data scientists, and DevOps teams, it streamlines the process of setting up and managing MCP servers and has evolved into the MCP Platform for enhanced capabilities.

    • 5
    • MCP
    • Data-Everything/mcp-server-templates
  • mcp

    mcp

    Universal remote MCP server connecting AI clients to productivity tools.

    WayStation MCP acts as a remote Model Context Protocol (MCP) server, enabling seamless integration between AI clients like Claude or Cursor and a wide range of productivity applications, such as Notion, Monday, Airtable, Jira, and more. It supports multiple secure connection transports and offers both general and user-specific preauthenticated endpoints. The platform emphasizes ease of integration, OAuth2-based authentication, and broad app compatibility. Users can manage their integrations through a user dashboard, simplifying complex workflow automations for AI-powered productivity.

    • 27
    • MCP
    • waystation-ai/mcp
  • OpenMCP

    OpenMCP

    A standard and registry for converting web APIs into MCP servers.

    OpenMCP defines a standard for converting various web APIs into servers compatible with the Model Context Protocol (MCP), enabling efficient, token-aware communication with client LLMs. It also provides an open-source registry of compliant servers, allowing clients to access a wide array of external services. The platform supports integration with local and remote hosting environments and offers tools for configuring supported clients, such as Claude desktop and Cursor. Comprehensive guidance is offered for adapting different API formats including REST, gRPC, GraphQL, and more into MCP endpoints.

    • 252
    • MCP
    • wegotdocs/open-mcp
  • 1mcp-app/agent

    1mcp-app/agent

    A unified server that aggregates and manages multiple Model Context Protocol servers.

    1MCP Agent provides a single, unified interface that aggregates multiple Model Context Protocol (MCP) servers, enabling seamless integration and management of external tools for AI assistants. It acts as a proxy, managing server configuration, authentication, health monitoring, and dynamic server control with features like asynchronous loading, tag-based filtering, and advanced security options. Compatible with popular AI development environments, it simplifies setup by reducing redundant server instances and resource usage. Users can configure, monitor, and scale model tool integrations across various AI clients through easy CLI commands or Docker deployment.

    • 96
    • MCP
    • 1mcp-app/agent
  • mcp-access-point

    mcp-access-point

    Bridge HTTP services with Model Context Protocol (MCP) clients seamlessly.

    MCP Access Point acts as a lightweight gateway that enables direct communication between MCP-compatible clients and traditional HTTP services without requiring server-side modifications. Built on the high-performance Pingora proxy library, it supports protocol conversion between HTTP, SSE, and MCP, supporting multi-tenancy and customizable routing. It empowers various MCP clients, such as Cursor Desktop, MCP Inspector, and VS Code, to interact with existing APIs efficiently. Configuration is flexible via YAML, and deployment is possible both locally and through Docker.

    • 118
    • MCP
    • sxhxliang/mcp-access-point
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results