Conversation
- Update openaf.js and owrap.server.js to support MCP functionality - Add new MCP test suite in autoTestAll.MCP.js and autoTestAll.MCP.yaml
Modified js/genScripts.js with 15 insertions and 4 deletions to improve script generation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for the "modern" (2026-07-28+) stateless, per-request protocol era in the Model Context Protocol (MCP) client and server, while maintaining full backward compatibility with legacy (initialize-handshake-based) protocol versions. The changes allow clients to automatically negotiate the most advanced protocol supported by the server, and servers to handle both legacy and modern requests side-by-side. Additionally, there are improvements to Unix launcher scripts for safer terminal state restoration.
MCP Protocol Modernization and Negotiation
$mcpinjs/openaf.js) now supports automatic negotiation of protocol versions, including the new modern, stateless era (2026-07-28+). IfaOptions.protocolVersionis set to"auto", the client probes the server and uses the most advanced mutually supported protocol. Legacy behavior remains the default for callers not opting into"auto". [1] [2] [3]ow.server.mcpinjs/owrap.server.js) implements helpers for protocol version negotiation, request classification (modern vs. legacy), error construction, and result wrapping. The server can now respond to modern-era requests with enhanced metadata and error handling, while preserving legacy behavior for older clients.ow.server.mcpStdiofunction now accepts anoptsparameter to opt into modern protocol support, serving both legacy and modern clients concurrently. [1] [2]Client and Server API Enhancements
_era,_negotiatedVersion) and methods (e.g.,isInputRequired) to help callers understand the negotiated protocol and handle modern server features, such as input-required results. [1] [2]Unix Script Improvements
genUnixSttyRestoreinjs/genScripts.js) now ensures the terminal state is safely restored even if an exact snapshot is unavailable, falling back tostty saneto prevent leaving the shell in an unusable state. Signal handling is also improved for portability. [1] [2]These changes collectively enable seamless adoption of the new MCP protocol era, while ensuring existing clients and servers remain fully functional without modification.
References:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]