Table of contents
openwebui_tool_server (Resource)
Registers one external tool server, OpenAPI or MCP, with Open WebUI.
Open WebUI keeps every tool server in a single configuration list, TOOL_SERVER_CONNECTIONS, and the only write route replaces that list as a whole. This resource reads the list, edits its own entry, and writes the list back, under a lock that serialises the resources of one Terraform run. It leaves every field of every other entry, and every field of its own entry that it does not model, exactly as it found them.
~> Note: openwebui_tool_server and openwebui_tool_servers_config manage the same list. Use one or the other, never both. openwebui_tool_server is the recommended one.
~> Note: The lock covers one process. Two terraform apply runs against the same instance at the same time can lose a tool server.
OAuth
An MCP server with auth_type = "oauth_2.1" authenticates with a registration blob that Open WebUI mints through dynamic client registration and stores encrypted in info.oauth_client_info. Registering is a separate call, so the two resources compose:
resource "openwebui_oauth_client" "paperless" {
url = "https://paperless.mcp.example"
client_id = "paperless"
type = "mcp"
}
resource "openwebui_tool_server" "paperless" {
server_id = "paperless"
type = "mcp"
url = "https://paperless.mcp.example"
auth_type = "oauth_2.1"
enabled = true
oauth_client_info = openwebui_oauth_client.paperless.oauth_client_info
}
The client_id of the OAuth client must equal the server_id of the tool server, because Open WebUI looks the client up as <type>:<server_id>.
The blob is a Fernet ciphertext under OAUTH_CLIENT_INFO_ENCRYPTION_KEY, which defaults to WEBUI_SECRET_KEY. Terraform carries it and cannot read or re-create it. Rotating either key invalidates every stored blob, and recovering means registering each OAuth client again.
Example Usage
# An OpenAPI tool server that needs no authentication.
resource "openwebui_tool_server" "weather" {
server_id = "weather"
url = "https://tools.example.com/weather"
path = "openapi.json"
auth_type = "none"
enabled = true
}
# An OpenAPI tool server behind a bearer token, shared with one group.
resource "openwebui_tool_server" "billing" {
server_id = "billing"
url = "https://tools.example.com/billing"
path = "openapi.json"
auth_type = "bearer"
key = var.billing_tool_token
read_groups = ["finance"]
}
# An MCP server that authenticates with OAuth 2.1. Registering the OAuth client
# is a separate call, so the two resources compose. The client_id of the OAuth
# client must equal the server_id of the tool server.
resource "openwebui_oauth_client" "paperless" {
url = "https://paperless.mcp.example.com"
client_id = "paperless"
type = "mcp"
}
resource "openwebui_tool_server" "paperless" {
server_id = "paperless"
type = "mcp"
url = "https://paperless.mcp.example.com"
auth_type = "oauth_2.1"
enabled = true
name = "Paperless"
description = "Document search"
oauth_client_info = openwebui_oauth_client.paperless.oauth_client_info
}
# An MCP server whose identity provider issued the credentials up front. The
# OAuth client registers with the secret, and the tool server overlays the same
# client id and secret onto the registration.
resource "openwebui_oauth_client" "invoices" {
url = "https://invoices.mcp.example.com"
client_id = "invoices"
client_secret = var.invoices_oauth_client_secret
type = "mcp"
}
resource "openwebui_tool_server" "invoices" {
server_id = "invoices"
type = "mcp"
url = "https://invoices.mcp.example.com"
auth_type = "oauth_2.1_static"
enabled = true
name = "Invoices"
oauth_client_id = "invoices"
oauth_client_secret = var.invoices_oauth_client_secret
oauth_client_info = openwebui_oauth_client.invoices.oauth_client_info
}
variable "billing_tool_token" {
type = string
sensitive = true
}
variable "invoices_oauth_client_secret" {
type = string
sensitive = true
}
Schema
Required
server_id(String) Identifier of the tool server, stored asinfo.id. Models reference the server asserver:mcp:<server_id>orserver:<server_id>in theirtool_ids, so changing it breaks every model that points at this server. Forces replacement.url(String) Base URL of the tool server, e.g.https://tools.example.
Optional
auth_type(String) How Open WebUI authenticates to the server:none,bearer,oauth_2.1, oroauth_2.1_static.bearerreadskey. Both OAuth types read the registration inoauth_client_infoand apply only to MCP servers.description(String) Description of an MCP server, stored asinfo.description.enabled(Boolean) Whether Open WebUI loads the server. Stored asconfig.enable; a disabled server stays registered and offers no tools. Defaults totrue.function_name_filter_list(List of String) Filters the tools the server exposes, matched by name suffix. A plain entry allows every tool whose name ends with it. An entry with a!prefix blocks those tools instead. Unset, every tool is exposed. Stored as a list of strings underconfig.function_name_filter_list. The provider also reads the comma-separated string a save from the web UI writes.headers_json(String) JSON object of extra HTTP headers, e.g.jsonencode({ X-Api-Version = "2" }).key(String, Sensitive) Bearer token sent to the tool server whenauth_typeisbearer. Sensitive.name(String) Display name of an MCP server, stored asinfo.name. An OpenAPI server takes its name from the fetched spec instead.oauth_client_id(String) OAuth client identifier forauth_type = "oauth_2.1_static", which overlays it onto the registration blob.oauth_client_info(String, Sensitive) Encrypted OAuth registration for the server, normally taken from theoauth_client_infoattribute of anopenwebui_oauth_clientresource. Left unset, the blob already stored on the server is preserved untouched. Sensitive.oauth_client_secret(String, Sensitive) OAuth client secret forauth_type = "oauth_2.1_static". Stored in plain text by Open WebUI. Sensitive.oauth_resource_parameter(String) How Open WebUI sends the OAuth resource indicator:auto,always, ornever. An unrecognised value reads asauto.oauth_scope(String) Space-separated OAuth scopes to request for this server.path(String) Path to the OpenAPI spec, e.g.openapi.json, appended tourlunless it is itself a full URL. MCP servers ignore it. Defaults to empty.public_read(Boolean) Whether every signed-in user can use the server's tools.public_write(Boolean) Whether every signed-in user can manage the server's tools.read_groups(List of String) List of group names or IDs granted read access to the server's tools.read_users(List of String) List of user email addresses or IDs granted read access to the server's tools.spec(String) Inline OpenAPI spec as JSON text, read whenspec_typeisjson.spec_type(String) Where an OpenAPI server's spec comes from:urlfetches it frompath,jsonreads it fromspec.type(String) Tool server type,openapiormcp. Defaults toopenapi.write_groups(List of String) List of group names or IDs granted write access to the server's tools.write_users(List of String) List of user email addresses or IDs granted write access to the server's tools. Name the same address inread_usersas well.
Read-Only
id(String) Terraform identifier. Always equal toserver_id.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
# A tool server is imported by its server_id, which Open WebUI stores as info.id.
terraform import openwebui_tool_server.paperless paperless
# A connection registered by hand in the web UI may carry no info.id. Import it
# by its position in the list, and the next apply pins the identity.
terraform import openwebui_tool_server.weather weather@2
Data sources
- openwebui_channel (Data Source)
- openwebui_config_export (Data Source)
- openwebui_file (Data Source)
- openwebui_files (Data Source)
- openwebui_group (Data Source)
- openwebui_knowledge (Data Source)
- openwebui_model (Data Source)
- openwebui_ollama_connection_verify (Data Source)
- openwebui_openai_connection_verify (Data Source)
- openwebui_pipeline (Data Source)
- openwebui_prompt (Data Source)
- openwebui_skill (Data Source)
- openwebui_tool (Data Source)
- openwebui_tool_server (Data Source)
- openwebui_tool_server_verify (Data Source)
- openwebui_user (Data Source)
Resources
- openwebui_admin_config (Resource)
- openwebui_audio_config (Resource)
- openwebui_banners_config (Resource)
- openwebui_channel (Resource)
- openwebui_chat_config (Resource)
- openwebui_code_execution_config (Resource)
- openwebui_config_import (Resource)
- openwebui_connections_config (Resource)
- openwebui_default_user_permissions (Resource)
- openwebui_evaluation_config (Resource)
- openwebui_file (Resource)
- openwebui_function (Resource)
- openwebui_function_valves (Resource)
- openwebui_group (Resource)
- openwebui_group_features (Resource)
- openwebui_images_config (Resource)
- openwebui_knowledge (Resource)
- openwebui_knowledge_file (Resource)
- openwebui_ldap_config (Resource)
- openwebui_model (Resource)
- openwebui_model_settings (Resource)
- openwebui_models_config (Resource)
- openwebui_oauth_client (Resource)
- openwebui_oauth_picture_links (Resource)
- openwebui_oauth_roles (Resource)
- openwebui_ollama_connections (Resource)
- openwebui_openai_connection_models (Resource)
- openwebui_openai_connections (Resource)
- openwebui_pipeline (Resource)
- openwebui_pipeline_valves (Resource)
- openwebui_prompt (Resource)
- openwebui_rag_config (Resource)
- openwebui_rag_embedding_config (Resource)
- openwebui_skill (Resource)
- openwebui_subagents_config (Resource)
- openwebui_suggestions_config (Resource)
- openwebui_task_config (Resource)
- openwebui_terminal_server (Resource)
- openwebui_tool (Resource)
- openwebui_tool_server (Resource)
- openwebui_tool_server_access (Resource)
- openwebui_tool_servers_config (Resource)
- openwebui_tool_valves (Resource)
- openwebui_user (Resource)
- openwebui_videos_config (Resource)
Published from docs/ (refs/tags/v0.1.0-dev.10, a40bd0a133e7). Edit the source in a pull request; wiki edits are replaced on the next publish.