Zum Inhalt springen

MCP Server Integration

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

When FlowMCP runs as an MCP Server, each Tool may be exposed to the agent with MCP-specific metadata that an MCP host can read before it decides whether and how to invoke the Tool. That metadata is declared optionally, per Tool, in a meta block, and the CLI/Core translates the relevant fields into MCP annotations at registration time. This page describes the meta block, how its fields map to MCP, and the behaviour of the search-related and loading-related fields.


A Tool MAY declare a meta block. It is optional — a Tool without a meta block is valid. When a meta block IS present, it MUST be complete: all fields below are required (VAL101–VAL106).

export const schema = {
main: { /* ... */ },
tools: {
getSmartContractAbi: {
description: 'Get the ABI for a verified smart contract',
parameters: { /* ... */ },
meta: {
isReadOnly: true,
isConcurrencySafe: true,
isDestructive: false,
searchHint: 'contract ABI ethereum smart contract',
aliases: [ 'getAbi' ],
alwaysLoad: false
}
}
}
}

The meta block is optional, but when present every field below is required:

FieldTypeRequiredDescription
isReadOnlybooleanYes (VAL101)Tool does not modify any state
isConcurrencySafebooleanYes (VAL102)Safe to call concurrently
isDestructivebooleanYes (VAL103)Tool can cause irreversible changes
searchHintstringYes (VAL104)Keywords for ToolSearch (not empty)
aliasesstring[]Yes (VAL105)Alternative names for ToolSearch
alwaysLoadbooleanYes (VAL106)Always register with MCP (bypass lazy loading)

When a Tool is registered with an MCP Server, the loading- and search-related meta fields are translated to MCP annotations:

FlowMCP FieldMCP Annotation
meta.alwaysLoad_meta['anthropic/alwaysLoad']
meta.searchHint_meta['anthropic/searchHint']

This translation happens at registration time in the FlowMCP CLI/Core. Schema authors set the FlowMCP-side fields; the annotation shape is produced by the registration step.

alwaysLoad: true should be used sparingly:

  • true: Tool is almost always needed in any session (e.g., a core utility tool).
  • false (default): Tool is loaded on demand via ToolSearch.

Excessive alwaysLoad: true pollutes the agent’s active tool list and degrades performance, so the default of lazy loading is the right choice for most Tools.

aliases lets ToolSearch find a Tool by alternative names. If an agent searches for getAbi, ToolSearch finds getSmartContractAbi because getAbi is in its aliases array. An empty array [] is valid and simply means the Tool declares no aliases.

The structural rules for the meta block are defined alongside the other schema rules in 09-validation-rules.md; they are listed here for reference at the point of use:

CodeSeverityRule
VAL100errormeta block is optional; when present it MUST be a plain object (absent meta is allowed)
VAL101errormeta.isReadOnly required (boolean)
VAL102errormeta.isConcurrencySafe required (boolean)
VAL103errormeta.isDestructive required (boolean)
VAL104errormeta.searchHint required (string, not empty)
VAL105errormeta.aliases required (string[])
VAL106errormeta.alwaysLoad required (boolean)