MCP Router logo

MCP Router

Organization
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.

Publisherlocomotive-agency
Repositorymcp-anywhere
LanguagePython
Forks
9
Stars
47
Available tools
0
Transport typestdio, streamable-http
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    MCP Router 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

    47 stars and 9 forks from the linked repository.

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

Installation

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

Use MCP Router MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once MCP Router is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. You can run MCP locally on your device or connect to a remote MCP server URL.

Option 1: 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 MCP Router 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 MCP Router 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": {
    "mcp-anywhere": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the MCP Router 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 MCP Router 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 MCP Router to help me with this task?
MCP Router
Sure. I read it.
Here is what I found using MCP Router.

Option 2: Add an MCP server URL

Use this when MCP Router is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter the MCP server URL from the provider in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste the MCP server URL from the provider into the Server URL field.
  2. Enter a connection name for MCP Router.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the MCP Router connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the MCP Router tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the MCP Router tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use MCP Router to help me with this task?
MCP Router
Sure. I read it.
Here is what I found using MCP Router.

Frequently asked questions

What is the MCP Router MCP server used for?

MCP Router 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 MCP Router MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use MCP Router 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 MCP Router 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 MCP Router connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect MCP Router MCP to TypingMind?

MCP Router can be connected in TypingMind with the local MCP connector or by adding a remote MCP server URL. Use the local connector when the server needs access to files, apps, or private resources on your device, and use a server URL when the MCP server is hosted remotely.

What tools does MCP Router MCP provide in TypingMind?

MCP Router 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 MCP Router MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If MCP Router 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 👇