Skip to content

MCP API Reference

Complete reference for the Aichaku MCP (Model Context Protocol) server API, including all available tools, parameters, and configuration options.

The Aichaku MCP server provides three tools to Claude Code:

Reviews a single file for security vulnerabilities, standards compliance, and code quality issues.

ParameterTypeRequiredDefaultDescription
filestringYes-Path to the file to review
contentstringNo-File content (if not provided, reads from disk)
includeExternalbooleanNotrueInclude external security scanners if available
// Basic file review
(await mcp**aichaku) -
reviewer**review_file({
file: "/path/to/src/auth.ts",
});
// Review with content (useful for unsaved files)
(await mcp**aichaku) -
reviewer**review_file({
file: "untitled.js",
content: "const password = 'hardcoded123';",
includeExternal: false,
});
{
success: boolean;
summary: string;
details: {
security: {
critical: number;
high: number;
medium: number;
low: number;
issues: SecurityIssue[];
};
standards: {
violations: StandardViolation[];
suggestions: string[];
};
education: {
lessons: Lesson[];
resources: string[];
};
};
}

Checks if a project follows the specified methodology patterns and practices.

ParameterTypeRequiredDefaultDescription
projectPathstringYes-Path to the project root directory
methodologystringYes-Methodology to check against
  • shape-up - Shape Up (6-week cycles, betting table, etc.)
  • scrum - Scrum (sprints, ceremonies, artifacts)
  • kanban - Kanban (WIP limits, flow metrics)
  • lean - Lean (experiments, validated learning)
  • xp - Extreme Programming (pair programming, TDD)
  • scrumban - Hybrid Scrum/Kanban
// Check Shape Up compliance
(await mcp**aichaku) -
reviewer**review_methodology({
projectPath: "/Users/you/projects/app",
methodology: "shape-up",
});
{
success: boolean;
methodology: string;
compliance: {
score: number; // 0-100
status: "compliant" | "partial" | "non-compliant";
};
findings: {
present: string[]; // Found methodology artifacts
missing: string[]; // Expected but missing artifacts
suggestions: string[]; // Improvements
};
}

Retrieves the currently selected standards for a project.

ParameterTypeRequiredDefaultDescription
projectPathstringYes-Path to the project root directory
// Get project standards
(await mcp**aichaku) -
reviewer**get_standards({
projectPath: "/Users/you/projects/app",
});
{
success: boolean;
standards: {
selected: string[]; // Active standards
available: string[]; // All available standards
version: string; // Configuration version
};
methodologies: string[]; // Detected methodologies
}

Gets usage statistics and analytics for MCP tool usage.

ParameterTypeRequiredDefaultDescription
typestringNo”dashboard”Type of statistics: “dashboard”, “realtime”, “insights”, “export”
questionstringNo-Specific question to answer about usage
formatstringNo”json”Export format (only for type=“export”): “json”, “csv”
// Get dashboard statistics
{
"tool": "get_statistics",
"arguments": {
"type": "dashboard"
}
}
// Ask specific question
{
"tool": "get_statistics",
"arguments": {
"type": "insights",
"question": "What are the most common security issues?"
}
}
{
success: boolean;
type: string;
data: {
// Varies by type
totalReviews?: number;
issuesFound?: number;
topIssues?: Array<{issue: string; count: number}>;
// ... other metrics
};
}

Analyzes project structure, languages, architecture, and dependencies.

ParameterTypeRequiredDefaultDescription
projectPathstringYes-Path to the project directory to analyze
detailedbooleanNotrueInclude detailed analysis of files and components
// Analyze project structure
{
"tool": "analyze_project",
"arguments": {
"projectPath": "/Users/you/projects/app",
"detailed": true
}
}

Generates comprehensive documentation following selected standards.

ParameterTypeRequiredDefaultDescription
projectPathstringYes-Path to the project directory
outputPathstringNoprojectPath/docsOutput path for documentation
standardstringNo”diataxis”Documentation standard: “diataxis”, “google”, “microsoft”, etc.
includeExamplesbooleanNotrueInclude code examples
includeDiagramsbooleanNotrueGenerate architecture diagrams
overwritebooleanNofalseOverwrite existing documentation
autoChainbooleanNotrueRun analyzeproject first and reviewfile after
// Generate documentation with Diátaxis standard
{
"tool": "generate_documentation",
"arguments": {
"projectPath": "/Users/you/projects/app",
"standard": "diataxis",
"includeDiagrams": true
}
}

Creates a documentation template file for tutorials, how-tos, references, etc.

ParameterTypeRequiredDefaultDescription
outputPathstringYes-Path where the template file should be created
templateTypestringYes-Type: “tutorial”, “how-to”, “reference”, “explanation”, etc.
titlestringNo-Title for the document
projectNamestringNo-Name of the project (used in templates)
customFieldsobjectNo{}Custom fields to replace in the template
// Create a tutorial template
{
"tool": "create_doc_template",
"arguments": {
"outputPath": "./docs/tutorials/getting-started.md",
"templateType": "tutorial",
"title": "Getting Started with MyApp",
"projectName": "MyApp"
}
}

The MCP server reads project configuration from .claude/.aichaku-standards.json:

