@codacy/codacy-mcp 0.6.3 → 0.6.5

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.
@@ -9,6 +9,11 @@ const CLI_LOCAL_COMMAND = `${CLI_FOLDER_NAME}/${CLI_FILE_NAME}`;
9
9
  const CLI_GLOBAL_COMMAND = 'codacy-cli';
10
10
  // Set a larger buffer size (10MB)
11
11
  const MAX_BUFFER_SIZE = 1024 * 1024 * 10;
12
+ // Function to detect if user is on Windows
13
+ const isWindows = () => {
14
+ const isWindows = process.platform === 'win32';
15
+ return isWindows;
16
+ };
12
17
  const execAsync = (command, options) => {
13
18
  return new Promise((resolve, reject) => {
14
19
  exec(`${CODACY_CLI_VERSION ? `CODACY_CLI_V2_VERSION=${CODACY_CLI_VERSION} ` : ''}${command}`, {
@@ -90,6 +95,14 @@ const ensureCodacyCLIExists = async (rootPath, provider, organization, repositor
90
95
  return CLI_LOCAL_COMMAND;
91
96
  };
92
97
  export const cliAnalyzeHandler = async (args) => {
98
+ if (isWindows()) {
99
+ // If the user is on Windows return an error message
100
+ return {
101
+ success: false,
102
+ errorType: 'cli-unsupported-os',
103
+ output: 'Codacy CLI is only available on Windows via WSL (Windows Subsystem for Linux).',
104
+ };
105
+ }
93
106
  try {
94
107
  // Ensure codacy-cli is installed
95
108
  const cliCommand = await ensureCodacyCLIExists(args.rootPath, args.provider, args.organization, args.repository);
@@ -5,6 +5,9 @@ export const searchSecurityItemsHandler = async (args) => {
5
5
  };
6
6
  export const searchRepositorySecurityItemsHandler = async (args) => {
7
7
  const { provider, organization, repository, cursor, limit, sort, direction, options } = args;
8
- options.repositories = [repository];
9
- return await SecurityService.searchSecurityItems(provider, organization, cursor, limit, sort, direction, options);
8
+ const optionsWithRepositories = {
9
+ ...options,
10
+ repositories: [repository],
11
+ };
12
+ return await SecurityService.searchSecurityItems(provider, organization, cursor, limit, sort, direction, optionsWithRepositories);
10
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/codacy-mcp",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "description": "Codacy MCP server",
5
5
  "license": "MIT",
6
6
  "author": "Codacy",