Skip to main content
Glama

Codacy MCP Server

Official
by codacy
WinWSLCodacyCli.ts1.37 kB
import { MacCodacyCli } from './MacCodacyCli.js'; export class WinWSLCodacyCli extends MacCodacyCli { constructor(rootPath: string, provider?: string, organization?: string, repository?: string) { const winRootPath = rootPath.startsWith('/mnt/') ? WinWSLCodacyCli.fromWSLPath(rootPath) : rootPath; super(winRootPath, provider, organization, repository); } private static toWSLPath(path: string): string { // Convert Windows path to WSL path // Example: C:\Users\user\project -> /mnt/c/Users/user/project const wslPath = path.replace(/\\/g, '/').replace(/^([a-zA-Z]):/, '/mnt/$1'); return wslPath; } private static fromWSLPath(path: string): string { // Convert WSL path to Windows path // Example: /mnt/c/Users/user/project -> C:\Users\user\project const windowsPath = path.replace(/^\/mnt\/([a-zA-Z])/, '$1:').replace(/\//g, '\\'); return windowsPath; } protected preparePathForExec(path: string): string { // Convert the path to WSL format return WinWSLCodacyCli.toWSLPath(path); } protected async execAsync( command: string, args?: Record<string, string> ): Promise<{ stdout: string; stderr: string }> { return await super.execAsync(`wsl ${command}`, args); } protected getCliCommand(): string { return WinWSLCodacyCli.toWSLPath(super.getCliCommand()); } }

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/codacy/codacy-mcp-server'

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