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

Function cbm_junie_mcp_preflight

src/cli/cli.c:3757–3791  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3755/* ── Junie MCP config (JSON, same mcpServers format) ──────────── */
3756
3757static int cbm_junie_mcp_preflight(const char *binary_path, const char *config_path) {
3758 static const char *const path[] = {"mcpServers"};
3759 static const struct {
3760 const char *name;
3761 const char *argument;
3762 } entries[] = {
3763 {CBM_DEFAULT_MCP_SERVER_NAME, NULL},
3764 {CBM_SCOUT_MCP_SERVER_NAME, CBM_SCOUT_PROFILE_ARGUMENT},
3765 {CBM_ANALYSIS_MCP_SERVER_NAME, CBM_ANALYSIS_PROFILE_ARGUMENT},
3766 };
3767 char *document = NULL;
3768 size_t document_length = 0U;
3769 int read_result = cbm_json_like_read_document(config_path, &document, &document_length);
3770 if (read_result == 1) {
3771 free(document);
3772 return CLI_OK;
3773 }
3774 if (read_result < 0) {
3775 free(document);
3776 return CLI_ERR;
3777 }
3778 int result = CLI_OK;
3779 for (size_t i = 0U; i < sizeof(entries) / sizeof(entries[0]); i++) {
3780 int ownership = cbm_json_mcp_snapshot_ownership(
3781 document, document_length, path, 1U, CBM_JSON_MCP_STANDARD, entries[i].name,
3782 entries[i].argument, binary_path, g_previous_managed_mcp_command);
3783 if (ownership != CBM_JSON_LIKE_OBJECT_MATCH && ownership != CBM_JSON_LIKE_OBJECT_MISSING &&
3784 ownership != CBM_JSON_MCP_OWNERSHIP_STALE) {
3785 result = CLI_ERR;
3786 break;
3787 }
3788 }
3789 free(document);
3790 return result;
3791}
3792
3793int cbm_upsert_junie_mcp(const char *binary_path, const char *config_path) {
3794 static const char *const path[] = {"mcpServers"};

Callers 1

cbm_upsert_junie_mcpFunction · 0.85

Calls 2

Tested by

no test coverage detected