MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / project_root_from_store

Function project_root_from_store

src/mcp/mcp.c:6849–6862  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6847/* ── Helper: get project root_path from store ─────────────────── */
6848
6849static char *project_root_from_store(cbm_store_t *store, const char *project) {
6850 if (!store || !project) {
6851 return NULL;
6852 }
6853 cbm_project_t proj = {0};
6854 if (cbm_store_get_project(store, project, &proj) != CBM_STORE_OK) {
6855 return NULL;
6856 }
6857 char *root = heap_strdup(proj.root_path);
6858 safe_str_free(&proj.name);
6859 safe_str_free(&proj.indexed_at);
6860 safe_str_free(&proj.root_path);
6861 return root;
6862}
6863
6864static char *get_project_root(cbm_mcp_server_t *srv, const char *project) {
6865 return project_root_from_store(resolve_store(srv, project), project);

Callers 2

get_project_rootFunction · 0.85
handle_manage_adrFunction · 0.85

Calls 3

cbm_store_get_projectFunction · 0.85
safe_str_freeFunction · 0.85
heap_strdupFunction · 0.70

Tested by

no test coverage detected