@baidusecurity/code-security
v1.1.2
Published
Baidu code security MCP server
Readme
Baidu Code Security MCP Server
Tools
scan_vulnerability
Description: Scan for vulnerabilities in the code.
Input: project root directory
Example:
{
"rootPath": "/path/to/your/project"
}Output: SARIF report
Example:
{
"$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
"version": "2.1.0",
"runs": [
{
"tool": {},
"artifacts": [],
"results": []
}
]
}repair_vulnerability
Description: Repair for vulnerabilities in the code.
Input: Project root directory and file vulnerability information
Example:
{
"rootPath": "/path/to/your/project",
"file_vulnerability_info": {
"files": [
{
"name": "pom.xml",
"hash": "29f05d536fae4b4840e958d6429c4c09edc7d100616b07952f0781c8768f715b",
"vulList": [
{
"ruleID": "codescan_java_fastjson_CVE-2022-25845",
"line": 125,
"hash": "b05607be1cf39a52e006784311045b1e"
}
]
}
],
"type": 1
}
}Output: repaired code
Example:
{
"status": 3,
"data": {
"taskID": "588987a8-4b7e-4dc9-9947-aa57d0e90405",
"progress": 120,
"missingFiles": null,
"files": [
{
"name": "pom.xml",
"status": 3,
"language": "xml",
"hash": "3c71317d6b514a6fa3e2ff50df5cfbacf3419c693a10f46914bf811ab2ed3a54",
"type": 0,
"repairedContent": "",
"diff_content": "{\n \"from_content\": \" <version>1.2.80</version>\n\",\n \"to_content\": \" <version>1.2.83</version>\n\"\n}"
}
]
},
"message": "repair success"
}