mcp-web-engine 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/main.py +5 -9
  2. package/package.json +1 -1
package/main.py CHANGED
@@ -196,18 +196,14 @@ async def extract_endpoint(body: ExtractMarkdownInput, api_key: str = Depends(ve
196
196
 
197
197
  async def run_mcp_stdio_server():
198
198
  """
199
- Stdio MCP protocol handler for CLI executions (e.g. npx -y mcp-web-engine)
199
+ Robust Stdio MCP protocol handler using asyncio.to_thread for cross-platform compatibility
200
+ (Works on Linux RPi5, x86_64, Windows, macOS without epoll PermissionError)
200
201
  """
201
- loop = asyncio.get_event_loop()
202
- reader = asyncio.StreamReader()
203
- protocol = asyncio.StreamReaderProtocol(reader)
204
- await loop.connect_read_pipe(lambda: protocol, sys.stdin)
205
-
206
202
  while True:
207
- line = await reader.readline()
208
- if not line:
203
+ line_str = await asyncio.to_thread(sys.stdin.readline)
204
+ if not line_str:
209
205
  break
210
- line_str = line.decode("utf-8").strip()
206
+ line_str = line_str.strip()
211
207
  if not line_str:
212
208
  continue
213
209
  try:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-web-engine",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Privacy-First, Self-Hostable & SSRF-Hardened MCP Server & Web Engine for AI Agents",
5
5
  "main": "bin/cli.js",
6
6
  "bin": {