Add Claude Desktop configuration via skyvern run mcp (#2045)

This commit is contained in:
Jose
2025-04-02 10:33:37 -06:00
committed by GitHub
parent b2ae3f999c
commit d168da4653
5 changed files with 799 additions and 56 deletions

30
skyvern/mcp/server.py Normal file
View File

@@ -0,0 +1,30 @@
import os
from mcp.server.fastmcp import FastMCP
from skyvern.agent import SkyvernAgent
mcp = FastMCP("Skyvern")
if "SKYVERN_MCP_CLOUD_URL" in os.environ and "SKYVERN_MCP_API_KEY" in os.environ:
skyvern_agent = SkyvernAgent(
base_url=os.environ.get("SKYVERN_MCP_CLOUD_URL"), api_key=os.environ.get("SKYVERN_MCP_API_KEY")
)
else:
skyvern_agent = SkyvernAgent()
@mcp.tool()
async def skyvern_run_task(prompt: str, url: str) -> str:
"""Browse the internet using a browser to achieve a user goal.
Args:
prompt: brief description of what the user wants to accomplish
url: the target website for the user goal
"""
res = await skyvern_agent.run_task(prompt=prompt, url=url)
return res.model_dump()["output"]
if __name__ == "__main__":
mcp.run(transport="stdio")