Scancode License Analysis Tool for MCP
Required as a runtime environment for the Scancode License Analysis Tool (v18 or higher)
Used as a prerequisite for installing the Scancode License Analysis Tool dependencies
Used as the programming language for developing the Scancode License Analysis Tool
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Scancode License Analysis Tool for MCP show me files with GPL licenses"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Scancode License Analysis Tool for MCP
This project provides a set of tools built with the Model Context Protocol (MCP) TypeScript SDK. These tools help you analyze software licenses, specifically using data from a Scancode-generated license_analysis_detailed.json file. It's designed to make license compliance easier to manage by providing quick access to critical information about problematic licenses, affected files, and scan issues.
What is the Model Context Protocol (MCP)?
MCP is a standardized way for applications (like code editors or AI agents) to communicate with external services (like this license analysis tool). Think of it as a universal language that allows different software components to understand each other and work together, especially when dealing with large codebases or complex data.
Related MCP server: mcp-license-audit
Why use this tool?
If you work with software projects, understanding the licenses of your dependencies is crucial for legal compliance. This tool helps you:
Quickly identify problematic licenses: See which licenses are a concern (e.g., copyleft, GPL, unknown).
Pinpoint affected files: Find out which specific files in your codebase are associated with these licenses.
Review scan issues: Understand if there were any problems during the license scanning process.
Get recommendations: Receive high-level guidance on how to address licensing concerns.
Generate file reports: Easily get the content of a specific file along with its associated problematic licenses, directly from the tool.
Prerequisites
Before you get started, make sure you have the following installed on your system:
Node.js (v18 or higher): A JavaScript runtime. You can download it from nodejs.org.
npm: Node Package Manager, which comes with Node.js.
Setup Steps
Follow these steps to set up and run your Scancode License Analysis Tool:
Clone this repository (if you haven't already): Open your terminal or command prompt and run:
git clone <your-repo-url> # Replace <your-repo-url> with the actual URL cd <your-repo-directory> # Navigate into the cloned project folderInstall project dependencies: This command downloads all the necessary libraries and packages for the tool to run:
npm installEnsure your
license_analysis_detailed.jsonfile is present: This tool relies on alicense_analysis_detailed.jsonfile generated by Scancode. Make sure this file is in the root directory of your project (whereindex.tsis located). This file contains the license scan results that the tools will analyze.Configure TypeScript (Optional, but recommended for development): A
tsconfig.jsonfile is already included and configured. It tells TypeScript how to compile your code. Key settings for this project include:{ "compilerOptions": { "module": "nodenext", // Ensures modern module resolution for Node.js "target": "es2022", // Compiles to a recent JavaScript version "outDir": "dist", // Output compiled JavaScript files to the 'dist' folder // ... other settings for strictness and compatibility ... }, "include": ["index.ts"] // Only compile this file }Build the project (Compile TypeScript to JavaScript): This step compiles your TypeScript code (
.ts) into plain JavaScript (.js) files, which Node.js can execute. The compiled files will be placed in thedist/directory.npx tsc
Running the Tool
YouYou have two main ways to run this tool:
1. For Development (using tsx)
tsx allows you to run TypeScript files directly without a separate compilation step, which is great for development and testing:
npx tsx index.ts2. Running the Built Version
After building your project (step 5 above), you can run the compiled JavaScript files from the dist/ directory:
node dist/index.jsHow to Add This Tool to Cursor MCP
To integrate this tool with Cursor’s Model Context Protocol (MCP) feature, follow these steps:
Start your MCP server: First, get your MCP server running using one of the methods above (e.g.,
npx tsx index.ts). This will keep the server active and listening for requests from Cursor.Open Cursor and navigate to the MCP integration panel. In Cursor, look for the MCP panel (usually in the sidebar or a dedicated view).
Add a new MCP server connection: Click on the option to “Add MCP Server” or similar. You'll need to configure how Cursor connects to your running tool.
Connection Type: Select Stdio.
Command: Provide the command to start your server. This is the same command you used to run it in your terminal.
Example (for development):
npx tsx C:\Users\Admin\Desktop\Dev\ScancodeMCP\index.tsExample (for built version):
node C:\Users\Admin\Desktop\Dev\ScancodeMCP\dist\index.js
(Optional) Environment Variables: You might want to add
NODE_NO_WARNINGS: 1under environment variables to suppress Node.js warnings.
Save and Connect. Once configured, save the connection. Cursor should automatically detect your tools and make them available in the MCP tool palette.
Example: .cursor/mcp.json Configuration
For a permanent setup, you can add this tool directly to your Cursor's global or project-specific .cursor/mcp.json file. This file tells Cursor which MCP servers to automatically start and connect to.
Here's an example entry to add to your .cursor/mcp.json:
{
"mcpServers": {
"scancode-license-server": {
"command": "npx",
"args": [
"tsx",
"C:\\Users\\Admin\\Desktop\\Dev\\ScancodeMCP\\index.ts"
],
"env": {
"NODE_NO_WARNINGS": "1"
},
"disabled": false,
"autoApprove": [
"mcp_ScancodeMCP_analyze_license_file",
"mcp_ScancodeMCP_summarize_license_risks",
"mcp_ScancodeMCP_compare_license_compatibility",
"mcp_ScancodeMCP_list_high_risk_files",
"mcp_ScancodeMCP_get_license_clause_summary"
]
}
// ... any other MCP servers you have ...
}
}Adjust the
argspath: Make sure theC:\\Users\\Admin\\Desktop\\Dev\\ScancodeMCP\\index.tspath matches the actual location of yourindex.tsfile.autoApprove: This list tells Cursor which tools from your server can be automatically approved by the AI. This is convenient for frequently used tools.
After saving mcp.json, reload MCP servers in Cursor (there's usually a refresh button in the MCP panel). Your "Scancode License Analysis Tool" and its sub-tools will then be available in the MCP tool palette, ready to use!
Available Tools and Their Uses
Here are the tools provided by this server, designed to help with license compliance:
Tool Name | Description | How to Use (Example) |
| Clause-by-clause legal analysis of all licenses detected in a file, including obligations, risks, and compatibility. Supports analyzing multiple files and reading a configurable number of lines from each file. |
|
| Lists all files with high-risk/problematic licenses and provides a legal risk summary for each license type. |
|
| Legal compatibility verdict and explanation for two license types (e.g., MIT vs GPLv3). |
|
| Lists all files with copyleft, unknown, or commercial-unfriendly licenses, with a legal warning for each. |
|
| Clause-by-clause legal summary of a license (obligations, risks, compatibility, etc). |
|
License
MIT
Keywords
#OpenSource #LicenseCompliance #LegalTech #Scancode #MCP #ModelContextProtocol #SoftwareLicenses #LicenseAnalysis #ComplianceTool #DeveloperTools #TypeScript #NodeJS #AutomatedLegal #CodeAnalysis
Available Tools
5 toolsmcp_ScancodeMCP_analyze_license_fileAnalyze License File (Legal Breakdown)A
Clause-by-clause legal analysis of all licenses detected in a file, including obligations, risks, and compatibility.
Inputs: filePaths (required), linesToRead, scannedDataBasePath.
mcp_ScancodeMCP_compare_license_compatibilityCompare License CompatibilityB
Legal compatibility verdict and explanation for two license types (e.g., MIT vs GPLv3).
Inputs: licenseA (required), licenseB (required).
mcp_ScancodeMCP_get_license_clause_summaryGet License Clause SummaryB
Clause-by-clause legal summary of a license (obligations, risks, compatibility, etc).
Inputs: licenseName (required).
mcp_ScancodeMCP_list_high_risk_filesList High-Risk FilesA
Lists all files with copyleft, unknown, or commercial-unfriendly licenses, with a legal warning for each.
Inputs: random_string.
mcp_ScancodeMCP_summarize_license_risksSummarize License RisksB
Lists all files with high-risk/problematic licenses and provides a legal risk summary for each license type.
Inputs: random_string.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Most tools have distinct purposes: analyze_license_file examines a specific file's licenses, compare_license_compatibility checks two licenses, get_license_clause_summary details a single license, and list_high_risk_files and summarize_license_risks both identify high-risk files but with slightly different focuses (listing vs. summarizing). The overlap between list_high_risk_files and summarize_license_risks could cause minor confusion, but descriptions clarify their nuances.
All tool names follow a consistent pattern with the prefix 'mcp_ScancodeMCP_' and use snake_case for the action-object structure (e.g., analyze_license_file, compare_license_compatibility). This uniformity makes the set predictable and easy to navigate, with no deviations in naming conventions.
With 5 tools, the server is well-scoped for license analysis, covering key operations like analysis, comparison, summarization, and risk identification. Each tool serves a clear purpose without redundancy, making the count appropriate for the domain's complexity and typical use cases.
The tool set covers core aspects of license analysis, including detailed examination, compatibility checks, and risk assessment. A minor gap exists in lacking tools for broader actions like batch processing multiple files or managing license databases, but agents can work around this with the provided tools for most workflows.
Maintenance
Related MCP Connectors
Open-source licence risk checks for AI coding agents and dependency trees.
Generate, audit, and maintain legal policies that match what your code actually does.
Generate SBOMs, scan vulnerabilities, and analyze dependencies from local projects or Git repos.
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
Related MCP Servers
AlicenseAqualityDmaintenanceScans project dependencies for license compliance, classifying 60+ licenses and detecting conflicts and copyleft risks.428 npm1MIT- AlicenseAqualityDmaintenanceAudits project dependency licenses for compatibility issues, flags GPL/AGPL conflicts, and generates compliance reports.150 npmMIT
- AlicenseAqualityCmaintenanceEnables AI coding agents to audit Python and npm dependency licenses against your distribution context before shipping, returning CLEAN, REVIEW, or BLOCK verdicts with plain-language reasons and supporting notice generation.31MIT
- AlicenseAqualityCmaintenanceProvides authoritative open source license answers: SPDX identification, copyleft classification, and compatibility checks of dependencies against your project's license.31MIT