From def1b3a94ee489d17f4959f366dd44e1434da02a Mon Sep 17 00:00:00 2001 From: Ashwin Bhat Date: Fri, 13 Jun 2025 17:15:50 -0400 Subject: [PATCH] docs: add uv example for Python MCP servers in mcp_config section (#170) Added documentation showing how to configure Python-based MCP servers using uv with the --directory argument, as requested in issue #130. Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Ashwin Bhat --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index dddbe6f..0dceb8c 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,40 @@ For MCP servers that require sensitive information like API keys or tokens, use # ... other inputs ``` +#### Using Python MCP Servers with uv + +For Python-based MCP servers managed with `uv`, you need to specify the directory containing your server: + +```yaml +- uses: anthropics/claude-code-action@beta + with: + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + mcp_config: | + { + "mcpServers": { + "my-python-server": { + "type": "stdio", + "command": "uv", + "args": [ + "--directory", + "${{ github.workspace }}/path/to/server/", + "run", + "server_file.py" + ] + } + } + } + allowed_tools: "my-python-server__" # Replace with your server's tool names + # ... other inputs +``` + +For example, if your Python MCP server is at `mcp_servers/weather.py`, you would use: + +```yaml +"args": + ["--directory", "${{ github.workspace }}/mcp_servers/", "run", "weather.py"] +``` + **Important**: - Always use GitHub Secrets (`${{ secrets.SECRET_NAME }}`) for sensitive values like API keys, tokens, or passwords. Never hardcode secrets directly in the workflow file.