Files
OpenViking/.github
t0sakiandTRAE CLI bbf2e37f88 feat(pi): mirror the server's MCP tool surface (#5272)
* feat(pi): mirror the server's MCP tool surface

The pi extension defined seven viking_* tools over its REST client and had
drifted from the MCP harnesses: no grep, glob, tree, write, edit, no watch
tools, no health, and no context mode on search. pi has no MCP client, so
the extension now drives the shared stdio->HTTP proxy core in process --
never calling its start(), just handleMessage over an injected sink -- and
republishes every descriptor from the server's tools/list as a native pi
tool named openviking_<tool>. Nothing in the extension enumerates tools, so
a server that gains or drops one changes pi's surface at the next session
with no plugin release. No new dependency and no subprocess.

viking_* is removed outright with no alias period. The server's usage
attribution already recognises openviking_* but never recognised viking_*,
so pi's retrieval and reads now count toward Experience usage and lineage.

A failed handshake does not fail startup: recall, session capture and
takeover keep working, the status line and /viking report the failure, and
a later turn retries, so a server started after pi is picked up without a
restart. The shared mcpEnabled key now applies to pi as well.

pi validates tool arguments locally, which the other harnesses do not, so a
small schema-driven repair pass runs before validation. It only erases that
extra local strictness -- dropping explicit nulls on optional fields,
wrapping a scalar where the schema wants an array, and parsing a JSON
string the way FastMCP's pre_parse_json does -- and deliberately leaves
everything the server itself would reject.

Recall, session sync, profile injection and takeover stay on REST. The
experimental context-management fork keeps its own tools; only its
coexistence probe learns the new name, plus a globalThis marker for the
case where a 403 leaves the stable extension with no tools but a live
session.

* refactor(pi): replace custom MCP bridge with official client

Co-authored-by: TRAE CLI <traecli@bytedance.com>

* test(pi): cover SDK calls, reload cleanup and dependency installs

Co-authored-by: TRAE CLI <traecli@bytedance.com>

* docs(pi): align MCP architecture descriptions

Co-authored-by: TRAE CLI <traecli@bytedance.com>

---------

Co-authored-by: TRAE CLI <traecli@bytedance.com>
2026-09-22 18:20:02 +08:00
..
2026-01-29 20:29:19 +08:00