---
name: MCP Server Obeys STORKIT_PORT
---

# Story 40: MCP Server Obeys STORKIT_PORT

## User Story

As a developer running the server on a non-default port, I want agent worktrees to automatically discover the correct MCP server URL, so that spawned agents can use MCP tools without manual .mcp.json edits.

## Acceptance Criteria

- [ ] Agent worktrees inherit the correct port from the running server (via STORKIT_PORT env var or default 3001)
- [ ] The .mcp.json in agent worktrees points to the actual server port, not a hardcoded value
- [ ] Existing behaviour (default port 3001) continues to work when STORKIT_PORT is not set

## Out of Scope

- TBD
