embed template in basic arg type, simpler k/v input for headers and env vars

This commit is contained in:
Connor Peet 2025-05-13 10:11:51 -07:00
commit da32d8b472
2 changed files with 51 additions and 67 deletions

View file

@ -77,8 +77,7 @@ GET /v0/servers/a5e8a7f0-d4e4-4a1d-b12f-2896a23fd4f1?version=0.0.3
], ],
"environment_variables": [ "environment_variables": [
{ {
"type": "named", "key": "LOG_LEVEL",
"name": "LOG_LEVEL",
"description": "Logging level (debug, info, warn, error)", "description": "Logging level (debug, info, warn, error)",
"default": "info" "default": "info"
} }
@ -90,9 +89,10 @@ GET /v0/servers/a5e8a7f0-d4e4-4a1d-b12f-2896a23fd4f1?version=0.0.3
"version": "1.0.2", "version": "1.0.2",
"runtime_arguments": [ "runtime_arguments": [
{ {
"type": "template", "type": "named",
"description": "Mount a volume into the container", "description": "Mount a volume into the container",
"template": "--mount=type=bind,src={source_path},dst={target_path}", "flag": "--mount",
"value": "type=bind,src={source_path},dst={target_path}",
"is_required": true, "is_required": true,
"is_repeated": true, "is_repeated": true,
"variables": { "variables": {
@ -115,11 +115,10 @@ GET /v0/servers/a5e8a7f0-d4e4-4a1d-b12f-2896a23fd4f1?version=0.0.3
"name": "target_dir", "name": "target_dir",
"value": "/project", "value": "/project",
} }
] ],
"environment_variables": [ "environment_variables": [
{ {
"type": "named", "key": "LOG_LEVEL",
"name": "LOG_LEVEL",
"description": "Logging level (debug, info, warn, error)", "description": "Logging level (debug, info, warn, error)",
"default": "info" "default": "info"
} }
@ -163,8 +162,7 @@ API Response:
"version": "1.0.2", "version": "1.0.2",
"environment_variables": [ "environment_variables": [
{ {
"type": "named", "key": "BRAVE_API_KEY",
"name": "BRAVE_API_KEY",
"description": "Brave Search API Key", "description": "Brave Search API Key",
"is_required": true, "is_required": true,
"is_secret": true "is_secret": true
@ -217,9 +215,10 @@ API Response:
"version": "1.0.2", "version": "1.0.2",
"runtime_arguments": [ "runtime_arguments": [
{ {
"type": "template", "type": "named",
"description": "Mount a volume into the container", "description": "Mount a volume into the container",
"template": "--mount=type=bind,src={source_path},dst={target_path}", "flag": "--mount",
"value": "type=bind,src={source_path},dst={target_path}",
"is_required": true, "is_required": true,
"is_repeated": true, "is_repeated": true,
"variables": { "variables": {
@ -255,7 +254,7 @@ claude_desktop_config.json:
"server": "@modelcontextprotocol/servers/src/filesystem@1.0.2", "server": "@modelcontextprotocol/servers/src/filesystem@1.0.2",
"package": "docker", "package": "docker",
"settings": { "settings": {
"mount_config": [ "--mount": [
{ "source_path": "/Users/username/Desktop", "target_path": "/project/desktop" }, { "source_path": "/Users/username/Desktop", "target_path": "/project/desktop" },
{ "source_path": "/path/to/other/allowed/dir", "target_path": "/project/other/allowed/dir,ro" }, { "source_path": "/path/to/other/allowed/dir", "target_path": "/project/other/allowed/dir,ro" },
] ]

View file

@ -184,20 +184,18 @@ components:
type: array type: array
description: List of arguments passed to the package's runtime command (such as docker or npx). description: List of arguments passed to the package's runtime command (such as docker or npx).
items: items:
$ref: '#/components/schemas/Input' $ref: '#/components/schemas/Argument'
package_arguments: package_arguments:
type: array type: array
description: List of arguments passed to the package's binary. description: List of arguments passed to the package's binary.
items: items:
$ref: '#/components/schemas/Input' $ref: '#/components/schemas/Argument'
environment_variables: environment_variables:
type: array type: array
items: items:
anyOf: $ref: '#/components/schemas/KeyValueInput'
- $ref: '#/components/schemas/NamedInput'
- $ref: '#/components/schemas/TemplateInput'
UserInput: Input:
type: object type: object
properties: properties:
description: description:
@ -213,7 +211,7 @@ components:
default: string default: string
value: value:
type: string type: string
description: The default value for the input. If this is not set, the user will be asked to provide a value. description: The default value for the input. If this is not set, the user will be asked to provide a value. If the `variables` property is provided, then values wrapped in `{curly_braces}` will be replaced with the corresponding variables.
is_secret: is_secret:
type: boolean type: boolean
description: Whether the input is a secret value (e.g., password, token). If true, clients should handle the value securely. description: Whether the input is a secret value (e.g., password, token). If true, clients should handle the value securely.
@ -228,10 +226,21 @@ components:
type: string type: string
example: [] example: []
PositionalInput: InputWithVariables:
allOf:
- $ref: '#/components/schemas/Input'
- type: object
properties:
variables:
type: object
description: A map of variable names to their values. Keys in the input `value` wrapped in `{curly_braces}` will be replaced with the corresponding variables.
additionalProperties:
$ref: '#/components/schemas/Input'
PositionalArgument:
description: A positional input is a value inserted verbatim into the command line. description: A positional input is a value inserted verbatim into the command line.
allOf: allOf:
- $ref: '#/components/schemas/UserInput' - $ref: '#/components/schemas/InputWithVariables'
- type: object - type: object
required: required:
- type - type
@ -243,72 +252,50 @@ components:
example: "positional" example: "positional"
name: name:
type: string type: string
description: Name of the positional argument. This is not part of the command line, but can be used for reference by client configuration. description: Name of the positional argument. This is not part of the command line, but can be used for reference by client configuration and used to hint users.
example: file_path example: file_path
is_repeated: is_repeated:
type: boolean type: boolean
description: Whether the input can be repeated multiple times in the command line. description: Whether the input can be repeated multiple times in the command line.
default: false default: false
NamedInput: NamedArgument:
description: A command-line `--flag={value}`, named environment variable or header. description: A command-line `--flag={value}`.
allOf: allOf:
- $ref: '#/components/schemas/UserInput' - $ref: '#/components/schemas/InputWithVariables'
- type: object - type: object
required: required:
- type - type
- name - flag
properties: properties:
type: type:
type: string type: string
enum: [named] enum: [named]
example: "named" example: "named"
name: flag:
type: string type: string
example: "--port" example: "--port"
is_repeated: is_repeated:
type: boolean type: boolean
description: Whether the argument or header can be repeated multiple times. Has no effect for environment variables. description: Whether the argument can be repeated multiple times. Has no effect for environment variables.
default: false default: false
TemplateInput: KeyValueInput:
- type: object allOf:
required: - $ref: '#/components/schemas/InputWithVariables'
- type - type: object
- template required:
- name - name
properties: properties:
type: key:
type: string type: string
enum: [template] description: Name of the header or environment variable.
name: example: SOME_VARIABLE
type: string
example: mount_config
description: The name of the input, which can be used by clients as an identifier to reference the input. For environment variables and headers, this is the environment variable or header names. For arguments, this is solely for reference and not part of the command line.
description:
description: A description of the input, which can be used by clients to provide context to the user.
type: string
is_required:
type: boolean
default: false
is_repeated:
type: boolean
description: Whether the argument or header can be repeated multiple times. Has no effect for environment variables.
default: false
template:
type: string
description: The template string that will be used to generate the value. Values wrapped in `{curly_braces}` will be replaced with the corresponding variables. Input which is not `is_required` is replaced with its `default` value, or otherwise an empty string.
example: "--mount=type=bind,src={host_path},dst={container_path}"
variables:
type: object
additionalProperties:
$ref: '#/components/schemas/UserInput'
Input: Argument:
anyOf: anyOf:
- $ref: '#/components/schemas/PositionalInput' - $ref: '#/components/schemas/PositionalArgument'
- $ref: '#/components/schemas/NamedInput' - $ref: '#/components/schemas/NamedArgument'
- $ref: '#/components/schemas/TemplateInput'
Remote: Remote:
type: object type: object
@ -327,9 +314,7 @@ components:
headers: headers:
type: array type: array
items: items:
anyOf: $ref: '#/components/schemas/KeyValueInput'
- $ref: '#/components/schemas/NamedInput'
- $ref: '#/components/schemas/TemplateInput'
ServerDetail: ServerDetail:
allOf: allOf: