Stage 6: Build + Test

Duration: ~15 minutes
What happens: AgentSherpa generates the server code, installs dependencies, and tests each tool with live data.

What gets built

AgentSherpa creates three files in your workspace:

server.py

The MCP server using the Python SDK v2 (mcp package):

  • MCPServer instance from mcp.server with dual-transport support (stdio + streamable HTTP)

  • One @server.tool(name=…​, description=…​) function per approved tool

  • yfinance library for Yahoo Finance data access

  • Python type hints that map to JSON Schema, docstrings, and try/except error handling

requirements.txt

mcp[cli]>=2.1.0,<3
yfinance>=1.6.0,<2
uvicorn and starlette are transitive dependencies pulled in by mcp[cli] — you do not need to list them separately.

Dockerfile

FROM registry.access.redhat.com/ubi9/python-312:latest
WORKDIR /opt/app-root/src
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY server.py .
ENV MCP_TRANSPORT=streamable-http
EXPOSE 8080
CMD ["python", "server.py"]

Testing

AgentSherpa tests each tool live:

  1. Installs yfinance and mcp[cli] in the workspace

  2. Runs the tool function directly (not through the server) with a real ticker like AAPL

  3. Shows the output so you can verify the data looks correct

  4. Moves to the next tool only after confirming success

For tools that return market data, results depend on market hours. The agent handles this gracefully — if a market is closed, it shows the last available data.

What to watch for

  • Type errors — the agent should use proper Python types, not raw strings

  • Missing error handling — what happens with an invalid ticker like XYZNOTREAL?

  • Tool descriptions — are they clear enough for an LLM to decide when to use them?

If you spot issues, tell AgentSherpa. It will fix and re-test.

Points

Action Points

All tools tested and passing

20

Interactive challenge (post-build)

5