DEV Community

Muhammad Amir Ejaz for Stacklok

Posted on

Seamless Remote MCP Server Support with ToolHive

The Model Context Protocol (MCP) is transforming how AI assistants connect to tools and data. Local MCP servers have powered individual workflows, but developers have long wanted the ability to scale those workflows across teams and environments. Until now, running MCP remotely has been complex and limited.
With ToolHive’s new remote server support, that changes. Everything you rely on in local MCP workflows—simplicity, reliability, and integration—is now available for remote servers too. Teams can connect, manage, and scale MCP across the cloud with the same streamlined experience they already know from local development.

Introducing ToolHive’s Remote MCP Server Support

Everything you love about local MCP workflows, now extended to remote servers.

ToolHive brings native, end-to-end support for remote MCP servers, eliminating the gap between local and remote workflows. Teams can now connect, manage, and scale remote servers with the same simplicity and reliability they’ve come to expect from local development.

What Remote Server Support Provides

ToolHive’s remote server support brings a complete set of capabilities for managing remote MCP servers, organized around three key pillars:

Workflow Integration

  • Native integration: Remote servers work seamlessly with ToolHive’s core workflow management.
  • Unified commands: Use thv run for both local and remote servers.
  • Lifecycle management: Remote servers appear in thv list and can be controlled with thv stop, thv restart, and thv rm.
  • Studio support: Manage remote servers alongside local workloads in ToolHive Studio.
  • Group organization: Organize servers into groups for easier project management.
  • Persistent state: Configurations are stored in ToolHive’s unified state management system.
  • Registry integration: Store and run remote server configurations from the ToolHive registry.

Authentication & Security

  • Advanced authentication: Full OAuth and OIDC support with dynamic client registration (RFC 7591).
  • Automatic token management: Tokens are refreshed and managed securely without manual intervention.
  • Secure credential handling: Supports file-based secret storage and environment variables for sensitive data.

Convenience & Automation

  • Automatic naming: Server names are derived from URLs (e.g., https://api.example.com/mcpexample).
  • Integrated experience: Remote servers behave just like local ones—no extra setup required.

Authentication Features

Authentication is central to working with remote MCP servers, and ToolHive provides full support out of the box. It handles OAuth 2.0, OIDC, and Dynamic Client Registration automatically, so you can connect securely without wrestling with manual setup.

Supported Authentication Methods

  • OIDC Authentication For identity-provider–based authentication (e.g., Azure AD), ToolHive supports OIDC with automatic token management.
  thv run https://azure-mcp.example.com/mcp \
    --name azure-mcp-server \
    --remote-auth-issuer https://login.microsoftonline.com/your-tenant-id/v2.0 \
    --remote-auth-client-id your-client-id \
    --remote-auth-client-secret your-client-secret\
Enter fullscreen mode Exit fullscreen mode
  • OAuth 2.0 Authentication For services that expose custom authorization and token endpoints, ToolHive lets you configure them directly:
  thv run https://oauth-mcp.example.com/mcp \
    --name oauth-mcp-server \
    --remote-auth-authorize-url https://oauth.example.com/oauth/authorize \
    --remote-auth-token-url https://oauth.example.com/oauth/token \
    --remote-auth-client-id your-client-id \
    --remote-auth-client-secret your-client-secret
Enter fullscreen mode Exit fullscreen mode
  • Dynamic Client Registration (RFC 7591) When no client credentials are provided, ToolHive can automatically register an OAuth client with the authorization server:
  thv run https://dynamic-mcp.example.com/mcp \
    --name dynamic-mcp-server
Enter fullscreen mode Exit fullscreen mode

ToolHive will:

  • Discover OAuth/OIDC endpoints.
  • Register a new OAuth client.
  • Obtain and manage client credentials.
  • Handle token lifecycle automatically.

Advanced Options

For more complex scenarios, ToolHive also supports:

  • Custom scopes and timeouts
  thv run https://api.example.com/mcp \
    --name custom-mcp-server \
    --remote-auth-issuer https://auth.example.com \
    --remote-auth-client-id your-client-id \
    --remote-auth-scopes openid,profile,email,api:read \
    --remote-auth-timeout 2m
Enter fullscreen mode Exit fullscreen mode
  • Secure credential handling (e.g., file-based secrets)
  thv run https://secure-mcp.example.com/mcp \
    --name secure-mcp-server \
    --remote-auth-issuer https://auth.example.com \
    --remote-auth-client-id your-client-id \
    --remote-auth-client-secret-file /path/to/client-secret.txt
Enter fullscreen mode Exit fullscreen mode

Getting Started with Remote Servers

ToolHive makes it simple to launch and manage remote MCP servers. Just pass a URL to the thv run command—ToolHive automatically detects authentication requirements and applies dynamic client registration if needed.

Basic Usage

# Run a remote MCP server directly (automatic naming if not provided)
thv run https://remote-server.com/mcp --name my-remote-server

# List all servers (local and remote)
thv list

# Stop a remote server
thv stop my-remote-server

# Restart a remote server
thv restart my-remote-server

# Remove a remote server
thv rm my-remote-server
Enter fullscreen mode Exit fullscreen mode

Running from the Registry

ToolHive’s registry also supports remote servers, so you can store and reuse configurations with consistent naming and authentication settings.

# Run a remote server from the registry
thv run my-remote-server-from-registry

# Run with OAuth/OIDC authentication from registry
thv run my-oauth-server \
  --remote-auth-client-id your-client-id \
  --remote-auth-client-secret your-client-secret
Enter fullscreen mode Exit fullscreen mode

Conclusion

The addition of remote MCP server support makes ToolHive a truly comprehensive platform for managing both local and distributed MCP workflows. By removing the complexity of configuration, authentication, and lifecycle management, ToolHive lets developers focus on what really matters: building and scaling great applications.

Whether you’re a backend developer integrating external services, a DevOps engineer orchestrating distributed systems, or a security engineer ensuring robust authentication across your infrastructure, ToolHive brings simplicity, security, and reliability to every step of the process.

👉 Get started with ToolHive Docs, or explore the details on GitHub.

Top comments (0)