mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
The hub serves 94 tools across 23 categories, write tools included, and enabling the ExApp switches every category on. That surface was published on the public vhost and every discovered client was handed an app password for it. svc-ai-mcp-adapter now sits in front in mcp_passthrough mode: clients present credentials.mcp_bearer to contextagentmcp and reach the nine read tools of calendar, contacts and files, which files/mcp/tools.json names and the sidecar enforces per call. Those three categories are the ones whose upstream is_available is unconditional, so the served set does not vary with which optional apps a deployment installs.
Enforcing it in the sidecar rather than in each client is what makes it hold: web-app-openwebui renders no per-tool filter at all, so a client-side include list would have bounded two consumers out of three.
06c13e7f3e withdrew the declared path from the edge for exactly this reason - "that surface is what the adapter exists to narrow". Nextcloud answers the same route under a second spelling, without the /index.php front controller, which try_files rewrites back onto the route after the edge has already declined to block it. The withdrawal becomes a regex covering both, and only where stripping the front controller changes the path, so the four adapter providers without one render unchanged.
The app password is minted after the stack renders, so it reaches the sidecar through upstream.env and rebuild.yml rather than the compose environment: compose up resolves env_file while creating the container, a restart does not. The sidecar is the last service in the template because a Jinja set has no block scope and its env_file would otherwise displace the one talk, whiteboard and talk_recording each carry.
Two suites cover what nothing measured: the vhost template rendered without a container, asserting both spellings are withdrawn, and every shipped tools.json loaded through the adapter own loader, so a bad contract fails in a second instead of as a probe timing out an hour into a deploy. The guest spec probed mcp.endpoint.path, which this change makes the proxy answer 404 for its own reasons; it now probes all three public paths and requires no MCP body.
Not yet deployed: the sidecar build, the upstream.env delivery and the hub answering exactly nine tools are unverified against a running stack.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
21 lines
883 B
JavaScript
21 lines
883 B
JavaScript
const { decodeDotenvQuotedValue } = require("./personas");
|
|
const { registerMcpDisabledState, registerMcpGuestRejection } = require("./mcp-endpoint");
|
|
|
|
const mcpEndpointPath = decodeDotenvQuotedValue(process.env.NEXTCLOUD_MCP_ENDPOINT_PATH);
|
|
const mcpUpstreamPath = decodeDotenvQuotedValue(process.env.NEXTCLOUD_MCP_UPSTREAM_PATH);
|
|
|
|
const withoutFrontController = (path) => path.replace(/^\/index\.php/, "");
|
|
|
|
exports.register = function (shared) {
|
|
const url = (path) => new URL(path, shared.env.nextcloudBaseUrl).toString();
|
|
|
|
registerMcpGuestRejection(() => url(mcpEndpointPath), "the adapter endpoint");
|
|
registerMcpGuestRejection(() => url(mcpUpstreamPath), "the hub route");
|
|
registerMcpGuestRejection(
|
|
() => url(withoutFrontController(mcpUpstreamPath)),
|
|
"the hub route without its front controller",
|
|
);
|
|
|
|
registerMcpDisabledState(() => url(mcpEndpointPath));
|
|
};
|