arXiv(opens in a new tab)cs.AIOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.23449

GatewayBench: Unified Capability and Security Evaluation Platform for MCP Gateways

Yitian Zheng, Zhaorun Chen, Haoyu Li, Bo Li

ABSTRACT

AI agents have increasingly interacted with external environments by invoking tools, with Model Context Protocol (MCP) emerging as a standard interface for connecting agents to heterogeneous tools and services. As organizations deploy agents at scale, MCP gateways have become a critical middleware layer for aggregating, governing, and shaping the tool surface exposed to agents. However, gateway design can substantially affect agent behavior: as the number of available tools grows, agents may struggle with tool discovery and selection, leading to degraded task performance, increased computational overhead, and potentially greater exposure to malicious tools. Despite the growing importance of MCP gateways in agentic systems, no prior work has systematically studied how gateway design affects agent capability, efficiency, and security. To address this gap, we introduce GATEWAY-BENCH, the first unified evaluation framework and benchmark for MCP gateways. We characterize gateway architectures into two major paradigms: flattened gateways, which expose the complete set of available tools to the agent upfront, and hierarchical gateways, which provide tool-discovery meta-tools that allow agents to selectively retrieve relevant tools on demand. GATEWAYBENCH comprises 524 tasks across six domains, together with a pool of 11,118 real-world tools from 251 authentic MCP servers. To emulate large-scale deployments, we systematically inject task-irrelevant tools sampled from this pool into each agent environment, enabling controlled evaluation as the accessible tool surface scales. Each task is evaluated using verifiable judges that inspect the resulting environment state quantitatively. Based on GATEWAYBENCH, we conduct extensive experiments across seven widely deployed MCP gateways and diverse agent configurations, covering both benign and adversarial tasks. Our results reveal substantial differences across gateway designs in task completion, tool-use efficiency, and resilience to attacks, and further demonstrate that these effects interact strongly with the underlying model and agent harness. These findings highlight the MCP gateway as a consequential yet underexplored component of the agentic AI stack. By enabling controlled evaluation of gateway architectures under realistic tool ecosystems, GATEWAYBENCH provides both practical guidance for MCP gateway design and a rigorous testbed for developing more capable, efficient, and secure agentic systems.

1 INTRODUCTION

Large language model (LLM) agents are rapidly evolving from single-step tool calling into autonomous systems capable of executing complex, multi-step workflows (Gaurav et al., 2025; Qin et al., 2023; Wu et al., 2023). In practice, the agent's behavior is shaped not only by the underlying model but also by its surrounding harness: the engineering infrastructure that manages the full lifecycle of context, including system prompts, tool execution, memory management, verification, and failure recovery (Anthropic, 2025; OpenAI, 2026; LangChain, 2026).

Within the harness, tool execution is the component that determines how an agent accesses external environments and services. The Model Context Protocol (MCP) (Anthropic, 2024) has emerged as a widely adopted standard for exposing tools to agents. MCP servers can run remotely and expose their

Figure

Figure 1: Overview of the GATEWAYBENCH pipeline. Each sampled benign or malicious task exposes its MCP servers, plus injected task-irrelevant noisy tools, to the agent through the gateway under test. A verifiable judge inspects the final environment state to compute task success rate (TSR), attack success rate (ASR), task time, and tool-call latency.

capabilities over standardized transport protocol, enabling agents to connect to tool providers across the network without managing local dependencies or execution environments (Hou et al., 2026).

In a production LLM agent deployment, however, an organization typically operates multiple agents serving different users and business functions, each connecting to a distinct set of MCP servers. Such distributed management approach, exemplified by personal agents like OpenClaw (OpenClaw, 2026), quickly becomes unsustainable at enterprise scale: agents must independently track server endpoints, manage separate credentials, and absorb any upstream change to a server's tool set or configuration. To resolve this scalability and management challenge, the MCP gateway has emerged as a middleware layer within the agent harness, acting as the unified endpoint between the reasoning model and the external services (AWS, 2026; Arcade, 2026). Existing MCP gateways broadly fall into two types: the flattened gateways which expose the full set of available tools as a single list, and the hierarchical gateways which instead provide tool-discovery meta-tools that let the agent selectively retrieve tools on demand (Figure 2).

Despite its pivotal role in modern agent deployments, the MCP gateway as a core harness component haven’t got enough evaluation yet. In this work, we conduct the first systematic benchmark of MCP gateways to address these critical gaps. Specifically, we aim to answer four core research questions:

