Summary
Data Machine should manage MCP server lifecycle so plugins don't spawn fresh servers per request. Start the server once, keep it running, provide a connection pool that any plugin can use.
Problem
Intelligence spawns a new npx @automattic/mcp-context-a8c process for every connect() call via proc_open. Each spawn takes ~90s (npx startup + MCP handshake through AutoProxxy). Old servers are left orphaned. This makes the CLI unusable.
Connection caching within a single PHP process helps (chubes4/intelligence@eac5fc5), but each studio wp invocation is a separate PHP process that pays the full 90s startup.
Proposed Solution
A DM-managed MCP connection layer:
- Server lifecycle — Start MCP servers on first use, keep running as background processes. Track PID + connection state. Restart on crash.
- Connection pool — Plugins register MCP server configs. DM manages connections.
$client = datamachine_mcp_connect('context-a8c') returns a ready-to-use client.
- Transport upgrade — When MCP servers support HTTP/SSE transport, DM can connect via cURL instead of proc_open, eliminating WASM spawn complexity entirely.
Why Data Machine
This is a platform concern, not Intelligence-specific:
Related
Summary
Data Machine should manage MCP server lifecycle so plugins don't spawn fresh servers per request. Start the server once, keep it running, provide a connection pool that any plugin can use.
Problem
Intelligence spawns a new
npx @automattic/mcp-context-a8cprocess for everyconnect()call viaproc_open. Each spawn takes ~90s (npx startup + MCP handshake through AutoProxxy). Old servers are left orphaned. This makes the CLI unusable.Connection caching within a single PHP process helps (chubes4/intelligence@eac5fc5), but each
studio wpinvocation is a separate PHP process that pays the full 90s startup.Proposed Solution
A DM-managed MCP connection layer:
$client = datamachine_mcp_connect('context-a8c')returns a ready-to-use client.Why Data Machine
This is a platform concern, not Intelligence-specific:
Related