stevewallone/py-dep-licenses-mcp-server
If you are the rightful owner of py-dep-licenses-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Py Dep Licenses MCP Server is a powerful tool for analyzing Python dependencies and their commercial licensing implications.
Python Dependencies Licenses MCP Server
A powerful Model Context Protocol (MCP) server that provides comprehensive Python dependency analysis with commercial licensing insights.
Table of Contents
- Overview
- Features
- Prerequisites
- Installation
- Running the Server
- Usage
- Available Tools
- Troubleshooting
- Testing
- Development
- License
- Contributing
- Issues
- Acknowledgments
Overview
This MCP server helps developers and businesses understand the licensing implications of Python dependencies in their projects. It analyzes GitHub repositories, fetches license information from PyPI, and provides clear insights into which packages are free for commercial use and which may require payment.
Features
- Advanced Python Dependencies Tool: Analyzes GitHub Python repositories and provides comprehensive dependency analysis
- Commercial Licensing Analysis: Identifies which dependencies require payment for commercial use
- Multiple File Format Support: Supports requirements.txt, pyproject.toml, setup.py, environment.yml, Pipfile, uv.lock, poetry.lock, and Pipfile.lock
- License Information: Fetches license details from PyPI for each dependency
- Business Intelligence: Categorizes licenses by commercial use implications
- MCP Compliant: Built using the official MCP SDK
- Cross-Platform: Works on Windows, macOS, and Linux
- Easy Setup: Simple installation and startup process
Prerequisites
- Node.js 18+: Download from nodejs.org
- npm: Usually comes with Node.js
Installation
From Source
-
Clone the repository:
git clone https://github.com/stevewallone/py-dep-licenses-mcp-server.git cd py-dep-licenses-mcp-server
-
Install dependencies:
npm install
From npm (when published)
npm install -g py-dep-licenses-mcp-server
Running the Server
Option 1: Using npm scripts
npm start
Option 2: Using startup scripts
- On macOS/Linux:
./start-server.sh
- On Windows:
start-server.bat
Option 3: Direct execution
node server.js
Usage
Dependency Analysis Tool
Use the list_dependencies tool with github_url "https://github.com/user/repo"
The server will provide comprehensive dependency analysis with commercial licensing insights.
Available Tools
list_dependencies
Comprehensive Python dependency analysis tool that lists dependencies from GitHub repositories with commercial licensing insights.
Parameters:
github_url
(string, required): The GitHub URL of the Python repository (e.g., https://github.com/user/repo)
Supported File Formats (in priority order):
requirements.txt
- Standard pip requirementspyproject.toml
- Modern Python packaging (PEP 621, Poetry, setuptools)uv.lock
- UV package manager lock filepoetry.lock
- Poetry package manager lock filePipfile.lock
- Pipenv lock filesetup.py
- Legacy setuptools configurationenvironment.yml
- Conda environment filePipfile
- Pipenv configuration
Features:
- License Detection: Automatically fetches license information from PyPI
- Commercial Use Analysis: Categorizes licenses by commercial use implications
- Cost Assessment: Identifies packages requiring payment for commercial use
- Business Intelligence: Provides licensing summary and recommendations
Example:
{
"name": "list_dependencies",
"arguments": {
"github_url": "https://github.com/stevewallone/temporal-ai-agent"
}
}
Response:
Dependencies for stevewallone/temporal-ai-agent (from pyproject.toml):
FREE for Commercial Use (14)
- litellm (MIT) - Free for commercial use
- pyyaml (MIT) - Free for commercial use
- fastapi (OSI Approved) - Free for commercial use (OSI Approved)
- uvicorn (OSI Approved) - Free for commercial use (OSI Approved)
- python-dotenv (BSD-3-Clause) - Free for commercial use
- requests (Apache-2.0) - Free for commercial use
- pandas (MIT) - Free for commercial use
- stripe (OSI Approved) - Free for commercial use (OSI Approved)
- fastmcp (OSI Approved) - Free for commercial use (OSI Approved)
- pytest (MIT) - Free for commercial use
- black (OSI Approved) - Free for commercial use (OSI Approved)
- isort (OSI Approved) - Free for commercial use (OSI Approved)
- mypy (MIT) - Free for commercial use
- poethepoet (MIT) - Free for commercial use
PAYMENT REQUIRED for Commercial Use (1)
- sourcery (Proprietary) - Proprietary license - Payment required
UNKNOWN Commercial Use Status (3)
- temporalio (License unknown) - License information unavailable
- gtfs-kit (License unknown) - License information unavailable
- pytest-asyncio (License unknown) - License information unavailable
Commercial Use Summary
- Free for commercial use: 14 packages
- Check commercial restrictions: 0 packages
- Payment required: 1 packages
- Unknown status: 3 packages
IMPORTANT: 1 package(s) may require payment for commercial use. Review licensing terms carefully!
License Categories:
- FREE: MIT, Apache-2.0, BSD-3-Clause, OSI Approved licenses
- WARNING: GPL, AGPL, and other copyleft licenses requiring careful review
- PAID: Proprietary licenses requiring commercial payment
- UNKNOWN: Packages where license information is unavailable
Troubleshooting
Server won't start
- Ensure Node.js 18+ is installed:
node --version
- Check if dependencies are installed:
npm list
- Try reinstalling dependencies:
npm install
Permission issues (macOS/Linux)
- Make the startup script executable:
chmod +x start-server.sh
Testing
You can test the server manually using MCP client tools or by running it and sending MCP protocol messages via stdin/stdout.
Testing the List Dependencies Tool
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "list_dependencies", "arguments": {"github_url": "https://github.com/stevewallone/temporal-ai-agent"}}}' | node server.js
Development
To modify the server:
- Edit
server.js
to add new tools or modify existing ones - Restart the server (stop with Ctrl+C and run
npm start
again) - Restart Cursor to pick up the changes
- Test your changes in Cursor
Key Implementation Details
The list_dependencies
tool includes:
- File Detection: Searches for dependency files in priority order
- Parsing Logic: Handles multiple file formats with specific parsers
- License Fetching: Batch requests to PyPI API with rate limiting
- Commercial Analysis: Categorizes licenses based on commercial use implications
- Error Handling: Graceful fallbacks for missing files or API failures
License
This project is licensed under the MIT License - see the file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Issues
If you encounter any issues or have suggestions, please open an issue on GitHub.
Acknowledgments
- Built with the Model Context Protocol SDK
- License information fetched from PyPI
- Inspired by the need for better dependency management in Python projects
Happy coding!