Summary
Add a dedicated create_component tool to the Neural Link MCP server that provides a first-class, schema-validated interface for agents to dynamically create components within live Neo.mjs applications at runtime.
A2A Context (Fat Ticket Protocol)
Agent: Claude Opus 4.6 (Antigravity)
Session Origin: Multi-Window Agent Shell architecture session
Problem
Currently, runtime component creation via Neural Link requires agents to use the generic call_method tool (e.g., calling container.add() on a target container). This works but lacks:
- Schema validation — no enforcement that the component config is valid before dispatching
- Window targeting — in multi-window SharedWorker apps, the agent must manually resolve which window's container to target
- Error handling —
call_method returns raw errors with no semantic context about what went wrong
- Discoverability — agents must know the internal API (
container.add()) rather than expressing intent
Proposed Solution
Add a dedicated create_component tool to the Neural Link MCP server that:
- Accepts a component config (
ntype/module, properties) and a target container ID
- Validates the config against known class blueprints (via
inspect_class)
- Handles multi-window routing via the existing SharedWorker bridge
- Returns the created component's ID and serialized state
- Supports optional
windowId parameter for explicit window targeting
Tool Schema (Draft)
{
"name": "create_component",
"parameters": {
"containerId": "string (required) — ID of the target container",
"config": "object (required) — Neo.mjs component config (ntype, text, items, etc.)",
"index": "number (optional) — insertion index within the container's items",
"windowId": "string (optional) — target window in multi-window apps",
"sessionId": "string (optional) — App Worker session ID"
}
}
Architectural Context
- Bridge.mjs (
ai/mcp/server/neural-link/Bridge.mjs) — WebSocket hub between App Workers and agents
- InstanceService (
src/ai/client/InstanceService.mjs) — callMethod() at line ~85-130 is the current workaround
- Related: #9535 (conversational UIs concept), #9671 (agent evolution roadmap)
- Dependency: None — additive to the existing NL tool surface
Pitfalls Identified
- Component creation must go through the App Worker, not the Main Thread — the bridge must route correctly
- The created component needs to be registered in
Neo.manager.Component for subsequent NL queries to find it
- If
useSharedWorkers: true, the creation must be dispatchable to a specific window's DOM
- Must handle both
ntype-based (lazy) and module-based (explicit import) component resolution
Acceptance Criteria
Summary
Add a dedicated
create_componenttool to the Neural Link MCP server that provides a first-class, schema-validated interface for agents to dynamically create components within live Neo.mjs applications at runtime.A2A Context (Fat Ticket Protocol)
Agent: Claude Opus 4.6 (Antigravity) Session Origin: Multi-Window Agent Shell architecture session
Problem
Currently, runtime component creation via Neural Link requires agents to use the generic
call_methodtool (e.g., callingcontainer.add()on a target container). This works but lacks:call_methodreturns raw errors with no semantic context about what went wrongcontainer.add()) rather than expressing intentProposed Solution
Add a dedicated
create_componenttool to the Neural Link MCP server that:ntype/module, properties) and a target container IDinspect_class)windowIdparameter for explicit window targetingTool Schema (Draft)
{ "name": "create_component", "parameters": { "containerId": "string (required) — ID of the target container", "config": "object (required) — Neo.mjs component config (ntype, text, items, etc.)", "index": "number (optional) — insertion index within the container's items", "windowId": "string (optional) — target window in multi-window apps", "sessionId": "string (optional) — App Worker session ID" } }Architectural Context
ai/mcp/server/neural-link/Bridge.mjs) — WebSocket hub between App Workers and agentssrc/ai/client/InstanceService.mjs) —callMethod()at line ~85-130 is the current workaroundPitfalls Identified
Neo.manager.Componentfor subsequent NL queries to find ituseSharedWorkers: true, the creation must be dispatchable to a specific window's DOMntype-based (lazy) andmodule-based (explicit import) component resolutionAcceptance Criteria
create_componenttool registered in NL MCP serverget_component_treeresultsuseSharedWorkers: true