Skip to main content
Glama
abac-validation-mcp-server

abac-validation-mcp-server

ABAC Validation MCP Server

An MCP (Model Context Protocol) server that provides AI-assisted ABAC (Attribute-Based Access Control) code validation and review tools. This server integrates with Claude CLI or GitHub Copilot CLI to perform long-running validation operations with progress notifications.

Features

  • Business Logic Validation: Validate code against business requirements using AI

  • AI-Assisted Code Review: Comprehensive code review covering quality, security, and performance

  • Batch Processing: Validate multiple files with progress updates

  • Progress Notifications: Long-running operations report progress to the client

  • CLI Integration: Calls Claude/Copilot CLI for AI analysis (ready for integration)

Related MCP server: Argus MCP

Installation

npm install
npm run build

Usage

Running Standalone

npm run dev

VS Code Configuration

Add to your VS Code settings.json (.vscode/settings.json or user settings):

{
  "mcp.servers": {
    "abac-validation": {
      "type": "stdio",
      "command": "node",
      "args": [
        "/absolute/path/to/abac-validation-mcp-server/dist/index.js"
      ]
    }
  }
}

Or use npx for easier distribution:

{
  "mcp.servers": {
    "abac-validation": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "abac-validation-mcp-server"
      ]
    }
  }
}

Claude Desktop Configuration

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "abac-validation": {
      "command": "node",
      "args": [
        "/absolute/path/to/abac-validation-mcp-server/dist/index.js"
      ]
    }
  }
}

Available Tools

1. validate_business_logic

Validate code against business requirements using AI.

Parameters:

  • code (string, required): The code to validate

  • requirements (string, required): Business requirements to validate against

Example:

{
  "code": "function calculateDiscount(price, customerType) { ... }",
  "requirements": "Premium customers get 20% discount, regular customers get 10%"
}

2. ai_code_review

Perform comprehensive AI-assisted code review.

Parameters:

  • code (string, required): The code to review

  • context (string, optional): Additional context about the code

  • review_type (string, optional): Type of review - "comprehensive", "security", "performance", or "style"

Example:

{
  "code": "async function fetchUserData(userId) { ... }",
  "context": "This is part of a user authentication system",
  "review_type": "security"
}

3. batch_validate

Validate multiple files in batch with progress updates.

Parameters:

  • files (array, required): Array of file objects with path and optional requirements

Example:

{
  "files": [
    { "path": "src/auth.ts", "requirements": "Must use OAuth 2.0" },
    { "path": "src/payment.ts", "requirements": "PCI DSS compliant" }
  ]
}

Integration with Claude/Copilot CLI

Current Status

The server skeleton is ready with placeholder implementations. To integrate with actual CLIs:

Option 1: Claude CLI

Replace the TODO sections in src/index.ts with:

// Install: npm install -g @anthropic-ai/claude-cli
const result = await executeWithProgress('claude', [
  'analyze',
  '--prompt', prompt
], (msg) => {
  if (progressToken) {
    // Send progress notification
  }
});

Option 2: GitHub Copilot CLI

// Requires GitHub Copilot CLI access
const result = await executeWithProgress('gh', [
  'copilot',
  'explain',
  code
], (msg) => {
  if (progressToken) {
    // Send progress notification
  }
});

Option 3: API Calls

For more control, use the Anthropic API directly:

npm install @anthropic-ai/sdk
import Anthropic from '@anthropic-ai/sdk';

const client = new Anthropic({
  apiKey: process.env.ANTHROPIC_API_KEY
});

// Use streaming for progress
const stream = await client.messages.create({
  model: 'claude-sonnet-4-5-20250929',
  messages: [{ role: 'user', content: prompt }],
  stream: true,
  max_tokens: 4096
});

for await (const event of stream) {
  // Send progress updates
}

Development

Build

npm run build

Watch Mode

npm run watch

Testing

Test the server with MCP Inspector:

npx @modelcontextprotocol/inspector node dist/index.js

Next Steps

  1. Integrate CLI: Choose your preferred AI CLI (Claude/Copilot) and implement in the TODO sections

  2. Add Progress Notifications: Use MCP progress notification protocol for real-time updates

  3. File System Access: Add file reading capabilities for batch validation

  4. Configuration: Add config file for API keys, CLI paths, etc.

  5. Error Handling: Improve error handling and retry logic

  6. Caching: Add caching for repeated validations

  7. Custom Validators: Add domain-specific validation rules

Architecture

User (VS Code/Copilot/Claude)
    ↓
MCP Client
    ↓ (stdio)
Validation MCP Server
    ↓
Claude CLI / Copilot CLI / API
    ↓
AI Model (validation/review)
    ↓
Results with Progress

License

MIT

Available Tools

4 tools
analyze_cross_component_impactB

Analyze cross-component impact of code changes on RMS and MIP. This is a detailed analysis tool that runs Claude CLI against RMS and MIP codebases to identify dependencies, breaking changes, and integration issues.

Inputs: codeChanges (required), targetComponents (required), analysisType.

generate_validation_questionsB

Generate pre-defined validation questions based on code changes. Returns a list of relevant questions that should be answered for ABAC compliance and cross-component compatibility.

Inputs: filePath (required), codeChanges (required).

get_current_changesA

Get current uncommitted changes from the M365ABAC repository using git diff. Useful for validating work-in-progress code.

Inputs: repository.

validate_abac_changesB

Validate ABAC code changes using Q&A analysis. Accepts Q&A format where Copilot has already analyzed git diff and answered 8 predefined ABAC questions. Validates the answers against M365ABAC requirements and performs cross-component impact analysis.

Inputs: filePath (required), codeChanges (required), fileType.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 4 tools

    Disambiguation4/5

    The tools are mostly distinct: validate_abac_changes covers full validation, analyze_cross_component_impact focuses specifically on cross-component work, get_current_changes retrieves diffs, and generate_validation_questions produces questions. The main overlap is between validate_abac_changes and analyze_cross_component_impact, since validation already includes cross-component impact analysis, which could cause an agent to pick the wrong one.

    Naming Consistency4/5

    Tools generally follow verb_object pattern: validate_abac_changes, analyze_cross_component_impact, get_current_changes, generate_validation_questions. All use snake_case with consistent verb-first naming, though the objects vary in form (abac_changes vs cross_component_impact vs current_changes vs validation_questions) making them slightly less uniform.

    Tool Count4/5

    Four tools is a well-scoped set for a validation workflow. Each tool represents a distinct stage: get diffs, generate questions, analyze cross-component impact, and validate. This is an appropriate size that feels lean but sufficient for the stated purpose of ABAC change validation.

    Completeness3/5

    The workflow covers retrieving changes, generating questions, analyzing cross-component impact, and validating against requirements. However, there's no dedicated tool for applying validation recommendations or generating a final report/summary, and the coupling between generate_validation_questions and validate_abac_changes (which accepts answers to 8 predefined questions) may leave a gap if questions change. The core loop is covered but reporting and remediation are absent.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Converts natural language security requirements into validated Cerbos YAML policies with automated testing and red-team analysis, enabling AI governance with zero-trust guardrails for tool calls, data access, and compliance frameworks.
      5
      3
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI-powered, zero-trust code review with multiple models, supporting single files, git diffs, and multiple files, with security, performance, and architecture checks across 10+ languages.
      15
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI-powered code review and improvement, including analysis, refactoring suggestions, and automatic test generation, with an optional agentic loop for iterative refinement.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to analyze AWS IAM policies and CloudFormation templates for security risks.
      2
      43 npm
      MIT