3. Add Skills and MCP
Extend the Hermes variant from 2. Switch Harnesses with a code-review skill and a local Model Context Protocol (MCP) tool. This third quickstart reuses the model and configuration in first_agent.py, the Hermes environment with MCP support, and HERMES_ADAPTER_PYTHON. Keep your application’s .venv active.
Add a Review Skill
Create skills/review/SKILL.md beside first_agent.py with the following content:
The skill supplies review instructions. The MCP server in the next step supplies an executable tool; these are separate capabilities.
Create a Local MCP Tool
The Hermes environment created in step two includes MCP 2.3 through its mcp extra. This example uses that version’s MCPServer API. Save this complete server as review_tools.py beside first_agent.py. It computes the example’s average without network access and records each tool call in a local JSON Lines file:
Do not start the server manually. The harness launches it through stdio when the agent starts. Keep protocol output on stdout; the example writes call evidence to the file instead.
Run the Extended Agent
Save this complete example as extended_agent.py beside the other files. It selects the already-installed Hermes adapter and uses the same Hermes interpreter for the adapter and MCP server:
From the application directory, run:
The environment-variable selection is sequential, as in step two. Production launchers should establish consistent execution environments instead of changing process-wide variables around concurrent starts.
Check the Review and Tool Calls
Look for status succeeded and a review that identifies the empty-list division error under the skill’s requested heading. Inspect mcp-tool-calls.jsonl for these records; ordering and repeat calls can vary:
The log proves the local tool ran. A successful agent response alone does not prove tool use or skill loading; the requested heading is an observable sign that the skill’s instructions influenced the review. For a repeat run, distinguish newly appended records from earlier calls. If startup or invocation fails, follow Troubleshooting. If the run succeeds without the required checks, inspect the response and tool log before treating the task as complete.
Next Steps
Continue to 4. Run in OpenShell (Optional) for the source-checkout sandbox example. Refer to Tools, Skills, and MCP for authentication, tool policy, and adapter differences, or Plan and Diagnose to inspect configuration before execution.