Skip to content

Commit 1479c3f

Browse files
Merge branch 'main' into fix/router-asgi-compliance
2 parents 5190a34 + a278722 commit 1479c3f

File tree

6 files changed

+88
-6
lines changed

6 files changed

+88
-6
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [1.13.2](https://github.com/pathintegral-institute/mcpm.sh/compare/v1.13.1...v1.13.2) (2025-06-05)
2+
3+
4+
### Bug Fixes
5+
6+
* trigger semantic release for Windows compatibility fix ([16b5e44](https://github.com/pathintegral-institute/mcpm.sh/commit/16b5e44f01c34422c8f8c72528b781cd5f908e44))
7+
18
## [1.13.1](https://github.com/pathintegral-institute/mcpm.sh/compare/v1.13.0...v1.13.1) (2025-05-29)
29

310

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,31 @@ mcpm router share # Share the router to public
146146
mcpm router unshare # Unshare the router
147147
```
148148

149+
### 🤝 Share Management (`share`)
150+
151+
The `mcpm share` command allows you to take any shell command that starts an MCP server and instantly expose it as an SSE (Server-Sent Events) server. It uses `mcp-proxy` to handle the server transformation and then creates a secure tunnel for remote access, making your local MCP server accessible from anywhere.
152+
153+
This is particularly useful for quickly sharing a development server, a custom MCP server, or even a standard server with specific configurations without needing to deploy it publicly.
154+
155+
```bash
156+
# 🚀 Share a local MCP server
157+
mcpm share "COMMAND" # Replace COMMAND with your actual server start command
158+
159+
# ⚙️ Options
160+
# COMMAND: The shell command that starts your MCP server (e.g., "uvx mcp-server-fetch", "npx mcp-server"). This must be enclosed in quotes if it contains spaces.
161+
# --port PORT: Specify a local port for the mcp-proxy to listen on. Defaults to a random available port.
162+
# --address ADDRESS: Specify a public address for the tunnel (e.g., yourdomain.com:7000). If not provided, a random tunnel URL will be generated.
163+
# --http: If set, the tunnel will use HTTP instead of HTTPS. Use with caution.
164+
# --timeout TIMEOUT: Timeout in seconds for the mcp-proxy to wait for the server to start. Defaults to 60.
165+
# --retry RETRY: Number of times to retry starting the server if it fails. Defaults to 0.
166+
167+
# 💡 Usage Examples
168+
mcpm share "uvx mcp-server-fetch"
169+
mcpm share "npx mcp-server" --port 5000
170+
mcpm share "uv run my-mcp-server" --address myserver.com:7000
171+
mcpm share "npx -y @modelcontextprotocol/server-everything" --retry 3
172+
```
173+
149174
### 🛠️ Utilities (`util`)
150175

151176
```bash

README.zh-CN.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,31 @@ mcpm router share # 将router分享到公网
179179
mcpm router unshare # 取消分享
180180
```
181181

182+
### 🤝 共享管理 (`share`)
183+
184+
`mcpm share` 命令允许您将任何启动 MCP 服务器的 shell 命令,并立即将其公开为 SSE (Server-Sent Events) 服务器。它使用 `mcp-proxy` 处理服务器转换,然后创建一个安全隧道进行远程访问,使您的本地 MCP 服务器可以从任何地方访问。
185+
186+
这对于快速共享开发服务器、自定义 MCP 服务器,甚至具有特定配置的标准服务器(无需公开部署)特别有用。
187+
188+
```bash
189+
# 🚀 共享本地 MCP 服务器
190+
mcpm share "COMMAND" # 将 COMMAND 替换为您的实际服务器启动命令
191+
192+
# ⚙️ 选项
193+
# COMMAND: 启动 MCP 服务器的 shell 命令 (例如 "uvx mcp-server-fetch", "npx mcp-server")。如果包含空格,则必须用引号括起来。
194+
# --port PORT: 指定 mcp-proxy 监听的本地端口。默认为随机可用端口。
195+
# --address ADDRESS: 指定隧道的公共地址 (例如 yourdomain.com:7000)。如果未提供,将生成随机隧道 URL。
196+
# --http: 如果设置,隧道将使用 HTTP 而不是 HTTPS。请谨慎使用。
197+
# --timeout TIMEOUT: mcp-proxy 等待服务器启动的超时时间(秒)。默认为 60。
198+
# --retry RETRY: 如果服务器启动失败,重试启动服务器的次数。默认为 0。
199+
200+
# 💡 使用示例
201+
mcpm share "uvx mcp-server-fetch"
202+
mcpm share "npx mcp-server" --port 5000
203+
mcpm share "uv run my-mcp-server" --address myserver.com:7000
204+
mcpm share "npx -y @modelcontextprotocol/server-everything" --retry 3
205+
```
206+
182207
### 🛠️ 实用工具 (`util`)
183208

184209
```bash

pages/index.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,27 @@ <h3><span><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox
10011001
</div>
10021002
</div>
10031003

1004+
<h2><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-share-2"><circle cx="18" cy="5" r="3"></circle><circle cx="6" cy="12" r="3"></circle><circle cx="18" cy="19" r="3"></circle><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"></line><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"></line></svg> Share MCP Servers (<code>mcpm share</code>)</h2>
1005+
<p>Share a local MCP server with a public URL. MCPM uses mcp-proxy to expose a stdio MCP server as an SSE server and then creates a tunnel to make it accessible remotely.</p>
1006+
<div class="features">
1007+
<div class="feature">
1008+
<h3><span><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-terminal"><polyline points="4 17 10 17 10 7"></polyline><line x1="20" y1="17" x2="4" y2="17"></line></svg></span> Share a Server</h3>
1009+
<p>Share a server using a specific command:</p>
1010+
<div class="code-block">
1011+
<code><span class="command-prompt">$</span> mcpm share "uvx mcp-server-fetch"</code>
1012+
<button class="copy-button" data-command='mcpm share "uvx mcp-server-fetch"'><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></button>
1013+
</div>
1014+
</div>
1015+
<div class="feature">
1016+
<h3><span><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-zap"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon></svg></span> Share with Options</h3>
1017+
<p>Share a server and specify a port:</p>
1018+
<div class="code-block">
1019+
<code><span class="command-prompt">$</span> mcpm share "npx mcp-server" --port 5000</code>
1020+
<button class="copy-button" data-command='mcpm share "npx mcp-server" --port 5000'><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></button>
1021+
</div>
1022+
</div>
1023+
</div>
1024+
10041025
<h2>Client Management</h2>
10051026
<div class="features">
10061027
<div class="feature">

src/mcpm/commands/share.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@ def find_mcp_proxy() -> Optional[str]:
2929

3030
def make_non_blocking(file_obj):
3131
"""Make a file object non-blocking."""
32-
import fcntl
33-
34-
fd = file_obj.fileno()
35-
fl = fcntl.fcntl(fd, fcntl.F_GETFL)
36-
fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
32+
if os.name == 'posix':
33+
import fcntl
34+
35+
fd = file_obj.fileno()
36+
fl = fcntl.fcntl(fd, fcntl.F_GETFL)
37+
fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
38+
# On other platforms (e.g., Windows), we rely on the behavior of select()
39+
# and the non-blocking nature of readline() on Popen streams,
40+
# or the existing try-except for IOError/OSError.
3741

3842

3943
def wait_for_random_port(process: subprocess.Popen, timeout: int = 20) -> Optional[int]:

src/mcpm/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.13.1"
1+
__version__ = "1.13.2"

0 commit comments

Comments
 (0)