MCPcopy Create free account
hub / github.com/dallay/agentsync / format_to_string

Method format_to_string

src/mcp.rs:168–171  ·  view source on GitHub ↗

Format MCP servers into the agent-specific file content. By default this returns pretty JSON for agents that use JSON configs.

(&self, servers: &BTreeMap<&str, &McpServerConfig>)

Source from the content-addressed store, hash-verified

166 /// Format MCP servers into the agent-specific file content.
167 /// By default this returns pretty JSON for agents that use JSON configs.
168 fn format_to_string(&self, servers: &BTreeMap<&str, &McpServerConfig>) -> Result<String> {
169 let output = self.format(servers);
170 serde_json::to_string_pretty(&output).context("Failed to serialize MCP config")
171 }
172
173 /// Parse existing configuration file to extract mcpServers
174 fn parse_existing(&self, content: &str) -> Result<BTreeMap<String, Value>>;

Callers

nothing calls this directly

Implementers 1

mcp.rssrc/mcp.rs

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected