hexr.gateway gives your agents access to a curated set of external tools — web search, messaging, weather, and any API you register — without handling API keys in your code. When you invoke a tool, the Gateway validates the arguments, fetches the required API key from Vault using your agent’s SPIFFE identity, and proxies the HTTP request to the external service. Pre-loaded tools are available immediately; you can extend the catalog by registering OpenAPI specifications.
Quick start
GatewayClient
For explicit configuration, instantiateGatewayClient directly:
The Gateway endpoint is discovered automatically from the environment set by
hexr deploy. You don’t need to provide a URL — the SDK connects to the correct service for your deployment (Cloud or self-hosted).Methods
List available MCP tools. Results are cached for performance.Returns:
list[Tool]Get a specific tool definition with its parameters and description.Returns:
ToolFind tools using semantic search. Useful when you know what you want to do but not the exact tool name.Returns:
list[SearchResult]Invoke a tool with the given arguments.Returns:
ToolResultInvoke a tool via the raw MCP JSON-RPC 2.0 protocol. Use this when building MCP-compatible integrations.
Register tools from an OpenAPI specification. The Gateway converts each operation into a callable tool.Returns:
list[str] (registered tool names)Decorators
@mcp_tool
Route a function call through the MCP Gateway by name. The function body is ignored — the Gateway handles the actual execution:@discover_tools
Auto-bind gateway tools as methods on a class, filtered by prefix:Tool types
How it works
Agent calls call_tool()
Your agent calls
call_tool("brave_web_search", {"query": "..."}) via the Gateway SDK.Gateway looks up tool definition
The Gateway resolves the tool name to its registered definition and validates the arguments against the parameter schema.
Fetch credentials from Vault
The Gateway requests the API key for Brave Search from Hexr Vault using its SPIFFE identity.
Proxy request to external API
The Gateway sends
GET /search?q=... to the Brave API with the injected API key header.Pre-loaded tools
The Gateway ships with tools from three embedded OpenAPI specs. These are available without any registration:| Source | Tools | Examples |
|---|---|---|
| Brave Search | 2 | brave_web_search, brave_local_search |
| Slack | 5 | slack_post_message, slack_list_channels, … |
| OpenWeatherMap | 6 | weather_current, weather_forecast, … |