mcp-grpc client
mcp-grpc client
The mcp-grpc client binding reads a protobuf service definition from a catalog and generates one MCP tool for each unary gRPC method. The tool inputSchema and outputSchema are derived from the request and response messages, so tools/list needs no hand-authored tool list.
A tools/call converts the JSON arguments to the protobuf request message, dispatches the gRPC call, and converts the protobuf reply back to JSON. A reply status other than OK that arrives before any reply data is returned as a tool result with isError set, such as NOT_FOUND: unknown table.
Only unary methods are exposed. Streaming methods are not surfaced as tools.
The generated grpc client is routed to the engine client exit, which defaults to sys:http_client. Use the zilla.binding.mcp.grpc.client.exit property to route it to another http client binding, such as one with explicit h2 versions or an upstream tcp or tls client.
mcp_grpc_client:
type: mcp-grpc
kind: client
options:
server: http://inventory:4004
catalog:
inventory_catalog:
subject: inventory
version: latest
authorization:
my_guard:
credentials:
headers:
authorization: Bearer {credentials}
tools:
get_item:
title: Get inventory item
description: Look up a single inventory item by SKU.
annotations:
readOnlyHint: true
routes:
- when:
- tool: get_item
with:
method: acme.inventory.v1.InventoryService/GetItem
- with:
method: acme.inventory.v1.InventoryService/ListItemsConfiguration (* required)
options
object
The mcp-grpc specific options.
options:
server: http://inventory:4004
catalog:
inventory_catalog:
subject: inventory
version: latest
authorization:
my_guard:
credentials:
headers:
authorization: Bearer {credentials}
tools:
get_item:
title: Get inventory item
description: Look up a single inventory item by SKU.
annotations:
readOnlyHint: trueoptions.server*
string
Upstream gRPC server URL. The scheme and authority are used as the :scheme and :authority of every gRPC request.
options.catalog*
objectas map of namedobjectproperties
Catalog subject resolving the protobuf service definition. Exactly one catalog may be referenced. The named key references a catalog defined elsewhere in the configuration.
catalog.subject*
string
Subject name identifying the .proto schema in the named catalog.
catalog.version
string| Default:latest
Specific version of the registered schema.
options.authorization
objectas map of namedobjectproperties
Guard credentials to inject into the upstream gRPC request as metadata. The named key references a guard defined elsewhere in the configuration. At most one guard may be referenced.
authorization.credentials*
object
Credentials derived from the named guard.
credentials.headers*
objectas map of namedstringproperties
gRPC metadata added to the upstream request, with values resolved from the guarded session. At least one header is required.
{credentials}Replaced with the raw credentials presented to the named guard.{identity}Replaced with the authorized identity resolved by the named guard.
A metadata key must be lowercase and cannot start with grpc-, end with -bin, or be one of the reserved te, content-type, user-agent, or service-name.
credentials:
headers:
authorization: Bearer {credentials}
x-user-identity: "{identity}"options.tools
objectas map of namedobjectproperties
Presentation overrides for generated tools. The named key is the tool name, either the generated default or one named by a route when.tool.
Unless renamed by a route, the default tool name is the fully qualified gRPC method name made MCP friendly, such as acme_inventory_v1_inventory_service_get_item for acme.inventory.v1.InventoryService/GetItem, with a numeric suffix when two methods would otherwise share a name (see routes).
tools.title
string
Tool title surfaced to MCP clients by tools/list. Unlike tools.description, there is no fallback — a tool with no authored title has none.
tools.description
string
Tool description surfaced to MCP clients by tools/list.
tools.summary
string
Literal result summary surfaced as the tool-call text result. When set, the tool-call result carries the converted reply as structuredContent and this summary as the text content. When unset, the converted reply is returned as escaped JSON text content instead.
tools.annotations
object
Behavior hints surfaced to MCP clients by tools/list. There is no default derived from the gRPC method — a hint left unset here is simply absent. Each hint resolves independently — overriding one does not require overriding the others.
annotations:
readOnlyHint: false
destructiveHint: false
idempotentHint: falseannotations.readOnlyHint
boolean
Whether the tool only reads data without modifying any state.
annotations.destructiveHint
boolean
Whether the tool may perform a destructive update.
annotations.idempotentHint
boolean
Whether calling the tool repeatedly with the same arguments has no additional effect beyond the first call.
annotations.openWorldHint
boolean
Whether the tool interacts with an open-ended set of external entities, rather than a fixed, closed set.
routes*
arrayofobject
Conditional mcp-grpc specific routes, selecting which gRPC methods are exposed as tools. At least one route is required, so a method is exposed only when a route selects it.
Routes are evaluated in order and a method is claimed by the first route that matches it. A route with neither with.method nor with.option matches every unary method not already claimed.
A method selected without an explicit when[].tool gets the default tool name. When two methods get the same default name, the first keeps it and each later one takes a numeric suffix, such as acme_inventory_v1_inventory_service_get_item_2. A default name that collides with an explicit when[].tool name takes the suffix, so the explicit name is never changed. Two routes that give the same explicit name to different methods are a conflict, and neither tool is exposed. A tool whose name is not 1 to 64 characters of letters, digits, _, or - is also not exposed.
routes:
- when:
- tool: get_item
with:
method: acme.inventory.v1.InventoryService/GetItem
- guarded:
my_guard:
- inventory:write
with:
method: acme.inventory.v1.InventoryService/*routes[].guarded
objectas map of namedarrayofstring
Roles required by the named guard. The MCP session must be authorized for the listed roles to call a tool matched by this route. A tools/call for a tool the session is not authorized for is rejected, the same as a tool that does not exist. tools/list is not filtered per session.
routes[].when
arrayofobject
At most one condition to match this route. A route with a when condition pins and names a single tool, so its with.method must name exactly one method, with no wildcard. Read more: When a route matches
routes:
- when:
- tool: get_item
with:
method: acme.inventory.v1.InventoryService/GetItemwhen[].tool*
string| Pattern:^[A-Za-z0-9_-]{1,64}$
Tool name given to the method selected by with, overriding the default generated name. Must be 1 to 64 characters of letters, digits, _, or -.
routes[].with
object
Selects the gRPC methods matched by the route. Specify either method or option, never both.
with.method
string| Pattern:^[A-Za-z0-9_.*]+/[A-Za-z0-9_*]+$
Method name or glob pattern, in the form package.Service/Method. A * may stand in for any part, such as acme.inventory.v1.InventoryService/* for every method of one service. A route with a when condition requires an exact method with no *.
with:
method: acme.inventory.v1.InventoryService/*with.option
objectas map of namedstring,number,booleanproperties
Protobuf method options that must match for the route to select a method, such as a custom option declared in the .proto. At least one option is required.
with:
option:
acme.audience: readonlytelemetry
object
Defines the desired telemetry for the binding.
telemetry.metrics
array
Telemetry metrics to track
telemetry:
metrics:
- stream.*telemetry.attributes
objectas map of namedstringproperties
Telemetry attributes to add to the binding metrics.

