MCP Routerのロゴ

MCP Router

組織
locomotive-agency

A unified gateway for Model Context Protocol (MCP) servers that lets you discover, configure, and access MCP tools from any GitHub repository through a single endpoint.

公開者locomotive-agency
リポジトリmcp-anywhere
言語Python
フォーク
9
スター
47
利用可能なツール
0
通信方式stdio, streamable-http
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

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

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

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

  • コピーして使える設定

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

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

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

MCP Anywhere

A unified gateway for Model Context Protocol (MCP) servers that enables discovery, configuration, and access to tools from GitHub repositories through a single endpoint.

https://github.com/user-attachments/assets/f011f8bf-6c99-4a8a-8236-f8eb0a3fb9e4

Current Version: 0.8.0
Note: This project is in beta. APIs and features are subject to change.

Overview

MCP Anywhere provides:

  • Automatic tool discovery from GitHub repositories
  • Centralized API key and credential management
  • Selective tool enablement and access control
  • Unified endpoint for all MCP tools
  • Docker-based isolation for secure execution

Documentation

📚 Full documentation is available at mcpanywhere.com

Installation

Local Installation

bash
# Clone repository
git clone https://github.com/locomotive-agency/mcp-anywhere.git
cd mcp-anywhere

# Install with uv (recommended)
uv sync

# Or install with pip
pip install -e .

# Configure environment
cp env.example .env
# Edit .env with required values:
# SECRET_KEY=<secure-random-key>
# ANTHROPIC_API_KEY=<your-api-key>

# Start server
mcp-anywhere serve http
# Or: python -m mcp_anywhere serve http
# Access at http://localhost:8000

Production Deployment (Fly.io)

bash
# Install Fly CLI
curl -L https://fly.io/install.sh | sh

# Deploy application
cd mcp-anywhere
fly launch
fly secrets set SECRET_KEY=<secure-random-key>
fly secrets set JWT_SECRET_KEY=<jwt-secret-key>
fly secrets set ANTHROPIC_API_KEY=<your-api-key>
fly secrets set GOOGLE_OAUTH_CLIENT_ID=<google-oauth-client-id>
fly secrets set GOOGLE_OAUTH_CLIENT_SECRET=<google-oauth-client-secret>
fly deploy

# Application available at https://your-app.fly.dev

To speed up the fly.io deployment, you can configure manual build and start of containers.

bash
# set the environment variable
REBUILD_CONTAINERS_ON_STARTUP=false

Docker

Deploying the application as a docker container using docker compose.

bash
# Configure environment
cp env.example .env
# Edit .env with required values:
# SECRET_KEY=<secure-random-key>
# ANTHROPIC_API_KEY=<your-api-key>

Build and Deploy the application

bash
$ docker compose -f docker-compose.native.yml up -d --build

View logs to see status

bash
$ docker logs mcp-anywhere-app

Navigate to http://<DOCKER-HOST>:8000/ to use the application

Interact with the machine via CLI, useful for interacting with the database using sqlite3

bash
# fetch machine id for your app
$ fly --app mcp-anywhere-app machine list

$ fly console --app mcp-anywhere-app --machine <MACHINE_ID>

Sample database commands, once logged in to the machine console

bash
$ sqlite3 /.data/mcp_anywhere.db ".tables"

$ sqlite3 /.data/mcp_anywhere.db "SELECT * FROM users;"

Usage

Adding Tools from GitHub

Use the web interface to add MCP server repositories:

  • Official MCP servers: https://github.com/modelcontextprotocol/servers
  • Python interpreter: https://github.com/yzfly/mcp-python-interpreter
  • Any compatible MCP repository

The system uses Claude AI to automatically analyze and configure repositories.

Configuration

  • API Keys: Centralized credential storage
  • Secret Files: Secure upload and management of credential files (JSON, PEM, certificates)
  • Tool Management: Enable or disable specific tools
  • Container Settings: Automatic Docker containerization

Secret File Management

MCP Anywhere supports secure upload and management of credential files for MCP servers:

Supported File Types:

  • JSON credential files (.json)
  • PEM certificates and keys (.pem, .key, .crt, .cert)
  • PKCS12/PFX certificates (.p12, .pfx)
  • Java KeyStores (.jks, .keystore)
  • Configuration files (.yaml, .yml, .xml, .txt)

