mirror of
https://github.com/trycua/computer.git
synced 2026-01-04 04:19:57 -06:00
Add MCP server
This commit is contained in:
68
.github/workflows/publish-mcp-server.yml
vendored
Normal file
68
.github/workflows/publish-mcp-server.yml
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
name: Publish MCP Server Package
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'mcp-server-v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version to publish (without v prefix)'
|
||||
required: true
|
||||
default: '0.1.0'
|
||||
workflow_call:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version to publish'
|
||||
required: true
|
||||
type: string
|
||||
outputs:
|
||||
version:
|
||||
description: "The version that was published"
|
||||
value: ${{ jobs.determine-version.outputs.version }}
|
||||
|
||||
# Adding permissions at workflow level
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
determine-version:
|
||||
runs-on: macos-latest
|
||||
outputs:
|
||||
version: ${{ steps.get-version.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Determine version
|
||||
id: get-version
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" == "push" ]; then
|
||||
# Extract version from tag (for package-specific tags)
|
||||
if [[ "${{ github.ref }}" =~ ^refs/tags/mcp-server-v([0-9]+\.[0-9]+\.[0-9]+) ]]; then
|
||||
VERSION=${BASH_REMATCH[1]}
|
||||
else
|
||||
echo "Invalid tag format for mcp-server"
|
||||
exit 1
|
||||
fi
|
||||
elif [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
|
||||
# Use version from workflow dispatch
|
||||
VERSION=${{ github.event.inputs.version }}
|
||||
else
|
||||
# Use version from workflow_call
|
||||
VERSION=${{ inputs.version }}
|
||||
fi
|
||||
echo "VERSION=$VERSION"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
publish:
|
||||
needs: determine-version
|
||||
uses: ./.github/workflows/reusable-publish.yml
|
||||
with:
|
||||
package_name: "mcp-server"
|
||||
package_dir: "libs/mcp-server"
|
||||
version: ${{ needs.determine-version.outputs.version }}
|
||||
is_lume_package: false
|
||||
base_package_name: "cua-mcp-server"
|
||||
make_latest: false
|
||||
secrets:
|
||||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
||||
32
.github/workflows/reusable-publish.yml
vendored
32
.github/workflows/reusable-publish.yml
vendored
@@ -220,6 +220,38 @@ jobs:
|
||||
echo "# Run the server" >> release_notes.md
|
||||
echo "cua-computer-server" >> release_notes.md
|
||||
echo '```' >> release_notes.md
|
||||
elif [ "${{ inputs.package_name }}" = "mcp-server" ]; then
|
||||
echo "## MCP Server for the Computer-Use Agent (CUA)" >> release_notes.md
|
||||
echo "" >> release_notes.md
|
||||
echo "This package provides MCP (Model Context Protocol) integration for CUA agents, allowing them to be used with Claude Desktop, Cursor, and other MCP clients." >> release_notes.md
|
||||
echo "" >> release_notes.md
|
||||
echo "## Dependencies" >> release_notes.md
|
||||
echo "* cua-computer: ${COMPUTER_VERSION:-latest}" >> release_notes.md
|
||||
echo "* cua-agent: ${AGENT_VERSION:-latest}" >> release_notes.md
|
||||
echo "" >> release_notes.md
|
||||
echo "## Usage" >> release_notes.md
|
||||
echo '```bash' >> release_notes.md
|
||||
echo "# Run the MCP server directly" >> release_notes.md
|
||||
echo "cua-mcp-server" >> release_notes.md
|
||||
echo '```' >> release_notes.md
|
||||
echo "" >> release_notes.md
|
||||
echo "## Claude Desktop Integration" >> release_notes.md
|
||||
echo "Add to your Claude Desktop configuration (~/.config/claude-desktop/claude_desktop_config.json or OS-specific location):" >> release_notes.md
|
||||
echo '```json' >> release_notes.md
|
||||
echo '"mcpServers": {' >> release_notes.md
|
||||
echo ' "cua-agent": {' >> release_notes.md
|
||||
echo ' "command": "cua-mcp-server",' >> release_notes.md
|
||||
echo ' "args": [],' >> release_notes.md
|
||||
echo ' "env": {' >> release_notes.md
|
||||
echo ' "CUA_AGENT_LOOP": "OMNI",' >> release_notes.md
|
||||
echo ' "CUA_MODEL_PROVIDER": "ANTHROPIC",' >> release_notes.md
|
||||
echo ' "CUA_MODEL_NAME": "claude-3-opus-20240229",' >> release_notes.md
|
||||
echo ' "ANTHROPIC_API_KEY": "your-api-key",' >> release_notes.md
|
||||
echo ' "PYTHONIOENCODING": "utf-8"' >> release_notes.md
|
||||
echo ' }' >> release_notes.md
|
||||
echo ' }' >> release_notes.md
|
||||
echo '}' >> release_notes.md
|
||||
echo '```' >> release_notes.md
|
||||
fi
|
||||
|
||||
# Add installation section if not agent (which has its own installation section)
|
||||
|
||||
Reference in New Issue
Block a user