feat(deployments): add ocis-mcp-server to the ocis_full example#12603
feat(deployments): add ocis-mcp-server to the ocis_full example#12603dj4oC wants to merge 5 commits into
Conversation
Adds an optional ocis-mcp-server service (toggled via OCIS_MCP=:mcp.yml in .env, same pattern as the other optional services in this example) so a user can run the MCP server as part of the docker-compose stack instead of building and running it locally against the deployment by hand. Signed-off-by: David Walter <david.walter@kiteworks.com>
Signed-off-by: David Walter <david.walter@kiteworks.com>
…CP app token Signed-off-by: David Walter <david.walter@kiteworks.com>
Signed-off-by: David Walter <david.walter@kiteworks.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Signed-off-by: David Walter <david.walter@kiteworks.com>
|
@dj4oC Important: if these envvars are docker only, they MUST be named differerntly. Otherwise this confuses the naming rules for envvars used in ocis. @kobergj fyi |
This must be reflected in agents.md please open a PR if there is a rule to apply |
|
Some notes:
I don't think we can do much about those at the moment. In any case, I'm worried about the token expiration. Once the token expires, what are the next steps? Without any additional info, I'd guess it's switch off the service, replace the password and then switch on the service again with the new password. If this is the case, why not expiring the password much earlier (1 month or even less) at least to reduce the password exposure? For the PR itself, I think it's fine. |
|
@mmattel the OCIS_MCP envvars are from a different project (ocis-mcp). Though envvar naming is not ideal from our point of view, we will and can not document external envvars. This PR is only about adding the MCP server to the ocis full example, not about discussing its functionality. @jvillafanez what Passwords and secrets do you mean? I didn't see any defaults, envvars are empty by default. I'm strongly against using default passwords. They WILL be reused in production environments. Looks good from my side. I don't mind adding the MCP to the ocis_full. |
|
@kw-fscheuer may I ask for a review please whether we can ship it bundled? |
You'll have to write the app token in the docker-compose file. If someone gets access to the host where the file is or get access to the container, the token will get exposed; and it will likely refer to the admin (or admin-like) account. As said, I don't think we can do much about it at the moment. Maybe we can try to use the mcp as a bridge: you use your oCIS account in the agent so it sends the credentials when interacting with the mcp. Basically, "as agent, I want the mcp to use these credentials for all the requests the agent sends to the mcp". However, this needs changes in the mcp server. In addition, since you're kind of expected to use an admin account for the mcp server, does it means that any agent would have admin information? Do we have some safety net to prevent regular users (using agents) to access such information? I'm not entirely sure how the mcp server works. |
Problem
Using the oCIS MCP Server (https://github.com/owncloud/ocis-mcp-server) against a local
ocis_fulldeployment currently requires building or downloading the server separately,then manually configuring it to point at the running stack. There's no way to just turn
it on as part of the example the same way you'd turn on Collabora, ClamAV, or Keycloak.
Solution
Adds
mcp.yml, a new optional compose fragment following the same pattern as the otheroptional services in this example (
tika.yml,clamav.yml,keycloak.yml, ...). It runsthe
owncloud/ocis-mcp-serverimage with the HTTP transport, fronted by the existingTraefik reverse proxy on a new subdomain (
mcp.owncloud.testby default, same TLS handlingas every other service here).
Toggle it on with
OCIS_MCP=:mcp.ymlin.env. Two things must be configured before itstarts serving real tool calls:
OCIS_MCP_HTTP_SECRET— required whenever the service is enabled; the container itselfrefuses to start without it, since the HTTP endpoint executes tools with the configured
app token's privileges.
OCIS_MCP_APP_TOKEN_USER/OCIS_MCP_APP_TOKEN_VALUE— an oCIS app token created withocis auth-app create, exactly as documented in the upstream project's Getting Startedguide.
Both the example's own
README.mdand the developer docs page(
docs/ocis/deployment/ocis_full.md) gained a new subsection describing the option,matching the existing Keycloak / Clamav subsections.
Testing
docker-compose config --quietvalidated with the service both disabled (default) andenabled.
traefik,ocis, andocis-mcp-serverin a localocis_fullstack, using animage built locally from the
ocis-mcp-serverrepo'sDockerfile(see Known Limitationbelow). Confirmed an unauthenticated request to
https://mcp.owncloud.test/mcpreturns401. Created a real oCIS app token viaocis auth-app create, wired it in, andconfirmed an authenticated MCP
initializerequest completes successfully end-to-endthrough Traefik (
serverInfo.name: "ocis-mcp-server"in the JSON-RPC response).ocis_full's defaultSTART_ADDITIONAL_SERVICESdoesn'tinclude
auth-app, soocis auth-app createsilently returns an empty token untilauth-appis also enabled. Fixed by adding a prerequisite note to both docs locations(see the
docs(deployments): note auth-app must be enabled...commit on this branch).go test/-racesurface applies to this change.Known Limitation
owncloud/ocis-mcp-serveris not yet published to any container registry — theocis-mcp-serverrepo currently only builds and archives binaries in its releasepipeline, with no Docker build/push step. This PR's compose wiring was verified against a
locally-built image standing in for the real one. Until an
owncloud/ocis-mcp-serverimage is actually published, enabling
OCIS_MCP=:mcp.ymlwill fail to pull. Publishingthat image is tracked separately and is a prerequisite for this option to work for real
users.
Risk
Low. This is an additive, off-by-default optional service — it does not change the
behavior of the default
ocis_fullstack for anyone who doesn't opt in.🤖 Generated with Claude Code