MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / set_mcp_command

Function set_mcp_command

src/agents/plugin_bundle.rs:58–62  ·  view source on GitHub ↗

Point the MCP config's `mcpServers.tracedecay.command` at the resolved binary path, returning pretty-printed JSON with a trailing newline. Claude and Cursor use this directly; Codex layers scope-specific args/env on top.

(raw: &str, bin: &str)

Source from the content-addressed store, hash-verified

56/// binary path, returning pretty-printed JSON with a trailing newline. Claude
57/// and Cursor use this directly; Codex layers scope-specific args/env on top.
58pub(crate) fn set_mcp_command(raw: &str, bin: &str) -> Result<String> {
59 let mut mcp: serde_json::Value = serde_json::from_str(raw)?;
60 mcp["mcpServers"]["tracedecay"]["command"] = serde_json::json!(bin);
61 Ok(format!("{}\n", serde_json::to_string_pretty(&mcp)?))
62}
63
64/// One embedded plugin file: `relative` is its deploy path; `contents` may come
65/// from a different source path in the shared `plugin/` tree.

Callers 2

codex_plugin_mcpFunction · 0.70
cursor_plugin_mcpFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected