| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2026-01-06 | 1.3 kB | |
| v3.2.5 source code.tar.gz | 2026-01-06 | 1.9 MB | |
| v3.2.5 source code.zip | 2026-01-06 | 2.0 MB | |
| Totals: 3 Items | 3.8 MB | 1 | |
MCP Server Lifecycle Fix
This patch release fixes a critical issue where MCP servers were being restarted for each agent.run() call instead of staying alive for the session.
What was happening
When using MCP servers with agents, each agent.run() call would:
- Start the MCP server subprocess
- Run the agent
- Stop the MCP server subprocess
This caused unnecessary overhead and defeated the purpose of having persistent MCP connections.
What this release fixes
#1260: MCP servers now persist across multiple agent.run() calls within the same Thread context:
:::python
import marvin
from pydantic_ai.mcp import MCPServerStdio
hub_mcp = MCPServerStdio(command="uvx", args=["some-mcp-server"])
agent = marvin.Agent(mcp_servers=[hub_mcp])
with marvin.Thread():
agent.run("first query") # starts MCP server
agent.run("second query") # reuses running server ✓
agent.run("third query") # reuses running server ✓
# Thread exits → MCP server cleaned up
#1261: Fixed a follow-up issue where MCP cleanup could fail when Thread.__exit__ was called from an async context (the orchestrator). The cleanup now happens properly in the orchestrator's async finally block.