codeviewer-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@codeviewer-mcpreview this new function I added to utils.js"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
codeviewer-mcp
codeviewer-mcp is a TypeScript MCP server for stateful, AST-aware code review workflows.
It runs over STDIO and is designed for MCP clients and LLM harnesses that can launch local MCP servers.
What this server provides
MCP tools for iterative plan registration and code-chunk review
SQLite-backed review sessions and history
AST indexing/context localization for JS/TS source trees
Preflight checks (TypeScript diagnostics + security pattern detection)
Structured review output with verdicts, categorized feedback, and optional patch hints
MCP tools
register_planreview_code_chunkcleanup_expired_sessionscleanup_sessionlist_sessionslist_indexing_errorslist_prompt_profilesget_prompt_profilehealth_check
Prerequisites
These prerequisites are required for this MCP to install and run correctly.
Requirement | Why it is needed |
Node.js 20+ | Runtime for server and MCP SDK |
pnpm 9+ | Dependency install and build workflow |
Git | Clone/update repository for auto-install flows |
Native build toolchain | Required by |
Native build toolchain by OS:
Windows: Visual Studio Build Tools 2022 (Desktop development with C++) + Python 3
macOS: Xcode Command Line Tools (
xcode-select --install)Linux (Debian/Ubuntu):
build-essential python3 make g++
If native builds are missing, pnpm install can fail while compiling better-sqlite3.
Quick start
git clone https://github.com/Master0fFate/codeviewer-mcp.git
cd codeviewer-mcp
pnpm install
pnpm build
pnpm startDevelopment mode:
pnpm devEnvironment variables
Variable | Description | Default |
| Project root for AST indexing and path containment checks | Current working directory |
| SQLite database path |
|
| Directory containing |
|
| Default prompt profile ID used when |
|
| Session TTL in hours, positive integer only |
|
| Optional bearer token for shared environments. If set, every tool call must include | unset |
| Cleanup expired sessions on process start ( |
|
| Log level ( |
|
Example:
MCP_PROJECT_PATH=/absolute/path/to/repo \
MCP_SESSION_TTL_HOURS=24 \
LOG_LEVEL=info \
node dist/index.jsAuthentication example when MCP_AUTH_TOKEN is set:
{
"session_id": "11111111-1111-1111-1111-111111111111",
"plan_step": 1,
"target_file": "src/example.ts",
"code_chunk": "export const ok = true;",
"modification_type": "MODIFY",
"auth_token": "your-shared-secret"
}Prompt profile workflow (compartmentalized prompts)
This MCP now supports session-level prompt compartmentalization from the prompts folder.
Add prompt files as
*.mdin the prompts directory.Profile ID is the filename without extension.
Example:
prompts/cybersec.md->prompt_profile: "cybersec"
Start a session with
register_planand optionalprompt_profile.The selected profile is persisted on the session and reused for every
review_code_chunkcall in that session.review_code_chunkoutput includes:active_prompt_profileactive_prompt_titleactive_prompt_headings
Use helper tools:
list_prompt_profilesto see available profiles.get_prompt_profileto read full prompt content for a profile.
Example register_plan payload with specialization profile:
{
"project_path": "/absolute/path/to/repo",
"prompt_profile": "cybersec",
"steps": [
"Review auth and secrets handling",
"Check unsafe execution paths"
]
}LLM auto-install guide
This section is written for autonomous LLM installers and MCP harnesses.
Canonical server launch
node /absolute/path/to/codeviewer-mcp/dist/index.jsIdempotent install/update (bash)
set -euo pipefail
INSTALL_ROOT="${HOME}/mcp-servers"
SERVER_DIR="${INSTALL_ROOT}/codeviewer-mcp"
mkdir -p "${INSTALL_ROOT}"
if [ ! -d "${SERVER_DIR}/.git" ]; then
git clone https://github.com/Master0fFate/codeviewer-mcp.git "${SERVER_DIR}"
else
git -C "${SERVER_DIR}" pull --ff-only
fi
cd "${SERVER_DIR}"
pnpm install
pnpm buildIdempotent install/update (PowerShell)
$InstallRoot = Join-Path $HOME "mcp-servers"
$ServerDir = Join-Path $InstallRoot "codeviewer-mcp"
New-Item -ItemType Directory -Path $InstallRoot -Force | Out-Null
if (-not (Test-Path (Join-Path $ServerDir ".git"))) {
git clone https://github.com/Master0fFate/codeviewer-mcp.git $ServerDir
} else {
git -C $ServerDir pull --ff-only
}
Set-Location $ServerDir
pnpm install
pnpm buildHarness installation (Claude Code, VS Code Copilot, OpenCode, generic MCP)
Use the same STDIO launch values in every harness.
Canonical server block:
{
"name": "codeviewer-mcp",
"transport": "stdio",
"command": "node",
"args": ["/absolute/path/to/codeviewer-mcp/dist/index.js"],
"env": {
"MCP_PROJECT_PATH": "/absolute/path/to/target/repo",
"MCP_REVIEWER_DB_PATH": "/absolute/path/to/target/repo/.codeviewer-mcp.sqlite",
"LOG_LEVEL": "info"
}
}Claude Code / Claude Desktop
Open Claude MCP config.
Add
codeviewer-mcpundermcpServerswith the canonical command/args/env values.Restart Claude.
Verify tools are discoverable.
Example:
{
"mcpServers": {
"codeviewer-mcp": {
"command": "node",
"args": ["/absolute/path/to/codeviewer-mcp/dist/index.js"],
"env": {
"MCP_PROJECT_PATH": "/absolute/path/to/repo"
}
}
}
}VS Code Copilot (MCP)
Open VS Code MCP server management (UI or JSON settings, depending on version).
Register a local STDIO MCP server named
codeviewer-mcp.Set command
node, point args to builtdist/index.js, and setMCP_PROJECT_PATH.Reload VS Code window if required by your extension version.
Confirm tool discovery in Copilot Chat MCP tools list.
If your version supports JSON settings, map the canonical server block into your MCP settings schema.
OpenCode
Open OpenCode MCP configuration.
Add a local STDIO server named
codeviewer-mcp.Use
node+ builtdist/index.js.Set
MCP_PROJECT_PATHand optional DB/log env vars.Restart OpenCode and verify tools appear.
Generic MCP clients
Any client that supports local STDIO MCP servers can use the canonical block above. If field names differ, map the same values into your client schema.
Verification checklist
Server starts without process errors
Client reports MCP connection established
Tools visible:
register_plan,review_code_chunk,cleanup_expired_sessions,cleanup_session,list_sessions,list_indexing_errors,list_prompt_profiles,get_prompt_profile,health_checkregister_planreturns a validsession_idreview_code_chunkreturns structured verdict outputhealth_checkreports healthy database/session status
Development and validation
pnpm test
pnpm buildSecurity notes
Path containment checks prevent escaping the configured project root, including symlink-based escapes.
Authentication is optional (
MCP_AUTH_TOKEN) and should be enabled in shared environments.Sessions expire automatically based on
MCP_SESSION_TTL_HOURS.SQLite is configured with WAL mode and foreign keys enabled.
Repository layout
/src/index.ts- Process entrypoint and STDIO transport/src/server.ts- MCP server and tool registration/src/schemas.ts- Zod tool contract schemas/src/state.ts- SQLite state store and session lifecycle/src/ast.ts- AST indexing and context localization/src/preflight.ts- Static preflight checks/src/reviewer.ts- Review decision and output shaping/src/logger.ts- Structured logging/tests- Vitest test suite
License
GNU v3
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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/Master0fFate/codeviewer-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server