FM

fangyinc/mcpport

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

11 stars 5 forks 品質 51 トレンド 8MIT

mcpport — A lightweight gateway & registry for Model Context Protocol (MCP), enabling standardized connectivity for AI applications.

概要

mcpport — A lightweight gateway & registry for Model Context Protocol (MCP), enabling standardized connectivity for AI applications. It will start the gateway on port 8765 by default. And the common access points are: - ws://localhost:8765/mcp/register is the registration endpoint. - http://localhost:8765/sse is the event stream endpoint(SSE). - http://localhost:8765/messages is the message endpoint(HTTP). 2. Register your MCP Server to the Gateway It will register a MCP server named file to the gateway. The server is a simple file system server, which is implemented by @modelcontextprotocol/server-filesystem. You can use --auth-token to set the auth token for the gateway. The default authentication method is Bearer token(Set to Authorization header). If you set the auth token for the gateway, you need to set the same auth token for the MCP server when you register it.

README

以下は原文 README の抜粋です。原文を見る。

mcpport

mcpport — A lightweight gateway & registry for Model Context Protocol (MCP), enabling standardized connectivity for AI applications.

Quick Start

  1. Start your MCP Gateway
uvx mcpport gateway

It will start the gateway on port 8765 by default. And the common access points are:

  • ws://localhost:8765/mcp/register is the registration endpoint.
  • http://localhost:8765/sse is the event stream endpoint(SSE).
  • http://localhost:8765/messages is the message endpoint(HTTP).
  1. Register your MCP Server to the Gateway
uvx mcpport register \
--stdio "npx -y @modelcontextprotocol/server-filesystem ./" \
--gateway-url "ws://localhost:8765/mcp/register" \
--server-name "file"

It will register a MCP server named file to the gateway. The server is a simple file system server, which is implemented by @modelcontextprotocol/server-filesystem.

Authentication

You can use --auth-token to set the auth token for the gateway.

uvx mcpport gateway --auth-token "my-token1" --auth-token "my-token2"

The default authentication method is Bearer token(Set to Authorization header).

If you set the auth token for the gateway, you need to set the same auth token for the MCP server when you register it.

uvx mcpport register \
--stdio "npx -y @modelcontextprotocol/server-filesystem ./" \
--gateway-url "ws://localhost:8765/mcp/register" \
--server-name "file" \
--header "Authorization: Bearer my-token1"

And you must set the auth token for SSE connections. You can set the auth token in the Authorization header.

Architecture

The architecture of the MCP gateway is as follows:

NAT Traversal Architecture for Cross-Network MCP Tool Access

The MCPPort solution enables edge devices to seamlessly provide MCP services through secure NAT traversal. By establishing persistent bidirectional WebSocket connections between MCPPort Clients (running on edge devices) and the central MCPPort Gateway, the system creates secure tunnels that bypass firewall restrictions.

Advanced Usage

ipv6 Support

Start Your MCP Gateway With ipv6 Support

uvx mcpport gateway --host "::" --ipv6

SSL Support

You can use --ssl-enabled to enable SSL support for the gateway.

uv run mcpport gateway \
--ssl-enabled \
--ssl-keyfile {path_to_your_keyfile} \
--ssl-certfile {path_to_your_certfile}

Then you can register your MCP server to the gateway with wss:// protocol. And access the SSE and message endpoints with https:// protocol.

uvx mcpport register \
--stdio "npx -y @modelcontextprotocol/server-filesystem ./" \
--gateway-url "wss://localhost:8765/mcp/register" \
--server-name "file" 

If you want to disable the SSL verification, you can use --no-ssl-verify option.

uvx mcpport register \
GitHub で README 全文を見る

インストール

uvx mcpport gateway
MCP 初心者?mcpskill.org のガイドから始めましょう →