Model Context Protocol server for SEMCL.ONE OSS compliance toolchain
Project description
mcp-semclone - Model Context Protocol Server for SEMCL.ONE
MCP (Model Context Protocol) server that provides LLMs with comprehensive OSS compliance and vulnerability analysis capabilities through the SEMCL.ONE toolchain.
Overview
mcp-semclone integrates the complete SEMCL.ONE toolchain to provide LLMs with powerful software composition analysis capabilities:
- License Detection & Compliance: Scan codebases for licenses and validate against policies
- Binary Analysis: Analyze compiled binaries (APK, EXE, DLL, SO, JAR) for OSS components and licenses
- Vulnerability Assessment: Query multiple vulnerability databases for security issues
- Package Discovery: Identify packages from source code and generate PURLs
- SBOM Generation: Create Software Bill of Materials in SPDX/CycloneDX formats
- Policy Validation: Check license compatibility and organizational compliance
Features
Tools
scan_directory- Comprehensive directory scanning for packages, licenses, and vulnerabilitiesscan_binary- Analyze compiled binaries (APK, EXE, DLL, SO, JAR) for OSS componentscheck_package- Check specific packages for licenses and vulnerabilitiesvalidate_policy- Validate licenses against organizational policiesvalidate_license_list- Quick license safety validation for distribution typesget_license_obligations- Get detailed compliance requirements for licensescheck_license_compatibility- Check if two licenses can be mixedget_license_details- Get comprehensive license information including full textanalyze_commercial_risk- Assess commercial distribution risksgenerate_mobile_legal_notice- Generate legal notices for mobile appsgenerate_sbom- Generate SBOM for projects
Resources
license_database- Access license compatibility informationpolicy_templates- Get pre-configured policy templates
Prompts
compliance_check- Guided workflow for license compliance checkingvulnerability_assessment- Guided workflow for security assessment
Installation
Single Command Installation
pip install mcp-semclone
This automatically installs all required SEMCL.ONE tools:
- osslili - License detection from source code
- binarysniffer - Binary analysis for OSS components
- src2purl - Package discovery and PURL generation
- purl2notices - License notices extraction
- ospac - Policy validation engine
- vulnq - Vulnerability database queries
- upmex - Package metadata extraction
Development Installation
git clone https://github.com/SemClone/mcp-semclone.git
cd mcp-semclone
pip install -e .[dev]
Configuration
MCP Client Integration
Add to your MCP client configuration file:
{
"mcpServers": {
"semclone": {
"command": "python",
"args": ["-m", "mcp_semclone.server"],
"env": {
"GITHUB_TOKEN": "your_github_token_optional",
"NVD_API_KEY": "your_nvd_api_key_optional"
}
}
}
}
Environment Variables
Optional environment variables for enhanced functionality:
# API Keys (optional, for higher rate limits)
export GITHUB_TOKEN="your_github_token"
export NVD_API_KEY="your_nvd_api_key"
# Tool paths (optional, only if tools are not in PATH)
# Tools are auto-detected by default using shutil.which()
export OSSLILI_PATH="/custom/path/to/osslili"
export BINARYSNIFFER_PATH="/custom/path/to/binarysniffer"
export SRC2PURL_PATH="/custom/path/to/src2purl"
export VULNQ_PATH="/custom/path/to/vulnq"
export OSPAC_PATH="/custom/path/to/ospac"
export PURL2NOTICES_PATH="/custom/path/to/purl2notices"
export UPMEX_PATH="/custom/path/to/upmex"
Note: Tools are automatically detected in your PATH. Environment variables are only needed for custom installation locations.
Usage Examples
With MCP Clients
Once configured, you can ask your LLM:
- "Scan /path/to/project for license compliance issues"
- "Analyze this Android APK file for OSS components and licenses"
- "Check if this project has any critical vulnerabilities"
- "Generate an SBOM for my project"
- "What licenses are in this compiled binary?"
- "Validate these licenses against our commercial distribution policy"
- "Find all GPL-licensed dependencies in this codebase"
Direct MCP Client Usage
from mcp import Client
import asyncio
async def main():
async with Client("mcp-semclone") as client:
# Scan a directory
result = await client.call_tool(
"scan_directory",
{
"path": "/path/to/project",
"check_vulnerabilities": True,
"check_licenses": True
}
)
print(f"Found {result['metadata']['total_packages']} packages")
print(f"Found {result['metadata']['total_vulnerabilities']} vulnerabilities")
# Scan a binary file
binary_result = await client.call_tool(
"scan_binary",
{
"path": "/path/to/app.apk",
"analysis_mode": "deep",
"check_compatibility": True
}
)
print(f"Found {binary_result['metadata']['component_count']} components")
print(f"Licenses: {binary_result['licenses']}")
# Check a specific package
package_result = await client.call_tool(
"check_package",
{"identifier": "pkg:npm/express@4.17.1"}
)
print(f"Vulnerabilities: {package_result['vulnerabilities']}")
asyncio.run(main())
Workflows
License Compliance Check
- Scan the project to identify all packages and licenses
- Load or create a policy defining allowed/denied licenses
- Validate licenses against the policy
- Generate compliance report with violations and recommendations
Vulnerability Assessment
- Discover packages in the codebase
- Query vulnerability databases for each package
- Prioritize by severity (CRITICAL > HIGH > MEDIUM > LOW)
- Identify available fixes and upgrade paths
- Generate security report with remediation steps
SBOM Generation
- Scan project structure to identify components
- Extract metadata for each component
- Detect licenses and copyright information
- Format as SBOM (SPDX or CycloneDX)
- Validate completeness of the SBOM
Architecture
┌─────────────┐
│ LLM Client │
│ (MCP Client) │
└────────┬────────┘
│ MCP Protocol
┌────────▼────────┐
│ mcp-semclone │
│ MCP Server │
└────────┬────────┘
│ Subprocess calls
┌────────▼────────────────────┐
│ SEMCL.ONE Toolchain │
├──────────────────────────────┤
│ osslili │ License detection │
│ src2purl │ Package discovery │
│ vulnq │ Vulnerability DB │
│ ospac │ Policy engine │
│ upmex │ Metadata extract │
└──────────────────────────────┘
Server Instructions for LLMs
The MCP server includes comprehensive instructions that help LLMs understand how to use the tools effectively. These instructions are automatically injected into the LLM's context when using the server, providing:
Workflow Patterns
- License-first approach: The server prioritizes license detection before package identification or vulnerability scanning
- Efficient execution order: Tools are orchestrated in an optimal sequence (licenses → packages → vulnerabilities → policy validation)
- Smart dependency handling: Package identification is only performed when needed for vulnerability checks or detailed SBOMs
Tool Selection Guidance
- When to use
scan_directory(comprehensive analysis) vscheck_package(single package lookup) - How tools interact (e.g.,
generate_sbomautomatically callsscan_directoryinternally) - Specialized tools for specific scenarios (e.g.,
analyze_commercial_riskfor mobile/commercial distribution)
Performance Optimization
- Vulnerability scanning is limited to the first 10 packages to avoid timeouts
- Recursive scanning depth limits: 10 for licenses, 5 for package identification
- 120-second timeout per tool invocation
- Guidance for handling large codebases
Common Usage Patterns
The server provides ready-to-use workflow examples:
- Basic compliance check: License inventory without package identification
- Full security assessment: Complete vulnerability analysis with package discovery
- Policy validation: Automated license compliance checking
- Commercial risk analysis: Copyleft detection for mobile/commercial use
- SBOM generation: Supply chain transparency documentation
This enables LLMs to automatically choose the right tool combination, optimize performance, and follow best practices without requiring user expertise in OSS compliance workflows.
Tool Integration
The MCP server orchestrates multiple SEMCL.ONE tools:
- src2purl: Identifies packages from source files
- osslili: Detects licenses in code and documentation
- vulnq: Queries vulnerability databases (OSV, GitHub, NVD)
- ospac: Validates licenses against policies
- purl2notices: Extracts license notices and copyright
- upmex: Extracts package metadata from manifests
Examples
Basic MCP Client Usage
See examples/basic_usage.py for simple examples of calling MCP tools directly.
Strands Agent with Ollama
A complete autonomous agent example demonstrating OSS compliance analysis using local LLM (Ollama) with MCP integration.
Location: examples/strands-agent-ollama/
Features:
- Autonomous decision-making (plan → execute → interpret → report)
- Local LLM inference via Ollama (llama3, gemma3, deepseek-r1)
- Interactive and batch analysis modes
- Custom policy enforcement
- Complete privacy (no external API calls)
Quick Start:
cd examples/strands-agent-ollama
./quickstart.sh
python agent.py interactive
Documentation:
- README.md - Complete usage guide
- TUNING.md - Optimization guide
- OVERVIEW.md - Architecture reference
Use Cases:
- Mobile app compliance (APK/IPA analysis)
- Embedded/IoT firmware scanning
- CI/CD integration
- Interactive compliance queries
See the example directory for full details.
Development
Running Tests
# Run all tests
pytest
# Run with coverage
pytest --cov=mcp_semclone tests/
# Run specific test
pytest tests/test_server.py -v
Building
# Build package
python -m build
# Install locally for testing
pip install -e .
Troubleshooting
Common Issues
- Tools not found: Ensure all SEMCL.ONE tools are installed and in PATH
- API rate limits: Add API keys to environment variables
- Permission errors: Check file/directory permissions
- Large codebases: Use recursive=False or limit scan depth
Debug Mode
Enable debug logging:
export MCP_LOG_LEVEL=DEBUG
python -m mcp_semclone.server
Security Considerations
- API keys are optional but recommended for production use
- The server runs tools via subprocess with user permissions
- Vulnerability data is fetched from public APIs
- No data is sent to external services without explicit tool calls
Contributing
We welcome contributions! Please see CONTRIBUTING.md for details.
License
mcp-semclone is released under the Apache License 2.0. See LICENSE for details.
Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Security: Report vulnerabilities to security@semcl.one
Part of the SEMCL.ONE Software Composition Analysis toolchain
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_semclone-1.3.1.tar.gz.
File metadata
- Download URL: mcp_semclone-1.3.1.tar.gz
- Upload date:
- Size: 71.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4a2514e9919dcc3e1f822ba62f50587808a1c2db2656fb386f323d18f8fb5b8
|
|
| MD5 |
04099441e91e4d2dc23f038cfc3e8dc1
|
|
| BLAKE2b-256 |
8433bfc201afdf3c4103c1e9e7a7c520a569b015db20d1ace709eed003e3250c
|
Provenance
The following attestation bundles were made for mcp_semclone-1.3.1.tar.gz:
Publisher:
python-publish.yml on SemClone/mcp-semclone
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_semclone-1.3.1.tar.gz -
Subject digest:
d4a2514e9919dcc3e1f822ba62f50587808a1c2db2656fb386f323d18f8fb5b8 - Sigstore transparency entry: 685379949
- Sigstore integration time:
-
Permalink:
SemClone/mcp-semclone@8a5c809491cd392dc931d62f907fecd9318e8f31 -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/SemClone
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@8a5c809491cd392dc931d62f907fecd9318e8f31 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_semclone-1.3.1-py3-none-any.whl.
File metadata
- Download URL: mcp_semclone-1.3.1-py3-none-any.whl
- Upload date:
- Size: 28.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e1f64fa03992d1653221cae6a045d1b2a315b2fe5de8097fcf4f6bb8819e9c1
|
|
| MD5 |
a0934d8f9bb8b320f36b42eb5000897f
|
|
| BLAKE2b-256 |
50c3f9e93d0f239d77d36eb47451a804be0dc993a8b958448b1fb21899ef790c
|
Provenance
The following attestation bundles were made for mcp_semclone-1.3.1-py3-none-any.whl:
Publisher:
python-publish.yml on SemClone/mcp-semclone
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_semclone-1.3.1-py3-none-any.whl -
Subject digest:
8e1f64fa03992d1653221cae6a045d1b2a315b2fe5de8097fcf4f6bb8819e9c1 - Sigstore transparency entry: 685379950
- Sigstore integration time:
-
Permalink:
SemClone/mcp-semclone@8a5c809491cd392dc931d62f907fecd9318e8f31 -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/SemClone
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@8a5c809491cd392dc931d62f907fecd9318e8f31 -
Trigger Event:
release
-
Statement type: