mcgravity
Author: tigranbs
Description: CLI/Docker proxy that aggregates and load-balances multiple Model Context Protocol (MCP) servers behind one endpoint, acting like Nginx for Gen-AI back-ends.
Stars: 63
Forks: 3
License: Apache License 2.0
Category: Open Source
Overview
Installation
git clone https://github.com/tigranbs/mcgravity.git
cd mcgravitynpm install # or: pnpm install / yarn installnpm run build
# a dist/ folder will be producedCreate a file called gravity.config.json (or set env vars).
Example gravity.config.json
{
"servers": [
"http://mcp-node-1.internal:8080",
"http://mcp-node-2.internal:8080"
],
"healthCheckInterval": 3000,
"listenPort": 3000
}
# Alternatively export env vars
export GRAVITY_SERVERS="http://mcp-1:8080,http://mcp-2:8080"
export GRAVITY_PORT=3000npm start # runs dist/index.js
# or, during development
npx ts-node src/index.tscurl http://localhost:3000/v1/status # should proxy to a healthy MCP backendmcgravity
CLI executable that starts the McGravity proxy, connecting and load-balancing one or more MCP servers
--host
Flag that sets the host address McGravity should bind to (default: localhost)
--port
Flag that sets the port McGravity should listen on (default: 3001)
--config
Flag that supplies a YAML configuration file for McGravity (default: config.yaml)
--mcp-version
Flag that specifies the MCP protocol version McGravity should advertise (default: 1.0.0)
--mcp-name
Flag that sets the MCP server name McGravity will report (default: mcgravity)
--help
Flag that displays help information for the McGravity CLI