Skip to main content
Glama

Expose Your Local MCP Server to the Internet

Written by on .

mcp
MCP Inspector
tutorial

  1. Why Expose Your Local MCP Server?
    1. Getting Started
      1. Client Configuration

        One of the most powerful aspects of the Model Context Protocol (MCP) is its ability to give AI assistants access to local resources–your file system, development environment, databases, and more. But what if you want to access your local MCP server from a remote AI client?

        With mcp-proxy, you can now expose any stdio-based MCP server to the internet with a single command.

        mcp-proxy --port 8080 --tunnel -- tsx server.js

        When the tunnel is established, you'll see a message like:

        tunnel established at https://warm-firefox-62.tunnel.gla.ma

        Why Expose Your Local MCP Server?

        • Give remote clients access to local Git repositories – Let cloud-based AI assistants analyze commits, create branches, and help with code reviews without pushing to a remote first

        • Give remote clients access to your local browser – Enable AI to interact with your browser for scraping, testing, or automating workflows requiring local authentication

        • Expose local databases – Query and modify data without exposing credentials or complex tunneling

        • Delegate to local LLMs via MCP sampling – Let remote clients send inference requests to LLMs running on your machine

        • Troubleshoot with remote MCP Inspector – Debug your local MCP server using the hosted MCP Inspector

        Getting Started

        Expose your local MCP server with a public URL:

        npx mcp-proxy --port 8080 --tunnel -- npx -y @anthropic/mcp-server-filesystem /path/to/directory

        You'll see output like:

        tunnel established at https://abc123xyz.tunnel.gla.ma

        Client Configuration

        Configure your AI client to connect to the public URL:

        { "mcpServers": { "my-local-server": { "command": "npx", "args": [ "mcp-remote", "https://abc123xyz.tunnel.gla.ma/sse", "--header", "X-API-Key: ${API_KEY}" ], "env": { "API_KEY": "your-secret-key" } } } }

        Get started with mcp-proxy today:

        npm install -g mcp-proxy

        Written by punkpeye (@punkpeye)