• RQ1: How does the number of available tools (including noisy tools) impact agent task success under different gateway architectures?

• RQ2: How do different gateway architectures perform in terms of efficiency, given different numbers of tools?

• RQ3: How do different gateway architectures affect an agent’s resilience to red-teaming attacks, including direct prompt injection and indirect tool- and environment-injection?

• RQ4: How do the underlying LLM’s capability and the agent harness affect an agent’s capability and security under different gateway architectures?

To answer these questions, we introduce GATEWAYBENCH (Figure 1), a comprehensive benchmark designed to evaluate MCP gateways across diverse task domains, different underlying LLM agent, scalable tool-set configurations, and adversarial threat models. GATEWAYBENCH is built upon two existing high-quality agent evaluation datasets: DecodingTrust-Agent Platform (DTAP) (Chen et al., 2026) and MCP-Universe (Luo et al., 2025). Our benchmark extends these foundational datasets with a large-scale, carefully curated pool of noisy, task-irrelevant tools. These noisy tools can be dynamically injected into the agent's environment to simulate realistic scenarios where agents must reason over a large and potentially distracting tool surface, thereby enabling controlled measurement of how gateway architectures influence tool selection robustness and task completion under varying numbers of noisy tools and adversarial conditions.

Across these environments, we then conduct intensive experiments spanning 7 widely-deployed gateway implementations, including 6 open-source gateways and 1 closed-source gateway. For each gateway, we inject up to 1,500 task-irrelevant noisy tools sampled from a curated pool of 11,118 real-world tools across 251 MCP servers, and evaluate the gateway with 3 representative agent settings that combine 2 model tiers (GPT-5.1 and GPT-5.4) with 2 agent harnesses (OpenAI Agents SDK and OpenClaw). Our experiment reveals several key findings:

• Asymmetric Sensitivity to Tool-Set Scaling. Flattened gateways exhibit a subtle degradation in task success as more noisy tools are injected, whereas hierarchical gateways remain largely invariant to the number of injected tools. This divergence is modulated by the agent's underlying reasoning capability. For weaker models, this degradation is insufficient to overcome the overall performance advantage of flattened gateways. For stronger models, however, the hierarchical gateways overtake the flattened ones once many noisy tools are injected.

• Context-Dependent Efficiency Trade-offs. Neither gateway architecture is unconditionally more efficient. When few noisy tools are injected, flattened gateways demonstrate a distinct efficiency advantage by minimizing interaction turns and overall task latency. However, This advantage reverses rapidly as more tools are injected. Flattened gateways suffer from linear growth in token consumption and escalating context-processing latency, whereas hierarchical gateways maintain a token consumption that is largely independent of the number of injected noisy tools. This suggests that hierarchical gateways are more token-efficient and scalable for large-scale MCP deployments.

• Stronger models close the capability gap but not the security gap. Upgrading the underlying model from GPT-5.1 to GPT-5.4 eliminates the benign task performance gap between flattened and hierarchical gateways. Yet a security gap between the two architectures persists: even under the capability-matched GPT-5.4, hierarchical gateways retain substantially lower indirect-attack success, and this gap stems almost entirely from the tool-injection attack.

• Agent harness interacts with gateway design. The choice of agent harness has a meaningful impact on overall performance. OpenClaw (OpenClaw, 2026) consistently outperforms the OpenAI Agents SDK (OpenAI, 2025) across gateways. This underscores that the effectiveness of a gateway design is jointly determined by the agent harness, and practical deployment strategies must co-optimize the gateway architecture and the agent harness as an integrated system.

In summary, our main contributions are as follows:

• We introduce GATEWAYBENCH, the first systematic benchmark for evaluating MCP gateways as a core component of the agent harness. GATEWAYBENCH comprises 524 tasks spanning 6 domains, together with a curated pool of over 11,000 real-world noisy tools from 251 MCP servers, enabling controlled measurement of how gateway design choices shape agent capability, efficiency, and security at scale.

• We formalize a taxonomy of MCP gateway designs (flattened vs. hierarchical), and conduct a comprehensive empirical study of 7 widely deployed gateway implementations under both benign tasks and red-teaming attacks with up to 1,500 injected noisy tools.

• Our findings offer practical guidance for MCP gateway selection and agent deployment: hierarchical gateways provide superior scalability and adversarial robustness as the tool set grows under capable models, whereas flattened gateways are simpler and more efficient for small tool sets. We also emphasize the importance of jointly optimizing the MCP gateway with the rest of the agent harness and the underlying model as an integrated system.

References (33)