Skip to content

Conversation

mqasimsarfraz
Copy link
Contributor

Support user with evaluation e.g:

user: '{{aks.container_user}}'

Fixes #103

Happy to adopt the implementation if we think we there could be better way.

Testing Done:

→ cat ~/.docker/mcp/catalogs/docker-mcp.yaml  | grep 'user:' -C 3
    volumes:
      - '{{aks.azure_dir}}:/home/mcp/.azure'
      - '{{aks.kubeconfig}}:/home/mcp/.kube/config'
    user: '{{aks.container_user}}'
    prompts: 0
    resources: {}
    config:
--
          access_level:
            type: string
            description: Access level for the MCP server, One of [ readonly, readwrite, admin ]
          container_user:
            type: string
            description: Username or UID of the user to run the MCP server container as. This is useful for ensuring that the server has the correct permissions to access the Azure and kubeconfig files. (e.g. 10000 or azureuser)
          allow_namespaces:

→ cat ~/.docker/mcp/config.yaml 
aks:
  azure_dir: /home/qasim/.azure
  kubeconfig: /home/qasim/.kube/config
  access_level: readonly
  container_user: 1000
- Those servers are enabled: aks
- Listing MCP tools...
  - Running mcp/aks with [run --rm -i --init --security-opt no-new-privileges --cpus 1 --memory 2Gb --pull never -l docker-mcp=true -l docker-mcp-tool-type=mcp -l docker-mcp-name=aks -l docker-mcp-transport=stdio --user 1000 -v /home/qasim/.azure:/home/mcp/.azure -v /home/qasim/.kube/config:/home/mcp/.kube/config] and command [--transport=stdio --access-level=readonly --allow-namespaces= --additional-tools=]

- Listing MCP tools...
  - Running mcp/aks with [run --rm -i --init --security-opt no-new-privileges --cpus 1 --memory 2Gb --pull never -l docker-mcp=true -l docker-mcp-tool-type=mcp -l docker-mcp-name=aks -l docker-mcp-transport=stdio --user 1000 -v /home/qasim/.azure:/home/mcp/.azure -v /home/qasim/.kube/config:/home/mcp/.kube/config] and command [--transport=stdio --access-level=readonly --allow-namespaces= --additional-tools=]
  > aks: (15 tools) (2 prompts)

Signed-off-by: Qasim Sarfraz <[email protected]>
@mqasimsarfraz mqasimsarfraz requested a review from a team as a code owner August 22, 2025 19:05
Copy link
Collaborator

@slimslenderslacks slimslenderslacks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

@slimslenderslacks
Copy link
Collaborator

@mqasimsarfraz looks great. Thanks for this PR! Can you also tell us a bit about the use case. Are there MCP servers out there that you need to run with a different User?

@slimslenderslacks slimslenderslacks merged commit 16ffe71 into docker:main Aug 23, 2025
5 checks passed
masegraye pushed a commit to masegraye/docker-mcp-gateway that referenced this pull request Aug 23, 2025
@mqasimsarfraz
Copy link
Contributor Author

@mqasimsarfraz looks great. Thanks for this PR! Can you also tell us a bit about the use case. Are there MCP servers out there that you need to run with a different User?

@slimslenderslacks Thanks for the quick review and merge! :) I had included more context in #103 but now I opened docker/mcp-registry#180 to showcase which MCP servers needs it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

server/volumes: Not able to map UID from host in the container

2 participants