{
"version": "1.0.0",
"selected": ["nist-csf", "owasp-web", "tdd", "conventional-commits"],
"methodologies": ["shape-up"],
"customRules": {
"maxFileSize": 1000,
"requireTests": true
}
}

Global MCP settings can be placed in ~/.aichaku/mcp-config.json:

{
"externalScanners": {
"codeql": {
"enabled": true,
"timeout": 30000
},
"devskim": {
"enabled": true,
"ignoreRules": ["DS123456"]
},
"semgrep": {
"enabled": true,
"config": "auto"
}
},
"performance": {
"maxFileSize": 5242880, // 5MB
"timeout": 60000, // 60 seconds
"parallel": true
}
}

The MCP server includes built-in patterns for detecting:

CategoryPattern Examples
A01: Broken Access ControlMissing auth checks, path traversal
A02: Cryptographic FailuresHardcoded secrets, weak encryption
A03: InjectionSQL injection, command injection, XSS
A04: Insecure DesignSecurity anti-patterns
A05: Security MisconfigurationVerbose errors, default configs
A06: Vulnerable ComponentsOutdated dependencies
A07: Auth FailuresWeak password handling
A08: Software IntegrityUnsigned code, untrusted sources
A09: Logging FailuresSensitive data in logs
A10: SSRFUnvalidated redirects
// Detected patterns:
- eval() and Function() usage
- Unvalidated user input in exec()
- DOM XSS vulnerabilities
- Prototype pollution
- Insecure randomness
# Detected patterns:
- pickle deserialization
- SQL string formatting
- Command injection via subprocess
- Path traversal in file operations
- Weak cryptography usage
// Detected patterns:
- SQL query building
- Command execution
- Path cleaning issues
- Integer overflow
- Race conditions

When CodeQL is available, the MCP server runs:

Terminal window
codeql database analyze --format=sarif-latest

Supports:

  • JavaScript/TypeScript security queries
  • Python security queries
  • Go security queries
  • Custom query packs

When DevSkim is available:

Terminal window
devskim analyze -f sarif -o results.sarif

Features:

  • IDE-focused security rules
  • Low false positive rate
  • Cross-language support

When Semgrep is available:

Terminal window
semgrep --config=auto --json

Benefits:

  • Community rules
  • Custom patterns
  • Fast scanning
{
"success": true,
"summary": "Found 3 security issues (1 critical, 2 medium)",
"details": {
"security": {
"critical": 1,
"high": 0,
"medium": 2,
"low": 0,
"issues": [
{
"severity": "critical",
"type": "command-injection",
"line": 42,
"column": 15,
"message": "User input passed directly to shell command",
"owasp": "A03",
"fix": {
"description": "Use parameterized commands",
"example": "Use execFile() instead of exec()"
}
}
]
}
}
}
{
"success": true,
"summary": "Code violates 2 standards",
"details": {
"standards": {
"violations": [
{
"standard": "tdd",
"rule": "test-first",
"message": "No tests found for auth.ts",
"suggestion": "Create auth.test.ts with test cases"
},
{
"standard": "conventional-commits",
"rule": "commit-format",
"message": "Non-conventional commit message",
"suggestion": "Use format: type(scope): description"
}
]
}
}
}
Error CodeDescriptionSolution
FILE*NOT*FOUNDFile doesn’t existCheck file path
PROJECT*NOT*INITIALIZEDNo .claude directoryRun aichaku init
INVALID_METHODOLOGYUnknown methodologyCheck spelling
SCANNER_TIMEOUTExternal scanner timeoutIncrease timeout or disable
PERMISSION_DENIEDCan’t read fileCheck file permissions
{
"success": false,
"error": {
"code": "FILE*NOT*FOUND",
"message": "Cannot read file: /path/to/file.ts",
"suggestion": "Check that the file exists and is readable"
}
}
  • Default: 5MB per file
  • Configurable in mcp-config.json
  • Large files may timeout

The MCP server implements smart caching:

  • File content cache (5 minute TTL)
  • Standards configuration cache
  • External scanner results cache

When reviewing multiple files:

  • Runs security patterns in parallel
  • External scanners run sequentially
  • Results aggregated asynchronously
VariableDescriptionDefault
AICHAKU*MCP*DEBUGEnable debug loggingfalse
AICHAKU*MCP*TIMEOUTGlobal timeout (ms)60000
AICHAKU*MCP*CACHE_DIRCache directory~/.aichaku/cache
AICHAKU*MCP*NO_EXTERNALDisable external scannersfalse

Debug logs are written to ~/.aichaku/mcp-server/logs/ when debug mode is enabled:

Terminal window
export AICHAKU*MCP*DEBUG=true

Log format:

[2024-07-10T15:30:45Z] [INFO] Starting file review: /path/to/file.ts
[2024-07-10T15:30:45Z] [DEBUG] Loading standards: ["nist-csf", "tdd"]
[2024-07-10T15:30:46Z] [INFO] Review complete: 3 issues found
MCP Server VersionAichaku VersionClaude Code Version
1.0.x1.0.x0.9.x+
1.1.x1.1.x1.0.x+

Always use matching Aichaku and MCP server versions for best results.