ockam.yaml
name: example007
pods:
  - name: main-pod
    public: true
    containers:
      - name: main
        image: main

      - name: mcp
        image: ghcr.io/build-trust/mcp-proxy
        env:
          - name: BRAVE_API_KEY
            valueFrom:
              secretKeyRef:
                name: brave
                key: key
        args:
          ["--sse-port", "8001", "--pass-environment",
            "--", "npx", "-y", "@modelcontextprotocol/server-brave-search"]
secrets.yaml
- name: brave
  fields:
    key: "YOUR KEY HERE"
FROM ghcr.io/build-trust/ockam-python:latest
COPY . .
ENTRYPOINT ["python", "main.py"]
images/main/main.py
from datetime import datetime
from ockam import Agent, Model, Node, McpTool, McpClient, Tool


def current_iso8601_utc_time():
    """
    Returns the current UTC time in ISO 8601 format.
    """
    return datetime.utcnow().isoformat() + "Z"


async def main(node):
    await Agent.start(
        node=node,
        name="henry",
        instructions="""
            You are Henry, an expert legal assistant.

            When you are given a question, decide if your response can be better
            with a web search. If so, use the web search tool to improve your response.
        """,
        model=Model("claude-3-7-sonnet-v1"),
        tools=[
            McpTool("brave_search", "brave_web_search"),
            Tool(current_iso8601_utc_time),
        ],
    )


Node.start(
    main,
    mcp_clients=[
        McpClient(name="brave_search", address="http://localhost:8001/sse"),
    ],
)