@codacy/codacy-mcp 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,15 @@
1
1
  import util from 'util';
2
2
  import { exec as execChildProcess } from 'child_process';
3
- import { allowedTools } from '../tools/cliAnalyzeTool.js';
4
3
  const exec = util.promisify(execChildProcess);
5
4
  // Safeguard: Validate and sanitize command inputs
6
5
  const sanitizeCommand = (command) => {
7
6
  // Remove any shell metacharacters
8
7
  return command?.replace(/[;&|`$]/g, '') || '';
9
8
  };
10
- // Safeguard: Validate tool name
11
- const validateTool = (tool) => {
12
- if (!allowedTools.includes(tool)) {
13
- throw new Error(`Invalid tool: ${tool}. Allowed tools are: ${allowedTools.join(', ')}`);
14
- }
15
- return tool;
16
- };
17
9
  export const cliAnalyzeHandler = async (args) => {
18
10
  try {
19
- const safeTool = validateTool(args.tool);
20
11
  const safeFile = sanitizeCommand(args.file);
21
- const command = `codacy-cli analyze --tool ${safeTool} --format sarif ${safeFile}`;
12
+ const command = `codacy-cli analyze --format sarif ${safeFile}`;
22
13
  // Add options object with cwd and increased maxBuffer
23
14
  const options = {
24
15
  cwd: args.rootPath,
@@ -1,5 +1,4 @@
1
1
  import { toolNames } from '../schemas.js';
2
- export const allowedTools = ['eslint'];
3
2
  export const cliAnalyzeTool = {
4
3
  name: toolNames.CODACY_CLI_ANALYZE,
5
4
  description: 'Run quality analysis using Codacy CLI. Requires the Codacy CLI to be installed and configured.',
@@ -10,10 +9,6 @@ export const cliAnalyzeTool = {
10
9
  type: 'string',
11
10
  description: 'Required. Root path to the project or repository in the local filesystem. This must be filled to ensure permissions are met for the tool to run.',
12
11
  },
13
- tool: {
14
- type: 'string',
15
- description: `Required. Tool to use for analysis (e.g., eslint). Possible values: ${allowedTools.join(', ')}.`,
16
- },
17
12
  file: {
18
13
  type: 'string',
19
14
  description: 'Optional. Absolute path to the file to analyze, or pattern to match files (e.g., "src/**/*.js"). If left empty, the analysis will be executed for the whole project.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/codacy-mcp",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "Codacy MCP server",
5
5
  "license": "MIT",
6
6
  "author": "Codacy",