Skip to main content
Glama
miniOrangeDev

WordPress Code Review MCP Server

security_check

Analyze WordPress code for security vulnerabilities using configured rules to identify potential issues before deployment.

Instructions

Perform security analysis on code using configured security rules

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe code to check for security issues

Implementation Reference

  • Registration of the 'security_check' MCP tool, including name, description, and input schema requiring a 'code' string.
    {
      name: 'security_check',
      description: 'Perform security analysis on code using configured security rules',
      inputSchema: {
        type: 'object',
        properties: {
          code: {
            type: 'string',
            description: 'The code to check for security issues',
          },
        },
        required: ['code'],
      },
    },
  • Type definition (schema) for the performSecurityCheck method return type.
    performSecurityCheck(code: string): Promise<{ vulnerabilities: string[]; warnings: string[]; recommendations: string[] }>;
  • Dispatch in handleTool switch statement for 'security_check' tool call.
    case 'security_check':
      return await this.performSecurityCheck(args.code);
  • Primary handler for 'security_check' tool: delegates to guideline source and formats the result into MCP response.
    private async performSecurityCheck(code: string) {
      try {
        const result = await this.guidelineSource.performSecurityCheck(code);
        
        const response = [];
        
        if (result.vulnerabilities.length > 0) {
          response.push(`🚨 **Vulnerabilities Found:**\n${result.vulnerabilities.map(vuln => `- ${vuln}`).join('\n')}`);
        }
        
        if (result.warnings.length > 0) {
          response.push(`⚠️ **Warnings:**\n${result.warnings.map(warning => `- ${warning}`).join('\n')}`);
        }
        
        if (result.recommendations.length > 0) {
          response.push(`đź’ˇ **Recommendations:**\n${result.recommendations.map(rec => `- ${rec}`).join('\n')}`);
        }
        
        if (response.length === 0) {
          response.push('âś… Security check passed. No obvious vulnerabilities detected.');
        }
        
        return {
          content: [
            {
              type: 'text',
              text: response.join('\n\n'),
            },
          ],
        };
      } catch (error) {
        throw new Error(`Security check failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • Core implementation in UrlGuidelineSource: fetches security rules and parses/appplies them to the code.
    async performSecurityCheck(code: string): Promise<{ vulnerabilities: string[]; warnings: string[]; recommendations: string[] }> {
      const securityGuidelines = await this.fetchGuidelines('security-rules');
      return this.parseSecurityRules(securityGuidelines, code);
    }
  • Helper that applies security rules to code, categorizing results based on level.
    private parseSecurityRules(guidelines: string, code: string): { vulnerabilities: string[]; warnings: string[]; recommendations: string[] } {
      const vulnerabilities: string[] = [];
      const warnings: string[] = [];
      const recommendations: string[] = [];
    
      const rules = this.extractRules(guidelines, 'SECURITY_RULES');
      
      for (const rule of rules) {
        const result = this.applySecurityRule(rule, code);
        
        if (result.level === 'CRITICAL' || result.level === 'HIGH') {
          vulnerabilities.push(`${result.level}: ${result.message}`);
        } else if (result.level === 'MEDIUM') {
          warnings.push(`${result.level}: ${result.message}`);
        } else if (result.level === 'INFO') {
          recommendations.push(result.message);
        }
      }
    
      return { vulnerabilities, warnings, recommendations };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool performs analysis but doesn't describe what happens during execution—whether it's read-only, has side effects, requires specific permissions, or handles errors. For a security analysis tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It's front-loaded with the core purpose and avoids redundancy, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of security analysis, lack of annotations, and no output schema, the description is insufficient. It doesn't explain what the analysis entails, what types of issues are detected, how results are returned, or any limitations. For a tool with potential behavioral nuances, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the single parameter 'code' documented as 'The code to check for security issues'. The description adds no additional meaning beyond this, as it doesn't elaborate on code format, security rule specifics, or analysis scope. With high schema coverage, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Perform security analysis on code using configured security rules'. It specifies the action ('Perform security analysis'), target resource ('code'), and method ('using configured security rules'). However, it doesn't explicitly differentiate from sibling tools like 'validate_code', which might have overlapping functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose this over sibling tools like 'get_guidelines' or 'validate_code', nor does it specify prerequisites, context, or exclusions. The agent must infer usage from the tool name and description alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/miniOrangeDev/wp-code-review-mcp-server'

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