Features:

  • Files are encrypted at rest using AES-128 (Fernet)
  • Maximum file size: 10MB
  • Files are mounted as read-only volumes in containers
  • Environment variables automatically set with file paths
  • Automatic cleanup when servers are deleted

Usage via Web Interface:

  1. Navigate to the server detail page
  2. Use the "Upload Secret File" form
  3. Specify an environment variable name (e.g., GOOGLE_APPLICATION_CREDENTIALS)
  4. Upload the credential file
  5. The file will be automatically mounted when the container starts

Security Considerations:

  • Files are stored encrypted in DATA_DIR/secrets/<server_id>/
  • Each server has isolated secret storage
  • Files are only decrypted when mounting to containers
  • Container access is read-only

Client Integration

Claude Desktop Configuration:

First run which uv, which will print out a path to the uv binary. For example on macOS:

/Users/yourname/.local/bin/uv

You can then use that in the start command. Change the --directory path to your MCP Anywhere clone path.

json
{
  "mcpServers": {
    "mcp-anywhere": {
      "command": "/Users/yourname/.local/bin/uv",
      "args": ["run", "--directory", "/Users/yourname/Projects/mcp-anywhere", "mcp-anywhere", "connect"]
    }
  }
}

Lastly, set up the MCP Anywhere application before starting Claude Desktop:

bash
uv run mcp-anywhere serve stdio

Authentication Options:

For Google OAuth (recommended for teams):

  1. Set up Google OAuth credentials in Google Cloud Console
  2. Configure environment variables:
    bash
    GOOGLE_OAUTH_CLIENT_ID=your-client-id
    GOOGLE_OAUTH_CLIENT_SECRET=your-client-secret
    GOOGLE_OAUTH_REDIRECT_URI=/auth/callback
    OAUTH_USER_ALLOWED_DOMAIN=company.com  # Optional: restrict to your domain
  3. Users can sign in with Google at /auth/login

HTTP API Integration:

python
from fastmcp import Client
from fastmcp.client.auth import BearerAuth

async with Client(
    "https://your-app.fly.dev/mcp/",
    auth=BearerAuth(token="<oauth-token>")
) as client:
    tools = await client.list_tools()

Command Line Interface:

bash
# For MCP client connection
mcp-anywhere connect
# Or: python -m mcp_anywhere connect

# For STDIO server mode (local Claude Desktop integration)
mcp-anywhere serve stdio

# For HTTP server mode with OAuth (production)
mcp-anywhere serve http --host 0.0.0.0 --port 8000

Features

Authentication & Access Control

  • Google OAuth integration - Sign in with Google for simplified authentication
  • Domain-based access control - Restrict access to users from specific domains (e.g., @company.com)
  • Session-based web authentication with secure cookie management
  • JWT tokens for API access with proper scope validation

Tool Discovery and Management

  • Automatic repository analysis using Claude AI
  • Container health monitoring with intelligent remounting
  • Support for npx, uvx, and Docker runtimes
  • Selective tool enablement with per-server controls
  • Enhanced server management - Start, stop, and restart servers through web interface
  • Pre-configured Python interpreter with sandbox isolation

Security and Authentication

  • Google OAuth integration for simplified user authentication
  • Domain-based access control for organizational security
  • OAuth 2.0/2.1 with PKCE support (MCP SDK implementation)
  • JWT-based API authentication
  • Docker container isolation for tool execution
  • Session-based authentication for web interface
  • Encrypted secret file storage (AES-128 with Fernet)

Production Architecture

  • Asynchronous architecture (Starlette/FastAPI)
  • Health monitoring with automatic recovery
  • Flexible container management with configurable startup/shutdown behavior
  • Enhanced server lifecycle management with start/stop/restart controls
  • Streamlined deployment process with GitHub Actions CI
  • CLI support for direct tool access

Architecture

Client Application → MCP Anywhere Gateway → Docker Containers → MCP Tools
                            ↓
                    Web Management Interface

Contributing

Areas for contribution:

  • Oauth review and additional provider support
  • Container efficiency and latency
  • Improve tests
  • Documentation

Configuration

Required Environment Variables

bash
SECRET_KEY                  # Session encryption key
ANTHROPIC_API_KEY          # Claude API key for repository analysis

Optional Environment Variables

