Skip to main content
Glama

review.security.compare

Compare MCP and ReviewExtension configurations to maintain single source of truth and prevent configuration conflicts.

Instructions

Compare MCP config with ReviewExtention config to ensure SSOT

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdYes

Implementation Reference

  • Handler logic for the 'review.security.compare' tool: loads current security config, performs comparison via helper, and returns JSON result.
    case "review.security.compare": { const currentConfig = await loadSecurityConfig(args.cwd as string); const comparison = await compareWithReviewExtention(args.cwd as string, currentConfig); return { content: [ { type: "text", text: JSON.stringify({ currentSource: currentConfig.source, matching: comparison.matching, differences: comparison.differences }) } ] }; }
  • Core implementation: reloads config from ReviewExtention Ruby script, compares key fields (maxFileSize, allowedExtensions, allowedPaths), computes differences.
    export async function compareWithReviewExtention( cwd: string, currentConfig: SecurityConfig ): Promise<{ matching: boolean; differences: string[] }> { const reviewExtConfig = await loadFromReviewExtention(cwd); if (!reviewExtConfig) { return { matching: false, differences: ["ReviewExtention config not available"] }; } const differences: string[] = []; if (currentConfig.maxFileSize !== reviewExtConfig.maxFileSize) { differences.push(`Max file size: MCP=${currentConfig.maxFileSize}, ReviewExt=${reviewExtConfig.maxFileSize}`); } const extDiff = arrayDifference(currentConfig.allowedExtensions, reviewExtConfig.allowedExtensions); if (extDiff.length > 0) { differences.push(`Allowed extensions differ: ${extDiff.join(", ")}`); } const pathDiff = arrayDifference(currentConfig.allowedPaths, reviewExtConfig.allowedPaths); if (pathDiff.length > 0) { differences.push(`Allowed paths differ: ${pathDiff.join(", ")}`); } return { matching: differences.length === 0, differences }; }
  • Tool schema definition including name, description, and input schema requiring 'cwd'.
    { name: "review.security.compare", description: "Compare MCP config with ReviewExtention config to ensure SSOT", inputSchema: { type: "object", properties: { cwd: { type: "string" } }, required: ["cwd"] } }
  • Utility function to compute symmetric difference between two string arrays for config comparison.
    function arrayDifference(arr1: string[], arr2: string[]): string[] { const set1 = new Set(arr1); const set2 = new Set(arr2); const diff: string[] = []; for (const item of set1) { if (!set2.has(item)) diff.push(`+${item}`); } for (const item of set2) { if (!set1.has(item)) diff.push(`-${item}`); } return diff; }

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/dsgarage/ReviewMCP'

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