MCP Support Overview
You can expose a worker's capabilities to Model Context Protocol (MCP) clients such as Claude and ChatGPT. You declare a tool or a resource, implement one method, and the framework serves it over MCP — you never touch the protocol, transports, or content blocks.
MCP support is available from @picsart/pa-pluggable-workers-core 7.6.0.
What you can build
- Tools — actions a client can call. A tool orchestrates the
tasks you've already built (via
flow.executeTask). - Resources — read-only content a client can read.
Enabling MCP
MCP is off by default. Enable it in two steps.
1. Set the flag in src/config/application.yaml:
mcp:
enabled: true
2. Import the module in your app module, alongside RestModule:
import { CoreModule, RestModule, McpModule } from '@picsart/pa-pluggable-workers-core';
@Module({
imports: [CoreModule, RestModule, McpModule.forRoot()],
})
export class RestAppModule {}
When the flag is off, the module is inert — /mcp is not mounted and existing
workers are unaffected.
Connecting a client
The worker exposes MCP over stateless Streamable HTTP at POST /mcp. Through the
API gateway, clients connect at:
POST /<mcpServerName>/mcp
<mcpServerName> resolves to your worker by the pa-<mcpServerName>-pluggable-worker
naming convention. The gateway forwards the caller's identity, so tools run as the
authenticated user just like the REST and Kafka APIs.