Enable uvx GitHub repository usage with automatic Pyodide setup#9
Merged
Conversation
Major improvements for uvx + GitHub repository usage: - Add PyodideManager for centralized Pyodide installation and detection - Implement server startup Pyodide availability checking (not lazy loading) - Add multi-layered fallback: bundled → npm install → direct download - Support automatic npm install when package.json is available - Add aiohttp dependency for Pyodide download fallback Key components: - src/mip_mcp/utils/pyodide_manager.py: New PyodideManager class with comprehensive installation logic - src/mip_mcp/server.py: Add _check_pyodide_sync() called during server startup - src/mip_mcp/mcp_server.py: Use server.run() instead of app.run() for proper initialization - src/mip_mcp/executor/pyodide_executor.py: Use PyodideManager for path resolution - pyproject.toml: Add aiohttp>=3.8.0 dependency for download capability User experience improvements: - Zero manual setup required for uvx --from=https://github.com/... usage - Clear startup messages: "✓ Pyodide setup ready - auto-install from /path" - Automatic dependency resolution without user intervention - Fallback download if npm/bundled options unavailable Technical features: - Thread-safe PyodideManager with async lock for initialization - Multi-path package.json detection for various uvx execution contexts - Graceful fallback chain: bundled → npm → download → error - Improved error messages with actionable suggestions README updates: - Add uvx with GitHub repository installation instructions - Document automatic dependency installation behavior - Provide manual setup guidance for edge cases This enables truly plug-and-play usage: uvx --from=github.com/user/mip-mcp.git mip-mcp 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
🚀 Major enhancement: Enable seamless
uvx --from=https://github.com/...usage with automatic Pyodide setup and zero manual configuration required.Problem Solved
Previously, users trying to run:
Would encounter Pyodide dependency issues requiring manual
npm installor complex setup.Solution Implemented
🔧 PyodideManager: Centralized Installation System
⚡ Server Startup Integration
✓ Pyodide setup ready - auto-install from /path🛡️ Robust Fallback Chain
Key Features
🎯 Zero User Friction
📦 Smart Dependency Management
🔍 Enhanced User Experience
Technical Implementation
Files Added/Modified
src/mip_mcp/utils/pyodide_manager.py✨ New centralized Pyodide management (209 lines)src/mip_mcp/server.py: Add startup Pyodide checking with_check_pyodide_sync()src/mip_mcp/mcp_server.py: Useserver.run()for proper initialization flowsrc/mip_mcp/executor/pyodide_executor.py: Integrate PyodideManager for path resolutionpyproject.toml: Addaiohttp>=3.8.0for download functionalityREADME.md: Document uvx GitHub usage with automatic setupArchitecture Benefits
Testing Verified ✅
Startup Behavior
Installation Scenarios
Code Quality
Impact
Before
After
Breaking Changes
Future Extensibility
This enhancement transforms MIP-MCP into a truly plug-and-play optimization library that works seamlessly with modern Python tooling like
uvx. Users can now focus on their optimization problems instead of dependency management! 🚀Related Issues
🤖 Generated with Claude Code