| 1734 | } |
| 1735 | |
| 1736 | int cbm_remove_opencode_mcp(const char *config_path) { |
| 1737 | if (!config_path) { |
| 1738 | return CLI_ERR; |
| 1739 | } |
| 1740 | |
| 1741 | yyjson_doc *doc = read_json_file(config_path); |
| 1742 | if (!doc) { |
| 1743 | return CLI_ERR; |
| 1744 | } |
| 1745 | |
| 1746 | yyjson_mut_doc *mdoc = yyjson_mut_doc_new(NULL); |
| 1747 | yyjson_mut_val *root = yyjson_val_mut_copy(mdoc, yyjson_doc_get_root(doc)); |
| 1748 | yyjson_doc_free(doc); |
| 1749 | if (!root) { |
| 1750 | yyjson_mut_doc_free(mdoc); |
| 1751 | return CLI_ERR; |
| 1752 | } |
| 1753 | yyjson_mut_doc_set_root(mdoc, root); |
| 1754 | |
| 1755 | yyjson_mut_val *mcp = yyjson_mut_obj_get(root, "mcp"); |
| 1756 | if (!mcp || !yyjson_mut_is_obj(mcp)) { |
| 1757 | yyjson_mut_doc_free(mdoc); |
| 1758 | return 0; |
| 1759 | } |
| 1760 | |
| 1761 | yyjson_mut_obj_remove_key(mcp, "codebase-memory-mcp"); |
| 1762 | |
| 1763 | int rc = write_json_file(config_path, mdoc); |
| 1764 | yyjson_mut_doc_free(mdoc); |
| 1765 | return rc; |
| 1766 | } |
| 1767 | |
| 1768 | /* ── Antigravity MCP config (JSON, same mcpServers format) ────── */ |
| 1769 |
nothing calls this directly
no test coverage detected