Accept story 40: MCP Server Obeys STORYKIT_PORT

Agent worktrees now get a .mcp.json written with the correct port from
the running server. AgentPool receives the port at construction and
passes it through to create_worktree, which writes .mcp.json on both
new creation and reuse.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dave
2026-02-20 13:24:35 +00:00
parent ce37a70f9a
commit a3c20eb4d4
5 changed files with 78 additions and 34 deletions

View File

@@ -50,7 +50,8 @@ async fn main() -> Result<(), std::io::Error> {
JsonFileStore::from_path(PathBuf::from("store.json")).map_err(std::io::Error::other)?,
);
let workflow = Arc::new(std::sync::Mutex::new(WorkflowState::default()));
let agents = Arc::new(AgentPool::new());
let port = resolve_port();
let agents = Arc::new(AgentPool::new(port));
let ctx = AppContext {
state: app_state,
@@ -60,8 +61,6 @@ async fn main() -> Result<(), std::io::Error> {
};
let app = build_routes(ctx);
let port = resolve_port();
let addr = format!("127.0.0.1:{port}");
println!(