diff --git a/examples/workflows/workflow_orchestrator_worker/README.md b/examples/workflows/workflow_orchestrator_worker/README.md index e623d98c3..25da21361 100644 --- a/examples/workflows/workflow_orchestrator_worker/README.md +++ b/examples/workflows/workflow_orchestrator_worker/README.md @@ -66,3 +66,68 @@ Run your MCP Agent app: ```bash uv run main.py ``` + + +## `4` [Beta] Deploy to the cloud + +### `a.` Log in to [MCP Agent Cloud](https://docs.mcp-agent.com/cloud/overview) + +```bash +uv run mcp-agent login +``` + +### `b.` Update your `mcp_agent.secrets.yaml` to mark your developer secrets (keys) + +```yaml +openai: + api_key: !developer_secret +anthropic: + api_key: !developer_secret +# Other secrets as needed +``` + +### `c.` Deploy your agent with a single command +```bash +uv run mcp-agent deploy workflow-orchestrator-server +``` + +### `d.` Connect to your deployed agent as an MCP server through any MCP client + +#### Claude Desktop Integration + +Configure Claude Desktop to access your agent servers by updating your `~/.claude-desktop/config.json`: + +```json +"my-agent-server": { + "command": "/path/to/npx", + "args": [ + "mcp-remote", + "https://[your-agent-server-id].deployments.mcp-agent-cloud.lastmileai.dev/sse", + "--header", + "Authorization: Bearer ${BEARER_TOKEN}" + ], + "env": { + "BEARER_TOKEN": "your-mcp-agent-cloud-api-token" + } +} +``` + +#### MCP Inspector + +Use MCP Inspector to explore and test your agent servers: + +```bash +npx @modelcontextprotocol/inspector +``` + +Make sure to fill out the following settings: + +| Setting | Value | +|---|---| +| *Transport Type* | *SSE* | +| *SSE* | *https://[your-agent-server-id].deployments.mcp-agent-cloud.lastmileai.dev/sse* | +| *Header Name* | *Authorization* | +| *Bearer Token* | *your-mcp-agent-cloud-api-token* | + +> [!TIP] +> In the Configuration, change the request timeout to a longer time period. Since your agents are making LLM calls, it is expected that it should take longer than simple API calls. diff --git a/examples/workflows/workflow_orchestrator_worker/main.py b/examples/workflows/workflow_orchestrator_worker/main.py index 71f41c2f7..092057d72 100644 --- a/examples/workflows/workflow_orchestrator_worker/main.py +++ b/examples/workflows/workflow_orchestrator_worker/main.py @@ -89,8 +89,14 @@ app = MCPApp(name="assignment_grader_orchestrator") - -async def example_usage(): +@app.tool +async def example_usage()->str: + ''' + this example function/tool call will use an orchestrator workflow + to dynamically plan and execute across a number of agents to grade + a short story. + ''' + result="" async with app.run() as orchestrator_app: logger = orchestrator_app.logger @@ -177,6 +183,7 @@ async def example_usage(): summary = await orchestrator_app.get_token_summary() print(f"\nTotal Cost: ${summary.cost:.4f}") print("=" * 60) + return result def display_node_tree(