Skip to main content
Glama
bivex

Scancode License Analysis Tool for MCP

by bivex

mcp_ScancodeMCP_get_license_clause_summary

Generate clause-by-clause summaries of software licenses to identify obligations, risks, and compatibility issues for compliance analysis.

Instructions

Clause-by-clause legal summary of a license (obligations, risks, compatibility, etc).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
licenseNameYesThe license name to summarize (e.g., MIT, GPL-3.0, unknown)

Implementation Reference

  • The registered handler function that executes the tool logic by calling the legalSummaryForLicense helper with the provided licenseName.
    async ({ licenseName }) => { return { content: [{ type: "text", text: await legalSummaryForLicense(licenseName) }] }; }
  • Input schema for the tool, defining the 'licenseName' parameter as a string.
    inputSchema: { licenseName: z.string().describe("The license name to summarize (e.g., MIT, GPL-3.0, unknown)") },
  • index.ts:180-192 (registration)
    Registration of the MCP tool 'mcp_ScancodeMCP_get_license_clause_summary' with title, description, schema, and handler.
    server.registerTool( "mcp_ScancodeMCP_get_license_clause_summary", { title: "Get License Clause Summary", description: "Clause-by-clause legal summary of a license (obligations, risks, compatibility, etc).", inputSchema: { licenseName: z.string().describe("The license name to summarize (e.g., MIT, GPL-3.0, unknown)") }, }, async ({ licenseName }) => { return { content: [{ type: "text", text: await legalSummaryForLicense(licenseName) }] }; } );
  • The main helper function that implements the license clause summary logic using a dictionary of predefined short and long summaries for various license types, matching by substring and providing detailed legal information.
    async function legalSummaryForLicense(licenseName: string, short = false): Promise<string> { // This is a simplified legal expert system for demo purposes const name = licenseName.toLowerCase(); const licenseSummaries: { [key: string]: { short: string; long: string } } = { "mit": { short: "MIT: Permissive, allows reuse/modification, requires attribution, disclaims warranties. Low risk.", long: `Type: Permissive\nGrant: Broad rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies.\nObligations: Must include original copyright and license.\nWarranty: Disclaimed.\nIndemnity: None.\nCompatibility: Compatible with most open and closed licenses.\nRisks: Minimal.\nCommercial Use: Safe.\n` }, "gpl": { short: "GPL: Copyleft, requires derivatives to be GPL, viral effect, not business-friendly for closed source.", long: `Type: Copyleft\nGrant: Use, copy, modify, distribute.\nObligations: Derivatives must be GPL, source code disclosure required.\nWarranty: Disclaimed.\nIndemnity: None.\nCompatibility: Incompatible with most closed/proprietary licenses.\nRisks: Viral obligations, business model conflict.\nCommercial Use: Risky for proprietary.\n` }, "lgpl": { short: "LGPL: Weak copyleft, allows dynamic linking, but modifications to LGPL code must be open.", long: `Type: Weak Copyleft\nGrant: Use, copy, modify, distribute.\nObligations: Modifications to LGPL code must be LGPL, dynamic linking allowed.\nWarranty: Disclaimed.\nIndemnity: None.\nCompatibility: More compatible than GPL, but still viral for modifications.\nRisks: Linking confusion.\nCommercial Use: Moderate risk.\n` }, "bsd": { short: "BSD: Permissive, minimal restrictions, requires attribution.", long: `Type: Permissive\nGrant: Use, copy, modify, distribute.\nObligations: Attribution, sometimes no endorsement.\nWarranty: Disclaimed.\nIndemnity: None.\nCompatibility: High.\nRisks: Minimal.\nCommercial Use: Safe.\n` }, "apache": { short: "Apache: Permissive, explicit patent grant, requires NOTICE file.", long: `Type: Permissive\nGrant: Use, copy, modify, distribute.\nObligations: Attribution, NOTICE file, patent grant.\nWarranty: Disclaimed.\nIndemnity: None.\nCompatibility: High, but not with GPLv2.\nRisks: Patent termination.\nCommercial Use: Safe.\n` }, "proprietary": { short: "Proprietary: Custom terms, usually restricts use, modification, redistribution. High legal risk.", long: `Type: Proprietary\nGrant: Limited, as specified.\nObligations: As specified, often strict.\nWarranty: Varies.\nIndemnity: Varies.\nCompatibility: Usually incompatible with open source.\nRisks: High, custom terms.\nCommercial Use: Review required.\n` }, "unknown": { short: "Unknown: No license detected, all rights reserved by default. Cannot use, modify, or distribute.", long: `Type: Unknown\nGrant: None.\nObligations: Cannot use, modify, or distribute.\nWarranty: None.\nIndemnity: None.\nCompatibility: None.\nRisks: Maximum.\nCommercial Use: Forbidden.\n` }, "cc-by": { short: "CC-BY: Attribution required, otherwise permissive.", long: `Type: Permissive (Creative Commons)\nGrant: Use, share, adapt.\nObligations: Attribution.\nWarranty: Disclaimed.\nIndemnity: None.\nCompatibility: Not for software.\nRisks: License scope confusion.\nCommercial Use: Allowed.\n` }, "public-domain": { short: "Public Domain: No rights reserved, free to use.", long: `Type: Public Domain\nGrant: Unrestricted.\nObligations: None.\nWarranty: None.\nIndemnity: None.\nCompatibility: Universal.\nRisks: None.\nCommercial Use: Safe.\n` }, "default": { short: `Custom/Unknown: Legal review required. High risk of non-compliance or business conflict.`, long: `Type: Custom/Unknown\nGrant: Unclear.\nObligations: Unclear.\nWarranty: Unclear.\nIndemnity: Unclear.\nCompatibility: Unclear.\nRisks: High.\nCommercial Use: Not recommended without legal review.\n` } }; for (const key in licenseSummaries) { if (name.includes(key)) { const summary = licenseSummaries[key]; return short ? summary.short : summary.long; } } // Fallback for custom/complex/unknown if no match found const defaultSummary = licenseSummaries["default"]; return short ? defaultSummary.short : defaultSummary.long; }

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