Sage MCPのロゴ

Sage MCP

組織
sagemcp

Multi-tenant MCP Server Platform

公開者sagemcp
リポジトリsagemcp
言語Python
フォーク
10
スター
46
利用可能なツール
0
通信方式stdio
カテゴリ
リンク
  • ツールをAIワークフローに接続

    Sage MCPは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには46件のスターと10件のフォークがあります。

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


インストール

TypingMind
前提条件:

Node.js 18+

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

Sage MCPのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Sage MCPに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Sage MCPをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Sage MCPのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "sage-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "sage-mcp"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてSage MCPのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Sage MCPのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Sage MCPを使ってこのタスクを手伝ってもらえますか?
Sage MCP
はい、読みました。
Sage MCPで調べた結果をお伝えします。

よくある質問

Sage MCP MCPサーバーは何に使いますか?

Sage MCPは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでSage MCP MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでSage MCPを利用できます。

TypingMindでSage MCP MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Sage MCPを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Sage MCP MCPをTypingMindに接続するにはどうすればよいですか?

Sage MCPはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでSage MCP MCPのどのようなツールを利用できますか?

Sage MCPはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Sage MCP MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Sage MCPで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