Veyra Harness: A Local Agent Runtime with Dynamic MCP Tool Discovery and Human-in-the-Loop Control
Local agent workstations operate directly on a user's files, shell, and network, which makes extensibility and controllability difficult to reconcile. This paper presents Veyra Harness, a local-first agent runtime developed by the authors, and describes how it incorporates the Model Context Protocol (MCP) as a dynamic tool source. The runtime performs tool discovery at the beginning of every reasoning turn: tool lists from all enabled MCP servers are translated into function-calling schemas and merged with a registry of ten built-in tools. Two transports (stdio and HTTP) are unified behind a short-lived session abstraction, with a 12-second handshake timeout and a 60-second invocation timeout. Built-in and MCP tools share a single dispatch path and approval state machine; because the runtime cannot infer the side effects of third-party tools, MCP tools are treated as write-risk by default. A repair routine inserts explicit error results for interrupted calls, preserving the tool-call/tool-result pairing that model APIs require. The implementation comprises 5,123 lines of server-side JavaScript, 14,814 lines of front-end code, and 58 automated tests that all pass, including an end-to-end case that drives a real MCP tool through the complete agent loop. An evaluation protocol is specified for task completion, protocol errors, approval burden, and sandbox breaches. The design is bounded by a per-call handshake cost, a fixed protocol version (2024-11-05), and the absence of an execution sandbox around MCP tools. These limitations and possible remedies are discussed. 本地智能体工作台直接操作用户的文件、命令行与网络,其扩展性与可控性之间存在张力。本文作者介绍并实现了 Veyra Harness——一个将模型上下文协议(MCP)作为动态工具源的本地优先智能体运行时。系统在每轮推理开始时执行工具发现:把所有已启用 MCP 服务器的工具清单转译为函数调用描述,并与内置的十个工具合并。stdio 与 HTTP 两种传输被统一到一套短生命周期会话接口中,握手超时 12 秒,调用超时 60 秒。内置工具与 MCP 工具共用同一条分派路径和审批状态机;由于运行时无法推断第三方工具的副作用,MCP 工具默认按写风险处理。针对中断的调用,系统补入明确的错误结果,以维持模型接口要求的消息配对关系。系统实现包含服务端代码 5123 行、前端代码 14814 行,以及 58 个自动化测试用例,全部通过,其中包含一个驱动真实 MCP 工具走完整个智能体循环的端到端用例。文中给出了覆盖任务完成率、协议错误率、审批负担与越界拦截率的评价方案。该设计受限于每次调用的握手开销、固定的协议版本(2024-11-05),以及 MCP 工具缺乏执行沙箱。文章讨论了这些局限及可能的改进方向。
Authors
- Xingze Li
Institutions
- Harbin Cambridge University (CN)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-16
- DOI
- https://doi.org/10.5281/zenodo.24281464
- Primary Topic
- Artificial Intelligence Applications
- Type
- article
- Field-Weighted Citation Impact
- 0.00