Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.
This repository was archived by the owner on May 29, 2026. It is now read-only.

AI companion: implement the MCP tool MVP for openbuilt #13

Description

@rubenvdlinde

Goal

Expose openbuilt's app-builder surface (schemas, pages, exports) to the in-app AI Chat Companion via an IMcpToolProvider.

Suggested MVP tool set

Tool id Purpose
openbuilt.listApps List apps the caller is building
openbuilt.getAppManifest Get one app's manifest (schemas, pages, RBAC)
openbuilt.createSchema Add a schema to an app (user schema → per-app openbuilt-{slug} register)
openbuilt.addPage Add a page to an app's manifest
openbuilt.listTemplates List marketplace templates available to import
openbuilt.exportToRealApp Trigger export of an openbuilt app to a real Nextcloud app

Respects openbuilt's hybrid register model (system schemas in shared openbuilt, user schemas in per-app openbuilt-{slug}). openbuilt is early-stage — start with the read tools (listApps, getAppManifest, listTemplates) if the write surfaces aren't built yet.

Background

ADR-034 defines the cross-app AI Chat Companion: a floating widget shipped from @conduction/nextcloud-vue (auto-mounts via CnAppRoot) that talks to OpenRegister's orchestrator at runtime. Apps expose their own capabilities to the in-app AI by implementing OCA\OpenRegister\Mcp\IMcpToolProvider (3 methods: getAppId(), getTools(), invokeTool($toolId, $arguments)), registered in lib/AppInfo/Application.php under the DI alias OCA\OpenRegister\Mcp\IMcpToolProvider::{appId}.

ADR-035 makes a per-app provider the fleet expectation: every app with a user-actionable surface ships a provider or records an opt-out in openspec/project.md.

Reference implementation: decidesk/lib/Mcp/DecideskToolProvider.php (5 tools, full auth design) + decidesk/tests/Stubs/Mcp/IMcpToolProvider.php (stub used until openregister PR #1466 ships the real interface).

Dependency

The real IMcpToolProvider interface ships in openregister PR #1466 (ai-chat-companion-orchestrator). Until that merges, apps implement the stub (see decidesk's tests/Stubs/Mcp/IMcpToolProvider.php); the stub no-ops when the real OR interface is present.

Definition of done (MVP)

  • lib/Mcp/{AppName}ToolProvider.php implements IMcpToolProvider with the tool set below
  • Each tool: validates arguments, runs per-object authorisation before business logic (OWASP A01:2021 / ADR-005 — no unconditional return true, no catch(\Throwable) swallowing the verdict), delegates to the app's existing services
  • Tool ids namespaced {appId}.{toolName}
  • Registered in lib/AppInfo/Application.php under alias OCA\OpenRegister\Mcp\IMcpToolProvider::{appId}
  • tests/Stubs/Mcp/IMcpToolProvider.php present (copy decidesk's, adjust namespace/package)
  • Unit test asserting the tool catalogue (ids, descriptions, inputSchema)
  • Widget mounted: app consumes @conduction/nextcloud-vue with CnAppRoot (FAB auto-renders when OR is reachable, no-renders otherwise — no install-time OR dep)
  • ### MCP coverage section added to the proposal that lands this (per ADR-035)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions