Skip to main content
版本:v2.0.0

MCP (Model Context Protocol) connector

Audience: operators bridging EventMesh with MCP (Model Context Protocol). MCP server bridge over JSON-RPC 2.0. Source receives server-initiated notifications (e.g. resource updates) on an HTTP endpoint; sink forwards each CloudEvent to an MCP server as a JSON-RPC request.


Classes

DirectionClassBehavior
Sourceorg.apache.eventmesh.connector.mcp.source.McpSourceConnectorJDK HttpServer on connector.port+connector.path accepts JSON-RPC notifications; each becomes a CloudEvent (type = mcp.<method>) and poll() drains them.
Sinkorg.apache.eventmesh.connector.mcp.sink.McpSinkConnectorPOSTs a JSON-RPC 2.0 request per CloudEvent (method = connector.method, params = event payload) to connector.mcpServerUrl; non-2xx throws → no ACK → redelivery.

Source configuration

KeyDefaultDescription
connector.port8096HTTP listen port
connector.path/mcpHTTP listen path

Sink configuration

KeyDefaultDescription
connector.mcpServerUrlhttp://localhost:3333/mcpMCP server endpoint
connector.methodeventmesh.notifyJSON-RPC method to invoke
connector.timeoutMs10000Request timeout in ms

Running

bin/start-connector.sh with -Dconnector.class=...McpSinkConnector -Dconnector.mode=sink -Dconnector.mcpServerUrl=http://mcp:3333/mcp