Skip to main content
Glama
bivex

Scancode License Analysis Tool for MCP

by bivex

mcp_ScancodeMCP_compare_license_compatibility

Compare two software licenses (e.g., MIT vs GPLv3) to determine legal compatibility and receive an explanation using Scancode License Analysis Tool for MCP.

Instructions

Legal compatibility verdict and explanation for two license types (e.g., MIT vs GPLv3).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
licenseAYesFirst license name (e.g., MIT, GPL-3.0)
licenseBYesSecond license name (e.g., Apache-2.0, GPL-2.0)

Implementation Reference

  • index.ts:138-152 (registration)
    Registers the MCP tool 'mcp_ScancodeMCP_compare_license_compatibility' with its input schema and inline handler function that delegates to licenseCompatibilityVerdict.
    server.registerTool( "mcp_ScancodeMCP_compare_license_compatibility", { title: "Compare License Compatibility", description: "Legal compatibility verdict and explanation for two license types (e.g., MIT vs GPLv3).", inputSchema: { licenseA: z.string().describe("First license name (e.g., MIT, GPL-3.0)") , licenseB: z.string().describe("Second license name (e.g., Apache-2.0, GPL-2.0)") }, }, async ({ licenseA, licenseB }) => { // Use a built-in matrix for common licenses, else flag for manual review return { content: [{ type: "text", text: licenseCompatibilityVerdict(licenseA, licenseB) }] }; } );
  • Input schema defining parameters licenseA and licenseB as strings using Zod validation.
    inputSchema: { licenseA: z.string().describe("First license name (e.g., MIT, GPL-3.0)") , licenseB: z.string().describe("Second license name (e.g., Apache-2.0, GPL-2.0)") },
  • The handler function for the tool, which calls licenseCompatibilityVerdict and formats the response as MCP content.
    async ({ licenseA, licenseB }) => { // Use a built-in matrix for common licenses, else flag for manual review return { content: [{ type: "text", text: licenseCompatibilityVerdict(licenseA, licenseB) }] }; }
  • Core helper function that implements the license compatibility logic using a simple decision matrix based on license name keywords.
    function licenseCompatibilityVerdict(licenseA: string, licenseB: string): string { // Simple matrix for demo; real-world use would be more complex const a = licenseA.toLowerCase(); const b = licenseB.toLowerCase(); if (a === b) return `Both are ${licenseA}. Compatible.`; if ((a.includes("mit") && b.includes("gpl")) || (b.includes("mit") && a.includes("gpl"))) { return "MIT and GPL: MIT code can be included in GPL projects, but the combined work must be GPL. GPL code cannot be relicensed as MIT. Compatible with restrictions."; } if ((a.includes("mit") && b.includes("apache")) || (b.includes("mit") && a.includes("apache"))) { return "MIT and Apache: Compatible. Both are permissive, but Apache has extra patent terms."; } if ((a.includes("gpl") && b.includes("apache")) || (b.includes("gpl") && a.includes("apache"))) { return "GPL and Apache: Apache 2.0 is compatible with GPLv3, but not with GPLv2. Check versions."; } if (a.includes("proprietary") || b.includes("proprietary")) { return "Proprietary and open source: Usually incompatible. Legal review required."; } if (a.includes("unknown") || b.includes("unknown")) { return "Unknown license: Cannot determine compatibility. Legal review required."; } return "Compatibility unknown or complex. Legal review recommended."; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bivex/scancodeMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server