bash
JWT_SECRET_KEY             # JWT token signing key (defaults to SECRET_KEY)
WEB_PORT                   # Web interface port (default: 8000)
DATA_DIR                   # Data storage directory (default: .data)
DOCKER_TIMEOUT             # Container operation timeout in seconds (default: 300)
LOG_LEVEL                  # Logging level (default: INFO)
GITHUB_TOKEN               # GitHub token for private repository access

# Container Management
CLEANUP_CONTAINERS_ON_SHUTDOWN    # Clean up containers on app shutdown (default: false)
REBUILD_CONTAINERS_ON_STARTUP     # Rebuild containers on startup (default: true)

# Google OAuth (optional - enables Google authentication)
GOOGLE_OAUTH_CLIENT_ID            # Google OAuth client ID
GOOGLE_OAUTH_CLIENT_SECRET        # Google OAuth client secret  
GOOGLE_OAUTH_REDIRECT_URI         # OAuth redirect URI (e.g., /auth/callback)
OAUTH_USER_ALLOWED_DOMAIN         # Restrict access to specific domain (e.g., company.com)

Development

Development Setup

bash
# Install development dependencies
uv sync --group dev

# Run tests
uv run pytest

# Run linting
uv run ruff check src/ tests/

# Run type checking
uv run mypy src/

Testing

bash
# Run all tests
uv run pytest

# Run tests with coverage
uv run pytest --cov=mcp_anywhere

uv run mcp-anywhere serve http --host 0.0.0.0 --port 8080

Debug Mode

bash
LOG_LEVEL=DEBUG mcp-anywhere serve http

Data Reset

bash
mcp-anywhere reset --confirm

Support

License

See LICENSE

インストール

TypingMind
{
  "mcpServers": {
    "mcp-anywhere": {
      "command": "python",
      "args": [
        "-m",
        "mcp_router.web"
      ]
    }
  }
}

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

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度MCP Routerに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 お使いのデバイス上でMCPをローカル実行することも、リモートMCPサーバーのURLに接続することもできます。

方法1:ローカルコネクタを使用

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

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

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

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

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

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

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

方法2:MCPサーバーのURLを追加

MCP Routerがすでにリモートでホストされている場合や、チームの複数のユーザーで1つのコネクタを共有したい場合は、この方法を使います。

1

MCPコネクタを開く

TypingMindで「プラグイン」に移動し、「MCPコネクタ」を開いて「URLを追加」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 「プラグイン」に移動してください。
  3. 「MCPコネクタ」を開いてください。
  4. 「URLを追加」をクリックします。
TypingMindの「カスタムMCPサーバーURLを追加」フォーム
2

サーバーURLを貼り付け

「サーバーURL」欄にプロバイダーから提供されたMCPサーバーのURLを入力してください。サーバーで必要とされる場合は、接続名、説明、アイコン、カスタムHTTPヘッダー、OAuthクライアント設定を追加してください。

  1. 「サーバーURL」欄にプロバイダーから提供されたMCPサーバーのURLを貼り付けてください。
  2. MCP Routerの接続名を入力してください。
  3. 接続を識別しやすくするには、説明とアイコンを追加してください。
  4. サーバーで認証が必要な場合は、カスタムHTTPヘッダーまたはOAuthクライアントの詳細情報を追加してください。
3

接続を作成

「接続を作成」をクリックし、プラグイン一覧に戻って、新しいMCP接続が有効になっていることを確認してください。

  1. 「接続を作成」をクリックします。
  2. MCPコネクタの一覧に戻ってください。
  3. MCP Routerの接続が「有効」と表示されていることを確認してください。
  4. 接続がすぐに表示されない場合は、プラグイン一覧を更新してください。
4

再接続せずにモデルを切り替え

お好みのモデルでチャットを開始し、「プラグイン」でMCP Routerのツールを有効にしてください。必要に応じて別のモデルに切り替えられます。MCP接続は、TypingMindのワークスペースで引き続き利用できます。

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

よくある質問

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

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

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

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

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

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

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

MCP Routerは、ローカルMCPコネクタを使うか、リモートMCPサーバーのURLを追加することでTypingMindに接続できます。サーバーがデバイス上のファイル、アプリ、プライベートリソースにアクセスする必要がある場合はローカルコネクタを、MCPサーバーがリモートでホストされている場合はサーバーURLを使用してください。

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

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

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

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

関連するMCPサーバー

すべて見る

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

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