Update README (#2085)

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This commit is contained in:
Suchintan 2025-04-03 02:50:12 -04:00 committed by GitHub
parent 412073ca54
commit 8c664adbec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 117 additions and 20 deletions

View file

@ -99,6 +99,12 @@ This quickstart guide will walk you through getting Skyvern up and running on yo
skyvern run server skyvern run server
``` ```
4. **Launch the Skyvern UI**
```bash
skyvern run ui
```
## Docker Compose setup ## Docker Compose setup
1. Make sure you have [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed and running on your machine 1. Make sure you have [Docker Desktop](https://www.docker.com/products/docker-desktop/) installed and running on your machine

View file

@ -13,35 +13,46 @@
# Model Context Protocol (MCP) # Model Context Protocol (MCP)
Skyvern provides an MCP server implementation that seamlessly integrates with applications so your application gets access to the browser, fetching any live information from the browser and take actions through Skyvern's browser agent. Skyvern's MCP server implementation helps connect your AI Applications to the browser. This allows your AI applications to do things like: Fill out forms, download files, research information on the web, and more.
## Integration Options
You can connect your MCP-enabled applications to Skyvern in two ways: You can connect your MCP-enabled applications to Skyvern in two ways:
1. **Local Skyvern Server** 1. **Local Skyvern Server**
- Configure your applications to connect to skyvern server running on the localhost - Use your favourite LLM to power Skyvern
- To run Skyvern server locally: `skyvern run server`
2. **Skyvern Cloud** 2. **Skyvern Cloud**
- Configure your applications to connect to Skyvern Cloud - Create an account at [app.skyvern.com](https://app.skyvern.com)
- Create an account at [cloud.skyvern.com](https://cloud.skyvern.com)
- Get the API key from the settings page which will be used for setup - Get the API key from the settings page which will be used for setup
Follow the [installation instructions](#local) to set up. ## Quickstart
1. **Install Skyvern**
```bash
pip install skyvern
```
2. **Configure Skyvern** Run the setup wizard which will guide you through the configuration process. You can connect to either [Skyvern Cloud](https://app.skyvern.com) or a local version of Skyvern.
```bash
skyvern init
```
3. **(Optional) Launch the Skyvern Server. Only required in local mode**
```bash
skyvern run server
```
## Supported Applications ## Supported Applications
`skyvern init` helps configure the following applications for you:
- Cursor - Cursor
- Windsurf - Windsurf
- Claude Desktop - Claude Desktop
- Your custom MCP App?
`skyvern init` helps you set up the MCP config files for these supported applications automatically - no need to copy-paste the config files. In case you want to set up Skyvern for any other MCP-enabled application, here's the config: Use the following config if you want to set up Skyvern for any other MCP-enabled application
``` ```json
{ {
"mcpServers": { "mcpServers": {
"Skyvern": { "Skyvern": {
"env": { "env": {
"SKYVERN_BASE_URL": "https://api.skyvern.com", # "http://localhost:8000" if running locally "SKYVERN_BASE_URL": "https://api.skyvern.com", # "http://localhost:8000" if running locally
"SKYVERN_API_KEY": "YOUR_SKYVERN_API_KEY" # find the local SKYVERN_API_KEY in the .env file after running `skyvern init` "SKYVERN_API_KEY": "YOUR_SKYVERN_API_KEY" # find the local SKYVERN_API_KEY in the .env file after running `skyvern init` or in your Skyvern Cloud console
}, },
"command": "PATH_TO_PYTHON", "command": "PATH_TO_PYTHON",
"args": [ "args": [

View file

@ -28,12 +28,17 @@ mcp = FastMCP("Skyvern")
@mcp.tool() @mcp.tool()
async def skyvern_run_task(prompt: str, url: str) -> str: async def skyvern_run_task(prompt: str, url: str) -> dict[str, str]:
"""Browse the internet using a browser to achieve a user goal. """Execute automated browser actions to accomplish a user's goal on a website.
This tool uses Skyvern's browser automation to navigate websites and perform actions to achieve
the user's intended outcome. It can handle tasks like form filling, clicking buttons, data extraction,
and multi-step workflows.
Args: Args:
prompt: brief description of what the user wants to accomplish prompt: A natural language description of what needs to be accomplished (e.g. "Book a flight from
url: the target website for the user goal NYC to LA", "Sign up for the newsletter", "Find the price of item X", "Apply to a job")
url: The starting URL of the website where the task should be performed
""" """
skyvern_agent = SkyvernAgent( skyvern_agent = SkyvernAgent(
base_url=settings.SKYVERN_BASE_URL, base_url=settings.SKYVERN_BASE_URL,
@ -41,7 +46,14 @@ async def skyvern_run_task(prompt: str, url: str) -> str:
extra_headers={"X-User-Agent": "skyvern-mcp"}, extra_headers={"X-User-Agent": "skyvern-mcp"},
) )
res = await skyvern_agent.run_task(prompt=prompt, url=url) res = await skyvern_agent.run_task(prompt=prompt, url=url)
return res.model_dump()["output"]
# TODO: It would be nice if we could return the task URL here
output = res.model_dump()["output"]
base_url = settings.SKYVERN_BASE_URL
run_history_url = (
"https://app.skyvern.com/history" if "skyvern.com" in base_url else "http://localhost:8080/history"
)
return {"output": output, "run_history_url": run_history_url}
def command_exists(command: str) -> bool: def command_exists(command: str) -> bool:
@ -665,8 +677,16 @@ def setup_mcp() -> None:
path_to_env = setup_mcp_config() path_to_env = setup_mcp_config()
# Configure both Claude Desktop and Cursor # Configure both Claude Desktop and Cursor
claude_response = input("Would you like to set up MCP integration for Claude Desktop? (y/n) [y]: ").strip().lower()
if not claude_response or claude_response == "y":
setup_claude_desktop_config(host_system, path_to_env) setup_claude_desktop_config(host_system, path_to_env)
cursor_response = input("Would you like to set up MCP integration for Cursor? (y/n) [y]: ").strip().lower()
if not cursor_response or cursor_response == "y":
setup_cursor_config(host_system, path_to_env) setup_cursor_config(host_system, path_to_env)
windsurf_response = input("Would you like to set up MCP integration for Windsurf? (y/n) [y]: ").strip().lower()
if not windsurf_response or windsurf_response == "y":
setup_windsurf_config(host_system, path_to_env) setup_windsurf_config(host_system, path_to_env)
@ -684,6 +704,59 @@ def run_server() -> None:
) )
@run_app.command(name="ui")
def run_ui() -> None:
# FIXME: This is untested and may not work
"""Run the Skyvern UI server."""
# Check for and handle any existing process on port 8080
try:
result = subprocess.run("lsof -t -i :8080", shell=True, capture_output=True, text=True, check=False)
if result.stdout.strip():
response = input("Process already running on port 8080. Kill it? (y/n) [y]: ").strip().lower()
if not response or response == "y":
subprocess.run("lsof -t -i :8080 | xargs kill", shell=True, check=False)
else:
print("UI server not started. Process already running on port 8080.")
return
except Exception:
pass
# Get the frontend directory path relative to this file
current_dir = Path(__file__).parent.parent.parent
frontend_dir = current_dir / "skyvern-frontend"
if not frontend_dir.exists():
print(f"[ERROR] Skyvern Frontend directory not found at {frontend_dir}. Are you in the right repo?")
return
if not (frontend_dir / ".env").exists():
shutil.copy(frontend_dir / ".env.example", frontend_dir / ".env")
# Update VITE_SKYVERN_API_KEY in frontend .env with SKYVERN_API_KEY from main .env
main_env_path = current_dir / ".env"
if main_env_path.exists():
load_dotenv(main_env_path)
skyvern_api_key = os.getenv("SKYVERN_API_KEY")
if skyvern_api_key:
frontend_env_path = frontend_dir / ".env"
set_key(str(frontend_env_path), "VITE_SKYVERN_API_KEY", skyvern_api_key)
else:
print("[ERROR] SKYVERN_API_KEY not found in .env file")
else:
print("[ERROR] .env file not found")
print("Successfully set up frontend .env file")
# Change to frontend directory
os.chdir(frontend_dir)
# Run npm install and start
try:
subprocess.run("npm install --silent", shell=True, check=True)
subprocess.run("npm run start", shell=True, check=True)
except subprocess.CalledProcessError as e:
print(f"Error running UI server: {e}")
return
@run_app.command(name="mcp") @run_app.command(name="mcp")
def run_mcp() -> None: def run_mcp() -> None:
"""Run the MCP server.""" """Run the MCP server."""
@ -751,3 +824,10 @@ def init() -> None:
if configure_mcp: if configure_mcp:
setup_mcp() setup_mcp()
print("\nMCP server configuration completed.") print("\nMCP server configuration completed.")
if not run_local:
print("\nMCP configuration is complete! Your AI applications are now ready to use Skyvern Cloud.")
if run_local:
print("\nTo start using Skyvern, run:")
print(" skyvern run server")