{# Add a server, step 1 (spec ยง7.1): a URL, a name, and two credentials. Submitting this fetches and parses the document and stores nothing at all. The operator sees what they are about to register on the next page, and only then does anything reach the database. An ordinary form with an ordinary POST. htmx is on the page, and this is not the place for it: a submission here makes a network call to somebody else's server, and the honest way to show that is a page that navigates. #} {% extends "base.html" %} {% from "partials/field.html" import field, choice %} {% from "partials/credential_fields.html" import credential_fields %} {% block title %}Add a server · mcp-api-gateway{% endblock %} {% block scripts %} {% endblock %} {% block content %}

Add a server

The gateway downloads the document, reads every operation out of it, and shows you what it found. Nothing is saved until you say so.

{{ field("spec_url", "Spec URL", value=fields.spec_url, required=true, hint="Where the OpenAPI or Swagger document is served from.", error=errors.get("spec_url")) }} {{ field("name", "Display name", value=fields.name, hint="Optional. Defaults to the title the document gives itself.", error=errors.get("name")) }} {{ field("base_url", "Base URL", value=fields.base_url, hint="Optional. Overrides where the document says its API lives.", error=errors.get("base_url")) }}
API authentication

How the gateway authenticates the tool calls it proxies.

{{ choice("auth_type", "Type", auth_options, fields.auth_type, reveal="api", error=errors.get("auth_type")) }} {{ credential_fields("api", errors=errors) }}
Spec download

How the document itself is fetched, now and on every later refresh. Often the same credential as the API, sometimes a different one, usually neither.

{{ choice("spec_auth_mode", "Authentication", mode_options, fields.spec_auth_mode, reveal="spec_mode", error=errors.get("spec_auth_mode")) }}
{{ choice("spec_auth_type", "Type", spec_auth_options, fields.spec_auth_type, reveal="spec_type", error=errors.get("spec_auth_type")) }} {{ credential_fields("spec_type", prefix="spec_", errors=errors) }}

Credentials are never shown again once submitted, so a form that comes back with a correction has its credential boxes empty. Fill in the ones you need.

Cancel
{% endblock %}