Compare commits
1 commit
main
...
fix/presen
| Author | SHA1 | Date | |
|---|---|---|---|
| 89f4674fd2 |
1 changed files with 8 additions and 3 deletions
11
src/index.ts
11
src/index.ts
|
|
@ -61,14 +61,19 @@ async function main() {
|
|||
registerCleanupMyWorktreesTool(server)
|
||||
registerImplementNextStoryPrompt(server)
|
||||
|
||||
const transport = new StdioServerTransport()
|
||||
await server.connect(transport)
|
||||
|
||||
// Presence bootstrap MUST run before server.connect — the stdio transport
|
||||
// can stall the await on incoming messages, so anything after server.connect
|
||||
// may never execute reliably. Registering the worker + starting the
|
||||
// heartbeat first guarantees the UI sees the agent as soon as the process
|
||||
// is up, regardless of when the MCP client sends its first request.
|
||||
const auth = await getAuth()
|
||||
await registerWorker({ userId: auth.userId, tokenId: auth.tokenId })
|
||||
const { stop: stopHeartbeat } = startHeartbeat({ tokenId: auth.tokenId })
|
||||
registerShutdownHandlers({ userId: auth.userId, tokenId: auth.tokenId, stopHeartbeat })
|
||||
|
||||
const transport = new StdioServerTransport()
|
||||
await server.connect(transport)
|
||||
|
||||
console.error(`scrum4me-mcp ${VERSION} running on stdio`)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue