@codacy/codacy-mcp 0.3.8 → 0.3.9
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.
package/dist/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
4
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
5
|
import { OpenAPI } from './src/api/client/index.js';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import * as Tools from './src/tools/index.js';
|
|
7
|
+
import * as Handlers from './src/handlers/index.js';
|
|
8
8
|
import { validateOrganization } from './src/middleware/validation.js';
|
|
9
9
|
OpenAPI.BASE = 'https://app.codacy.com/api/v3';
|
|
10
10
|
OpenAPI.HEADERS = {
|
|
@@ -48,68 +48,77 @@ const server = new Server({
|
|
|
48
48
|
});
|
|
49
49
|
const toolDefinitions = {
|
|
50
50
|
codacy_list_organization_repositories: {
|
|
51
|
-
tool: listOrganizationRepositoriesTool,
|
|
52
|
-
handler: listOrganizationRepositoriesHandler,
|
|
51
|
+
tool: Tools.listOrganizationRepositoriesTool,
|
|
52
|
+
handler: Handlers.listOrganizationRepositoriesHandler,
|
|
53
|
+
},
|
|
54
|
+
codacy_list_srm_items: {
|
|
55
|
+
tool: Tools.searchSecurityItemsTool,
|
|
56
|
+
handler: Handlers.searchSecurityItemsHandler,
|
|
53
57
|
},
|
|
54
|
-
codacy_list_srm_items: { tool: searchSecurityItemsTool, handler: searchSecurityItemsHandler },
|
|
55
58
|
codacy_list_repository_issues: {
|
|
56
|
-
tool: searchRepositoryIssuesTool,
|
|
57
|
-
handler: searchRepositoryIssuesHandler,
|
|
59
|
+
tool: Tools.searchRepositoryIssuesTool,
|
|
60
|
+
handler: Handlers.searchRepositoryIssuesHandler,
|
|
58
61
|
},
|
|
59
62
|
codacy_list_repository_pull_requests: {
|
|
60
|
-
tool: listRepositoryPullRequestsTool,
|
|
61
|
-
handler: listRepositoryPullRequestsHandler,
|
|
63
|
+
tool: Tools.listRepositoryPullRequestsTool,
|
|
64
|
+
handler: Handlers.listRepositoryPullRequestsHandler,
|
|
65
|
+
},
|
|
66
|
+
codacy_list_files: { tool: Tools.listFilesTool, handler: Handlers.listFilesHandler },
|
|
67
|
+
codacy_get_file_issues: {
|
|
68
|
+
tool: Tools.listFileIssuesTool,
|
|
69
|
+
handler: Handlers.getFileIssuesHandler,
|
|
70
|
+
},
|
|
71
|
+
codacy_get_file_coverage: {
|
|
72
|
+
tool: Tools.getFileCoverageTool,
|
|
73
|
+
handler: Handlers.getFileCoverageHandler,
|
|
62
74
|
},
|
|
63
|
-
codacy_list_files: { tool: listFilesTool, handler: listFilesHandler },
|
|
64
|
-
codacy_get_file_issues: { tool: listFileIssuesTool, handler: getFileIssuesHandler },
|
|
65
|
-
codacy_get_file_coverage: { tool: getFileCoverageTool, handler: getFileCoverageHandler },
|
|
66
75
|
codacy_get_repository_pull_request_files_coverage: {
|
|
67
|
-
tool: getRepositoryPullRequestFilesCoverageTool,
|
|
68
|
-
handler: getRepositoryPullRequestFilesCoverageHandler,
|
|
76
|
+
tool: Tools.getRepositoryPullRequestFilesCoverageTool,
|
|
77
|
+
handler: Handlers.getRepositoryPullRequestFilesCoverageHandler,
|
|
69
78
|
},
|
|
70
79
|
codacy_get_pull_request_git_diff: {
|
|
71
|
-
tool: getPullRequestGitDiffTool,
|
|
72
|
-
handler: getPullRequestGitDiffHandler,
|
|
80
|
+
tool: Tools.getPullRequestGitDiffTool,
|
|
81
|
+
handler: Handlers.getPullRequestGitDiffHandler,
|
|
73
82
|
},
|
|
74
83
|
codacy_list_pull_request_issues: {
|
|
75
|
-
tool: listPullRequestIssuesTool,
|
|
76
|
-
handler: listPullRequestIssuesHandler,
|
|
84
|
+
tool: Tools.listPullRequestIssuesTool,
|
|
85
|
+
handler: Handlers.listPullRequestIssuesHandler,
|
|
77
86
|
},
|
|
78
87
|
codacy_get_repository_with_analysis: {
|
|
79
|
-
tool: getRepositoryWithAnalysisTool,
|
|
80
|
-
handler: getRepositoryWithAnalysisHandler,
|
|
88
|
+
tool: Tools.getRepositoryWithAnalysisTool,
|
|
89
|
+
handler: Handlers.getRepositoryWithAnalysisHandler,
|
|
81
90
|
},
|
|
82
91
|
codacy_get_file_with_analysis: {
|
|
83
|
-
tool: getFileWithAnalysisTool,
|
|
84
|
-
handler: getFileWithAnalysisHandler,
|
|
92
|
+
tool: Tools.getFileWithAnalysisTool,
|
|
93
|
+
handler: Handlers.getFileWithAnalysisHandler,
|
|
85
94
|
},
|
|
86
95
|
codacy_get_repository_pull_request: {
|
|
87
|
-
tool: getRepositoryPullRequestTool,
|
|
88
|
-
handler: getRepositoryPullRequestHandler,
|
|
96
|
+
tool: Tools.getRepositoryPullRequestTool,
|
|
97
|
+
handler: Handlers.getRepositoryPullRequestHandler,
|
|
89
98
|
},
|
|
90
99
|
codacy_get_issue: {
|
|
91
|
-
tool: getIssueTool,
|
|
92
|
-
handler: getIssueHandler,
|
|
100
|
+
tool: Tools.getIssueTool,
|
|
101
|
+
handler: Handlers.getIssueHandler,
|
|
93
102
|
},
|
|
94
103
|
codacy_get_pattern: {
|
|
95
|
-
tool: getPatternTool,
|
|
96
|
-
handler: getPatternHandler,
|
|
104
|
+
tool: Tools.getPatternTool,
|
|
105
|
+
handler: Handlers.getPatternHandler,
|
|
97
106
|
},
|
|
98
107
|
codacy_list_repository_tool_patterns: {
|
|
99
|
-
tool: listRepositoryToolPatternsTool,
|
|
100
|
-
handler: listRepositoryToolPatternsHandler,
|
|
108
|
+
tool: Tools.listRepositoryToolPatternsTool,
|
|
109
|
+
handler: Handlers.listRepositoryToolPatternsHandler,
|
|
101
110
|
},
|
|
102
111
|
codacy_list_tools: {
|
|
103
|
-
tool: listToolsTool,
|
|
104
|
-
handler: listToolsHandler,
|
|
112
|
+
tool: Tools.listToolsTool,
|
|
113
|
+
handler: Handlers.listToolsHandler,
|
|
105
114
|
},
|
|
106
115
|
codacy_list_repository_tools: {
|
|
107
|
-
tool: listRepositoryToolsTool,
|
|
108
|
-
handler: listRepositoryToolsHandler,
|
|
116
|
+
tool: Tools.listRepositoryToolsTool,
|
|
117
|
+
handler: Handlers.listRepositoryToolsHandler,
|
|
109
118
|
},
|
|
110
119
|
codacy_list_organization: {
|
|
111
|
-
tool: listOrganizationsTool,
|
|
112
|
-
handler: listOrganizationsHandler,
|
|
120
|
+
tool: Tools.listOrganizationsTool,
|
|
121
|
+
handler: Handlers.listOrganizationsHandler,
|
|
113
122
|
},
|
|
114
123
|
};
|
|
115
124
|
// Register tools
|
package/dist/src/tools/utils.js
CHANGED
|
@@ -157,8 +157,8 @@ export const extractOrganizationFromUrl = (url) => {
|
|
|
157
157
|
/https:\/\/bitbucket\.org\/([^/]+)\/[^/]+\.git$/,
|
|
158
158
|
];
|
|
159
159
|
for (const pattern of patterns) {
|
|
160
|
-
const match =
|
|
161
|
-
if (match
|
|
160
|
+
const match = pattern.exec(url);
|
|
161
|
+
if (match?.[1]) {
|
|
162
162
|
return match[1];
|
|
163
163
|
}
|
|
164
164
|
}
|