Summary
Using mcp-server-docker via MCP in VS Code fails when validating tool mcp_docker_create_container with error:
Error: tool parameters array type must have items
Environment
- OS: Windows
- MCP client: VS Code (GitHub Copilot MCP integration)
- Server launch:
uvx mcp-server-docker
- Package version:
mcp-server-docker==0.2.1 (PyPI)
Reproduction
- Configure MCP server:
"docker": {
"command": "uvx",
"args": ["mcp-server-docker"]
}
- Start VS Code MCP and validate tools.
- Validation fails for tool
mcp_docker_create_container with message above.
Root cause
CreateContainerInput.model_json_schema() emits a tuple branch under ports:
{
"type": "array",
"prefixItems": [{"type":"string"},{"type":"integer"}],
"minItems": 2,
"maxItems": 2
}
This branch has no items, and some clients require items for all type: array schemas.
Field definition appears to be:
ports: dict[str, int | list[int] | tuple[str, int] | None] | None
Suggested fix
Use a client-compatible schema for that union branch, e.g. avoid tuple in tool input schema or provide explicit JSON schema override with items included for array branches.
Potential options:
- Replace
tuple[str, int] with an object form like { "host": string, "port": int } for MCP input schema.
- Or define
json_schema_extra for the field to ensure all array branches include items.
Thanks!
Summary
Using
mcp-server-dockervia MCP in VS Code fails when validating toolmcp_docker_create_containerwith error:Error: tool parameters array type must have itemsEnvironment
uvx mcp-server-dockermcp-server-docker==0.2.1(PyPI)Reproduction
mcp_docker_create_containerwith message above.Root cause
CreateContainerInput.model_json_schema()emits a tuple branch underports:{ "type": "array", "prefixItems": [{"type":"string"},{"type":"integer"}], "minItems": 2, "maxItems": 2 }This branch has no
items, and some clients requireitemsfor alltype: arrayschemas.Field definition appears to be:
Suggested fix
Use a client-compatible schema for that union branch, e.g. avoid tuple in tool input schema or provide explicit JSON schema override with
itemsincluded for array branches.Potential options:
tuple[str, int]with an object form like{ "host": string, "port": int }for MCP input schema.json_schema_extrafor the field to ensure all array branches includeitems.Thanks!