Enable AFFiNE read-write MCP credentials with AFFINE_ENV=dev
The push adds an environment variable to the AFFiNE deployment to enable read-write workspace MCP credentials, which in version 0.27.0 are gated on canary mode. This is a small change to a Kubernetes deployment manifest, but it enables a feature that requires explicit opt-in, and it updates the workload inventory to match.
How the change works
I added the AFFINE_ENV environment variable with the value dev to the AFFiNE deployment in clusters/homelab/apps/affine/deployment.yaml. The comment in the manifest notes that AFFiNE 0.27.0 gates MCP write credentials and tools on canary mode, so setting the environment to dev is what flips that gate on for this instance. The variable is set at the container level, so it applies to all AFFiNE processes in the pod, and it is the only change needed to enable the feature; no additional secrets or volume mounts are required because the credentials themselves are handled by the MCP layer once the mode is active.
What the evidence establishes
The patch shows a three-line addition to the deployment spec: the comment explaining the gate, the AFFINE_ENV name, and the dev value. That is the entire change to the manifest. The inventory page at openwiki/workloads/inventory.md also received a one-line edit, which I take to be a documentation update so that the recorded configuration matches the deployed state. The commit subject is fix(affine): enable read-write workspace MCP credentials (#2125), which confirms the intent. There are no other files changed, so the scope is narrow and the risk is limited to the AFFiNE workload.
Where this transfers to platform engineering
This is an example of feature gating through environment variables rather than code branches or separate deployment variants. A platform team can use the same technique for any capability that needs to be opt-in per environment: define a clear env var, document the gate in the manifest comment, and keep the value explicit so it does not leak into production by accident. In this case the gate is AFFINE_ENV=dev, but the pattern works just as well for enabling debug endpoints, experimental storage backends, or additional authentication providers. The inventory page should always be updated in the same change so that documentation and deployment agree.
Verification status and next check
The change is merged and the manifest is the source of truth for the GitOps loop, so the next reconciliation will apply it. I have not yet confirmed that the AFFiNE pod has restarted with the new environment variable and that MCP write operations are succeeding. The next check is to observe the pod’s environment in the running deployment and, if possible, exercise a write operation through the MCP interface to confirm the gate is open. If the write fails, the fallback is to verify that the running AFFiNE version actually supports the dev mode gate as documented.