Noizu.MCP.Inspector (Noizu MCP v0.1.2)

Copy Markdown View Source

Interactive HTML inspector for MCP servers — the engine behind mix mcp.client. Starts a localhost-only Bandit endpoint serving a single-page UI plus a JSON/SSE bridge to Noizu.MCP.Client sessions.

{:ok, _} =
  Noizu.MCP.Inspector.start_link(
    target: {:module, MyApp.MCP},
    port: 6274,
    token: token)

Targets:

  • {:module, server_module} — in-process connection to a use Noizu.MCP.Server module in this VM
  • {:stdio, command, opts} — spawn a subprocess (opts: :args, :env, :cd)
  • {:url, url, opts} — remote Streamable HTTP server (opts: :bearer, :headers)

Requires the optional :bandit and :plug dependencies.

Summary

Functions

Returns a specification to start this module under a supervisor.

MCP server modules loadable in this VM: modules exporting __mcp__/1 from applications that depend on :noizu_mcp (candidates for in-process targets).

Look up a live session pid.

The bound HTTP port (useful with port: 0).

Resolve a target tuple (or a JSON descriptor map from the browser) into {:ok, {transport_module, opts}, descriptor_map}.

Options: :token (required — bearer token every API call must present), :target (optional — without it the browser UI prompts for one), :port (default 6274; 0 for a random port), :name, :client_info.

Start a session against target (nil uses the configured default).

The browser URL (without token).

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

discover_servers()

MCP server modules loadable in this VM: modules exporting __mcp__/1 from applications that depend on :noizu_mcp (candidates for in-process targets).

lookup_session(config, session_id)

Look up a live session pid.

port(inspector \\ __MODULE__)

The bound HTTP port (useful with port: 0).

resolve_target(descriptor)

Resolve a target tuple (or a JSON descriptor map from the browser) into {:ok, {transport_module, opts}, descriptor_map}.

start_link(opts)

Options: :token (required — bearer token every API call must present), :target (optional — without it the browser UI prompts for one), :port (default 6274; 0 for a random port), :name, :client_info.

start_session(config, target \\ nil)

Start a session against target (nil uses the configured default).

url(inspector \\ __MODULE__)

The browser URL (without token).