Sage MCP logo

Sage MCP

Organization
sagemcp

Multi-tenant MCP Server Platform

Publishersagemcp
Repositorysagemcp
LanguagePython
Forks
10
Stars
46
Available tools
0
Transport typestdio
Categories
Links
  • Connect tools to AI workflows

    Sage MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    46 stars and 10 forks from the linked repository.

License Python Docker Build Status Discord

About The Project

Sage MCP is a production-ready platform that enables you to run multiple isolated MCP servers with built-in OAuth/API key authentication for 23+ services. It provides a web interface and CLI for managing tenants and connectors, making it easy to integrate Claude Desktop with various external services.

Key Features:

  • Multi-tenant architecture with path-based isolation
  • Full MCP protocol support (Streamable HTTP, WebSocket, SSE) with protocol version negotiation
  • Server pooling with LRU eviction (5,000 max instances, 30-min TTL)
  • Session management via Mcp-Session-Id with resumable SSE streams
  • Token-bucket rate limiting (configurable RPM per tenant)
  • External MCP server hosting via stdio subprocess (GenericMCPConnector)
  • OAuth 2.0 integration with tenant-level and user-level tokens
  • Field-level encryption at rest (Fernet/AES) and API key authentication
  • Prometheus metrics, structured JSON logging, and Kubernetes health probes
  • Progressive rollout via feature flags (SAGEMCP_ENABLE_*)

Screenshots

Supported Connectors

340 tools across 23 native connectors, plus unlimited external MCP server support.

Architecture

High-Level System Architecture

View Full Architecture Documentation | Includes 10+ detailed diagrams covering OAuth flows, multi-tenancy, database schema, deployment, and more.

Built With

FastAPI React SQLAlchemy MCP Prometheus Docker

Security

  • Encryption at rest -- All OAuth tokens, API keys, and connector credentials encrypted via Fernet (AES-128-CBC + HMAC), key derived from SECRET_KEY via PBKDF2-SHA256 (480K iterations).
  • API key authentication -- Three scope tiers (platform_admin, tenant_admin, tenant_user) with bcrypt-hashed storage and SHA-256 LRU cache. Feature-flagged via SAGEMCP_ENABLE_AUTH.
  • Transport security -- CORS origin validation, Content-Type enforcement, per-tenant token-bucket rate limiting.

Getting Started

Prerequisites

  • Docker and Docker Compose
  • Python 3.11+ (for local development)
  • PostgreSQL or Supabase account

Installation

  1. Clone the repository

    bash
    git clone https://github.com/mvmcode/SageMCP.git
    cd SageMCP
  2. Setup environment

    bash
    cp .env.example .env
    # Edit .env with your OAuth credentials (optional for testing)
  3. Start the platform

    bash
    make setup
    make up
  4. Access the application

Usage

Management Options

SageMCP provides two ways to manage your platform:

  1. Web Interface - Visual interface at http://localhost:3001
  2. Command-Line Interface (CLI) - Powerful CLI for automation and DevOps

Quick Start (Web Interface)

  1. Open the web interface at http://localhost:3001
  2. Create a new tenant
  3. Add a connector (e.g., GitHub) and configure OAuth
  4. Copy the MCP server URL for Claude Desktop

Quick Start (CLI)

bash
# Install CLI
pip install -e ".[cli]"

# Initialize configuration
sagemcp init

# Create a tenant
sagemcp tenant create --slug my-tenant --name "My Tenant"

# Add a connector
sagemcp connector create my-tenant --type github --name "GitHub"

# Configure OAuth (opens browser)
sagemcp oauth authorize my-tenant github

# Test MCP tools
sagemcp mcp tools my-tenant <connector-id>

# Interactive REPL
sagemcp mcp interactive my-tenant <connector-id>

Full CLI Documentation | CLI Design Document

Claude Desktop Configuration

Add to your Claude Desktop config:

json
{
  "mcpServers": {
    "sage-mcp": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-everything"],
      "env": {
        "MCP_SERVER_URL": "ws://localhost:8000/api/v1/{tenant-slug}/mcp"
      }
    }
  }
}

User-Level OAuth Tokens

SageMCP supports per-user OAuth tokens in addition to tenant-level credentials. See User-Level OAuth Tokens for HTTP and WebSocket examples.

Feature Flags & Configuration

SageMCP uses feature flags for progressive rollout of v2 capabilities. All flags default to false and can be enabled via environment variables.

FlagDescriptionDefault
SAGEMCP_ENABLE_SERVER_POOLLRU server-instance pool (5,000 max, 30-min TTL)false
SAGEMCP_ENABLE_SESSION_MANAGEMENTMcp-Session-Id tracking and SSE replayfalse
SAGEMCP_ENABLE_METRICSPrometheus /metrics endpointfalse
SAGEMCP_ENABLE_AUTHAPI key authentication and authorizationfalse

Additional configuration settings:

SettingDescriptionDefault
SECRET_KEYKey for Fernet encryption and token signing (min 16 chars)required
RATE_LIMIT_RPMRequests per minute per tenant (token bucket)100
CORS_ALLOWED_ORIGINSComma-separated allowed CORS origins* (dev)
MCP_ALLOWED_ORIGINSComma-separated allowed MCP Origin headers--
SAGEMCP_BOOTSTRAP_ADMIN_KEYOne-time bootstrap key to create first platform admin--

Development

Running Tests

bash
# Backend tests
make test-backend

# Frontend tests
make test-frontend

# All tests with coverage
make test-coverage

Available Commands

bash
make help            # Show all available commands
make build           # Build Docker images
make up              # Start all services
make down            # Stop all services
make logs            # View logs
make shell           # Open shell in app container
make clean           # Clean up containers and volumes

Adding New Connectors

  1. Create a new connector class in src/sage_mcp/connectors/
  2. Implement the BaseConnector interface
  3. Register with @register_connector decorator
  4. Add to the connector enum

See existing connectors in src/sage_mcp/connectors/ for examples.

Deployment

Docker Compose (Development)

bash
make up

Kubernetes (Production)

Deploy with PostgreSQL:

bash
helm install sage-mcp ./helm

Deploy with Supabase:

bash
helm install sage-mcp ./helm \
  --set database.provider=supabase \
  --set postgresql.enabled=false \
  --set supabase.url=https://your-project.supabase.co \
  --set supabase.serviceRoleKey=your-service-role-key

Roadmap

  • Tool policy language (per-connector tool enable/disable rules)
  • OpenTelemetry tracing
  • Redis-backed session persistence

See the open issues for a full list of proposed features and known issues.

Contributing

Contributions are what make the open source community amazing! Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the Apache 2.0 License. See LICENSE for more information.

Contact

Acknowledgments


Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "sage-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "sage-mcp"
      ]
    }
  }
}

Use Sage MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Sage MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Sage MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Sage MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "sage-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "sage-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Sage MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Sage MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Sage MCP to help me with this task?
Sage MCP
Sure. I read it.
Here is what I found using Sage MCP.

Frequently asked questions

What is the Sage MCP MCP server used for?

Sage MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Sage MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Sage MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Sage MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Sage MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Sage MCP MCP to TypingMind?

Sage MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Sage MCP MCP provide in TypingMind?

Sage MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Sage MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Sage MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