Skip to main content

Claude Tools API

The Claude MCP server exposes three tools. All tools are registered under the claude_reviewer server name (configurable in your .mcp.json).

review

Send code, plans, or diffs for structured review.

Parameters

ParameterTypeRequiredDescription
contentstringYesThe content to review (max 500KB)
contextstringNoAdditional context for the reviewer

Response

interface ReviewResult {
verdict: "APPROVED" | "NEEDS_REVISION";
issues: ReviewIssue[];
suggestions: string[];
}

interface ReviewIssue {
severity: "critical" | "major" | "minor";
description: string;
recommendation: string;
}

Example

Input:

{
"content": "function login(user, pass) {\n const query = `SELECT * FROM users WHERE name='${user}' AND pass='${pass}'`;\n return db.exec(query);\n}",
"context": "Authentication module for the web API"
}

Output:

{
"verdict": "NEEDS_REVISION",
"issues": [
{
"severity": "critical",
"description": "SQL injection vulnerability via string interpolation",
"recommendation": "Use parameterized queries: db.prepare('SELECT * FROM users WHERE name=? AND pass=?').get(user, pass)"
}
],
"suggestions": [
"Hash passwords instead of storing/comparing plaintext",
"Add rate limiting to prevent brute-force attacks"
]
}

ask

Ask Claude a freeform question about code.

Parameters

ParameterTypeRequiredDescription
questionstringYesThe question to ask (max 500KB)
cwdstringNoWorking directory for file access

Response

Plain text string with Claude's response.

Example

Input:

{
"question": "What design pattern does the server-factory.ts module use?",
"cwd": "/path/to/project"
}

Output:

"The server-factory.ts module uses the Factory pattern. The createServer() function
acts as a factory that takes a ServerConfig object and returns a configured McpServer
instance. This centralizes server creation logic and ensures consistent configuration
across all three bridge servers (Claude, Codex, Copilot)."

code_review

Specialized tool for reviewing git diffs.

Parameters

ParameterTypeRequiredDescription
diffstringYesThe git diff to review (max 500KB)
contextstringNoAdditional context for the review

Response

Same ReviewResult structure as the review tool.

Example

Input:

{
"diff": "diff --git a/src/auth.ts b/src/auth.ts\n--- a/src/auth.ts\n+++ b/src/auth.ts\n@@ -10,6 +10,7 @@\n+ if (!token) return null;\n const decoded = jwt.verify(token, SECRET);",
"context": "Adding null check for missing auth tokens"
}