Mooncore.Dev.Plug (mooncore v0.2.5)

Copy Markdown

Development dashboard and MCP server plug.

Runs on a dedicated port (default 4040), separate from the main app. Provides:

  • HTML dashboard with MCP tools, log viewer, and IEx console
  • Standard MCP protocol endpoint (JSON-RPC 2.0 over Streamable HTTP)
  • JSON API endpoints for MCP operations

Only active when config :mooncore, mooncore_dev_tools: true AND MOONCORE_DEV_SECRET is set. Automatically started on the configured mcp_port (default: 4040).

Configuration

config :mooncore,
  mooncore_dev_tools: true,
  mcp_port: 4040,                # default
  dev_tools_allowed_ips: [        # optional IP allowlist
    "127.0.0.1",
    "::1",
    "10.0.0.0/8"
  ],
  oauth_redirect_uris: [          # optional extra OAuth redirect URI allowlist
    "https://myapp.example.com/callback"
  ]

Summary

Functions

Callback implementation for Plug.call/2.

IP allowlist check for dev tools.

Callback implementation for Plug.init/1.

Functions

call(conn, opts)

Callback implementation for Plug.call/2.

check_dev_ip(conn, opts)

IP allowlist check for dev tools.

If dev_tools_allowed_ips is configured, only requests from allowed IPs pass through. CIDR ranges (e.g. "10.0.0.0/8") are supported. If the config is nil or empty, all IPs are allowed (backwards compatible).

init(opts)

Callback implementation for Plug.init/1.