Adapter from plugin MCP declarations to dcode MCP config dictionaries.
Normalize a decoded value to a JSON object.
Normalize a decoded value to the supported JSON type.
Build environment variables exposed to plugin subprocesses.
Substitute plugin variables throughout a JSON-compatible value.
Namespace a plugin-declared MCP server's name under its plugin id.
Plugin identifiers may contain characters rejected by dcode's MCP loader.
Use __ as the namespace separator so names stay unique and valid.
List plugin MCP servers as (label, scoped_name, needs_login) tuples.
label is the unscoped name from the plugin config (for UI). scoped_name
is what dcode registers after namespacing.
Return scoped MCP server names without preparing plugin runtime state.
Discover enabled plugins and compose their MCP config layers.
Build MCP config layers for enabled plugins.
Default .mcp.json files are loaded before manifest mcpServers, so manifest
entries win on server-name conflicts.
A discovered plugin ready to feed dcode adapters.