Ectomancer.Installer.TemplateRenderer (Ectomancer v1.2.1)

Copy Markdown View Source

Renders EEx templates for Ectomancer setup files.

Generates:

  • MCP module with exposed schemas
  • Config entry snippets
  • Router route snippets

Summary

Functions

Generates config entry for Ectomancer.

Generates MCP module with exposed schemas.

Generates complete MCP module content with default namespace and no oban.

Generates router route for Ectomancer.

Functions

generate_config_entry(opts \\ [])

@spec generate_config_entry(keyword()) :: String.t()

Generates config entry for Ectomancer.

generate_mcp_module(opts \\ [])

@spec generate_mcp_module(keyword()) :: {:ok, String.t()} | :not_modified | :error

Generates MCP module with exposed schemas.

Arguments

  • opts - Keyword list with options:
    • :schemas - List of schema info maps
    • :mcp_name - MCP server name (default: "my-app-mcp")
    • :mcp_version - MCP server version (default: "1.0.0")
    • :namespace - Tool namespace (default: nil)
    • :include_oban - Whether to include Oban bridge
    • :output_path - Where to save the file
    • :module_name - Module name for the generated MCP module (default: "MyApp.MCP")

Returns

Tuple with status and generated content: {:ok, content} | :not_modified | :error

generate_mcp_module_content(schemas, mcp_name, mcp_version)

@spec generate_mcp_module_content([map()], String.t(), String.t()) :: String.t()

Generates complete MCP module content with default namespace and no oban.

generate_mcp_module_content(schemas, mcp_name, mcp_version, namespace, include_oban, opts \\ [])

@spec generate_mcp_module_content(
  [map()],
  String.t(),
  String.t(),
  String.t() | nil,
  boolean(),
  keyword()
) :: String.t()

Generates complete MCP module content.

generate_router_entry(opts \\ [])

@spec generate_router_entry(keyword()) :: String.t()

Generates router route for Ectomancer.