iagctl mcp server add

Gateway 5.5+

Register an MCP server.

Use this command to register an external MCP (Model Context Protocol) server with Itential Gateway. After registration, Itential Gateway connects to the server, discovers the tools it exposes, and surfaces them in Gateway Manager as native gateway services.

For more information, see Register and manage MCP servers.

Syntax

$iagctl mcp server add <name> <command_or_url> [flags]

Transport auto-detection

If you omit the --transport flag, Itential Gateway detects the transport type automatically:

  • Arguments beginning with http use streamable-http transport.
  • All other arguments use stdio transport.

Use --transport to set the transport explicitly when auto-detection would produce the wrong result.

Secret references

The <command_or_url> argument and the --env and --header flag values support Go template syntax. Use {{ secret "name" }} to reference a secret stored in Itential Gateway’s secret store instead of providing a sensitive value as plain text.

$--env API_KEY={{ secret "my-api-key" }}
$--header Authorization=Bearer {{ secret "my-token" }}

Examples

Register a stdio MCP server

$iagctl mcp server add my-server "npx -y @modelcontextprotocol/server-filesystem /tmp"

Register an HTTP MCP server

$iagctl mcp server add my-api-server https://mcp.example.com

Register a stdio server with environment variables and tags

$iagctl mcp server add data-processor "python /opt/mcp/processor.py" \
> --description "Data processing MCP server" \
> --tag production \
> --tag data \
> --env DB_HOST=localhost \
> --env DB_PASSWORD={{ secret "db-password" }}

Register a Context7 MCP server

$iagctl mcp server add context7 https://mcp.context7.com/mcp

Register an HTTP server with custom headers

$iagctl mcp server add secure-api https://mcp.internal.example.com \
> --transport streamable-http \
> --description "Internal API gateway" \
> --header Authorization=Bearer {{ secret "api-token" }} \
> --tag internal

Options

$ --description string A brief description of the MCP server
$ --env stringArray Environment variable to set for the server process, in KEY=VALUE format.
$ stdio transport only. Repeatable. Supports {{ secret "name" }} templates.
$ --header stringArray Custom HTTP header to send to the server, in KEY=VALUE format.
$ HTTP transports only. Repeatable. Supports {{ secret "name" }} templates.
$ -h, --help Help for add
$ --tag stringArray Metadata tag to associate with the server. Repeatable.
$ --transport string Transport type: stdio, streamable-http, or sse.
$ Auto-detected from <command_or_url> if omitted.

Options inherited from parent commands

$ --config string Path to the configuration file
$ --profile string Specify the client profile to use (case-insensitive, defaults to [client] section)
$ --raw Display the result of the command in raw format
$ --verbose Enable verbose output