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

Function cbm_mcp_server_new

src/mcp/mcp.c:1595–1616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1593};
1594
1595cbm_mcp_server_t *cbm_mcp_server_new(const char *store_path) {
1596 cbm_mcp_server_t *srv = calloc(CBM_ALLOC_ONE, sizeof(*srv));
1597 if (!srv) {
1598 return NULL;
1599 }
1600 cbm_mutex_init(&srv->request_scope_mutex);
1601 atomic_init(&srv->pipeline_cancel_requested, 0);
1602
1603 /* If a store_path is given, open that project directly.
1604 * Otherwise, create an in-memory store for test/embedded use. */
1605 if (store_path) {
1606 srv->store = cbm_store_open(store_path);
1607 srv->current_project = heap_strdup(store_path);
1608 } else {
1609 srv->store = cbm_store_open_memory();
1610 }
1611 srv->owns_store = true;
1612 srv->tool_profile = CBM_MCP_TOOL_PROFILE_ALL;
1613 srv->background_tasks = true;
1614
1615 return srv;
1616}
1617
1618void cbm_mcp_server_set_tool_profile(cbm_mcp_server_t *srv, cbm_mcp_tool_profile_t profile) {
1619 if (srv) {

Callers 15

run_cliFunction · 0.85
cbm_cmd_hook_augmentFunction · 0.85
cbm_http_server_newFunction · 0.85
application_session_openFunction · 0.85
test_cli.cFile · 0.85
gpf_open_indexedFunction · 0.85
ri_index_captureFunction · 0.85
gpg_open_indexedFunction · 0.85
es_lang_open_indexedFunction · 0.85
gpe_open_indexedFunction · 0.85

Calls 4

cbm_mutex_initFunction · 0.85
cbm_store_openFunction · 0.85
cbm_store_open_memoryFunction · 0.85
heap_strdupFunction · 0.70

Tested by 15

gpf_open_indexedFunction · 0.68
ri_index_captureFunction · 0.68
gpg_open_indexedFunction · 0.68
es_lang_open_indexedFunction · 0.68
gpe_open_indexedFunction · 0.68
gpa_open_indexedFunction · 0.68
et_index_filesFunction · 0.68
setup_mcp_with_dataFunction · 0.68
setup_prefilter_serverFunction · 0.68
setup_snippet_serverFunction · 0.68