openpencil/packages/mcp/src
Danila Poyarkov 9e013e60e7 fix(mcp): fix stdio handshake and eval return values
Stdio handshake:
Server now sends { type: register, token } to WebSocket clients on
connection, so the stdio bridge receives the token immediately instead
of deadlocking while both sides wait to receive.

Eval return values (REPL-style):
Add wrapEvalCode() that detects when the last non-empty line is a value
expression and promotes it to a return statement. Bare expressions like
JSON.stringify(result) now return the value instead of undefined.
Single implementation in packages/core/src/tools/analyze/eval-wrap.ts
used by both the tool and the automation bridge.

Co-authored-by: stiff <v.stiff@gmail.com>
Co-authored-by: Jais Pedersen <jais@pedersens.net>
2026-05-11 12:05:43 +03:00
..
tool style: tighten import grouping 2026-05-06 02:22:08 +03:00
auth.ts chore: format sources with oxfmt 2026-05-03 21:03:40 +03:00
browser-rpc.ts Refactor architecture boundaries across core, app, and packages (#234) 2026-04-30 15:14:19 +03:00
http-options.ts chore: format sources with oxfmt 2026-05-03 21:03:40 +03:00
index.ts feat(mcp): add open_file, new_document tools and disk export via path param 2026-04-22 17:05:54 +03:00
jsx-preprocess.ts chore: format sources with oxfmt 2026-05-03 21:03:40 +03:00
mcp-sessions.ts chore: format sources with oxfmt 2026-05-03 21:03:40 +03:00
result.ts Refactor architecture boundaries across core, app, and packages (#234) 2026-04-30 15:14:19 +03:00
server.ts fix(mcp): fix stdio handshake and eval return values 2026-05-11 12:05:43 +03:00
stdio-bridge.ts chore: format sources with oxfmt 2026-05-03 21:03:40 +03:00
stdio.ts chore: format sources with oxfmt 2026-05-03 21:03:40 +03:00