| 1001 | } |
| 1002 | |
| 1003 | int cbm_remove_vscode_mcp(const char *config_path) { |
| 1004 | if (!config_path) { |
| 1005 | return CLI_ERR; |
| 1006 | } |
| 1007 | |
| 1008 | yyjson_doc *doc = read_json_file(config_path); |
| 1009 | if (!doc) { |
| 1010 | return CLI_ERR; |
| 1011 | } |
| 1012 | |
| 1013 | yyjson_mut_doc *mdoc = yyjson_mut_doc_new(NULL); |
| 1014 | yyjson_mut_val *root = yyjson_val_mut_copy(mdoc, yyjson_doc_get_root(doc)); |
| 1015 | yyjson_doc_free(doc); |
| 1016 | if (!root) { |
| 1017 | yyjson_mut_doc_free(mdoc); |
| 1018 | return CLI_ERR; |
| 1019 | } |
| 1020 | yyjson_mut_doc_set_root(mdoc, root); |
| 1021 | |
| 1022 | yyjson_mut_val *servers = yyjson_mut_obj_get(root, "servers"); |
| 1023 | if (!servers || !yyjson_mut_is_obj(servers)) { |
| 1024 | yyjson_mut_doc_free(mdoc); |
| 1025 | return 0; |
| 1026 | } |
| 1027 | |
| 1028 | yyjson_mut_obj_remove_key(servers, "codebase-memory-mcp"); |
| 1029 | |
| 1030 | int rc = write_json_file(config_path, mdoc); |
| 1031 | yyjson_mut_doc_free(mdoc); |
| 1032 | return rc; |
| 1033 | } |
| 1034 | |
| 1035 | /* ── Zed MCP (context_servers with command + args) ────────────── */ |
| 1036 |
no test coverage detected