Skip to content

Feat: Add MCP Gateway support with tool prefix namespacing#14

Open
kellyaa wants to merge 2 commits intokagenti:mainfrom
kellyaa:add_mcp_gateway
Open

Feat: Add MCP Gateway support with tool prefix namespacing#14
kellyaa wants to merge 2 commits intokagenti:mainfrom
kellyaa:add_mcp_gateway

Conversation

@kellyaa
Copy link
Copy Markdown
Contributor

@kellyaa kellyaa commented Apr 28, 2026

Summary

  • Add --use-mcp-gateway flag to deployment and evaluation scripts to route MCP traffic through the MCP Gateway instead of connecting directly to benchmark MCP servers
  • deploy-benchmark.sh creates an HTTPRoute and MCPServerRegistration CR to register the MCP server with the gateway
  • deploy-agent.sh points the agent at the gateway service when the flag is set
  • evaluate-benchmark.sh port-forwards the gateway and sets EXGENTIC_MCP_TOOL_PREFIX so the runner prepends the gateway-assigned prefix (e.g. exgentic_) to every MCP tool call
  • deploy-and-evaluate.sh propagates the flag to all sub-scripts and supports USE_MCP_GATEWAY=true in .env
  • Python runner gains mcp_tool_prefix config field and MCPClient._tool_name() helper that transparently prefixes list_tasks, create_session, evaluate_session, and delete_session calls
  • Updated example.env with MCP Gateway configuration section
  • Updated README with MCP Gateway documentation

Related issue(s)

(Optional) Testing Instructions

  • Without gateway (no behavior change): Run ./deploy-and-evaluate.sh --benchmark tau2 --agent tool_calling and verify evaluation completes as before
  • With gateway: Run ./deploy-and-evaluate.sh --benchmark tau2 --agent tool_calling --use-mcp-gateway and verify:
    • deploy-benchmark.sh creates the HTTPRoute and MCPServerRegistration resources (kubectl get httproutes,mcpserverregistrations -n team1)
    • deploy-agent.sh sets MCP_URL to the gateway endpoint
    • evaluate-benchmark.sh port-forwards the gateway on localhost:7770 and sets EXGENTIC_MCP_TOOL_PREFIX=exgentic_
    • Tool calls in the runner use prefixed names (visible at DEBUG log level)
  • Env file: Set USE_MCP_GATEWAY=true in .env and confirm deploy-and-evaluate.sh picks it up without the CLI flag

Fixes #

Signed-off-by: Kelly Abuelsaad <kna@us.ibm.com>
@kellyaa
Copy link
Copy Markdown
Contributor Author

kellyaa commented Apr 28, 2026

@yoavkatz

@yoavkatz
Copy link
Copy Markdown
Contributor

Great. I'll try it out. I'm still closing on the baseline results (removing bottlenecks for scalability). If we could get it some insights from running with and without it , for the presention on Monday. It will really drive the message.

A few questions:

  1. Do we need to clean up thr routes at the end of the run?
  2. Does the code support multiple benchmarks at a time? Do we need the took prefix include the benchmark name?

Signed-off-by: Kelly Abuelsaad <kna@us.ibm.com>
@kellyaa
Copy link
Copy Markdown
Contributor Author

kellyaa commented Apr 29, 2026

I added cleanup to the script. I noticed however, that adding the gateway affects the performance of the agent. It stalls after the first response. I'm not quite sure what happens.. the logs are not informative.. Here is the trace on mlflow. Could there be any discrepancies with prefixing the tool name and how the exgentic mcp server expects the tool names to be called... ?

image

Does the code support multiple benchmarks at a time? Do we need the took prefix include the benchmark name?

Tool prefix is totally arbitrary. If we want to run different bechmarks at a time, we can kick them off in parallel with different prefixes in the config for each

@kellyaa
Copy link
Copy Markdown
Contributor Author

kellyaa commented Apr 29, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

3 participants