On this page

MCP Plugin Configuration Reference

Every option of the Hive Gateway MCP plugin, its type and default.

useMCP(ctx, config) takes the gateway plugin context and an MCPConfig object. The MCPConfig type is exported by @graphql-hive/plugin-mcp so a configuration can be authored and type-checked separately, or loaded from YAML or JSON.

Server options

OptionTypeDefaultDescription
namestring(required)Server name reported in initialize responses
versionstring"1.0.0"Server version reported in initialize responses
titlestringHuman-readable server title
descriptionstringHuman-readable server description
instructionsstringFree-text instructions included in initialize responses, for the model’s context
iconsMCPIcon[]Server icons for client UIs (src, mimeType, sizes, theme)
websiteUrlstringServer website URL
protocolVersionstring"2025-11-25"MCP protocol version to advertise
pathstring"/mcp"HTTP path of the MCP endpoint
logLoggerLogger instance; defaults to the gateway’s logger

Operation sources

OptionTypeDefaultDescription
operationsPathstringA .graphql file, or a directory of them, containing named operations and @mcpTool directives
operationsStrstringThe operations as a raw GraphQL string, as an alternative to a file
loaderMCPOperationsLoaderLoad operations for each MCP request with access to its request and serverContext

Tools, resources and providers

OptionTypeDefaultDescription
toolsMCPToolConfig[][]Tool definitions; see Tools
resourcesMCPResourceConfig[][]Static resources; see Resources
resourceTemplatesMCPResourceTemplateConfig[][]Resource templates with URI patterns and handlers
providersobjectDescription providers by name, e.g. { langfuse: {} } or a custom DescriptionProvider
suppressOutputSchemabooleanfalseOmit the output schema from every tool in tools/list

Tool definition

Each entry of tools is an MCPToolConfig:

FieldTypeDescription
namestringUnique tool name exposed to clients (required)
sourceMCPToolSource{ type: "inline", query } or { type: "graphql", operationName, operationType, file? } (required)
toolMCPToolOverridestitle, description, descriptionProvider, annotations, icons, execution.taskSupport, _meta
inputMCPInputOverridesschema.properties.<variable> with description, examples, default, alias, hidden, descriptionProvider
outputMCPOutputOverridespath, schema: false, contentAnnotations, descriptionProviders
hooksMCPToolHookspreprocess(args, context) and postprocess(result, args, context); the context carries toolName, headers and query

Directives

Available in operation files loaded through operationsPath, operationsStr or a loader:

DirectivePlacementArgumentsEffect
@mcpToolOperationname, description, descriptionProvider, metaRegisters the operation as a tool
@mcpDescriptionVariable or selected fieldprovider (<provider>:<prompt> or <provider>:<prompt>:<version>)Sets a dynamic description for the variable or output field
@mcpHeaderVariablenameHides the variable from the input schema and fills it from the named HTTP request header