OpenCode: MCP setup
Inspect your mountable.io filesystem usage from OpenCode with a local MCP server and explicit tool permissions.
mountable.io maintains this setup for OpenCode 1.19.4 and mountable-cli 0.8.0. The server runs locally over stdio. Its ten tools manage filesystems, usage, mount sessions and webhooks.
Prepare your key
Install OpenCode and Node.js with npx on your
PATH. Use an existing mountable.io account and filesystem, then create an
API key granted access only to that filesystem.
mountable.io is a paid hosted service; see billing.
Your OpenCode model provider is billed separately.
Load the key into the environment of the terminal that starts OpenCode. For example, Bash can read it without adding its value to shell history:
read -rsp "mountable.io API key: " MOUNTABLE_API_KEY
printf '\n'
export MOUNTABLE_API_KEYIn zsh, use read -rs "MOUNTABLE_API_KEY?mountable.io API key: " instead
of the first line, then print the newline and export as above.
Never paste the key into a prompt or commit it. A GUI launched separately may not inherit your terminal environment. Restart OpenCode and its MCP server after changing credentials.
Add the local server
Merge this into your project’s opencode.json, preserving its existing
model and server settings. OpenCode also accepts opencode.jsonc and a
global ~/.config/opencode/opencode.json.
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"mountable": {
"type": "local",
"command": ["npx", "-y", "mountable-cli@0.8.0", "mcp"],
"enabled": true,
"timeout": 30000,
"environment": {
"MOUNTABLE_API_KEY": "{env:MOUNTABLE_API_KEY}"
}
}
},
"permission": {
"mountable_*": "deny",
"mountable_filesystem_usage": "ask"
}
}{env:MOUNTABLE_API_KEY} is OpenCode’s environment substitution syntax.
The key stays out of the file. Use the absolute path to npx if it is not
on OpenCode’s PATH. To download the pinned package before the first connection:
npx -y mountable-cli@0.8.0 versionThis connects the server while making only usage inspection available for approval. OpenCode evaluates permission rules in order, with the last match winning. Merge these rules after any broader rules in your configuration. The API key’s filesystem grants still apply on the server.
Check the connection and usage
From that project and terminal, run:
opencode --version
opencode mcp listThe first command should show 1.19.4 for this setup. The second should show
the mountable server as connected. That status checks the local MCP handshake;
a successful usage call also checks the key and filesystem grant.
Start opencode with your usual model configuration. Ask:
Call mountable_filesystem_usage for filesystem_id YOUR_FILESYSTEM_ID.
Show the retained bytes, byte quota, entry count and entry quota. Do nothing else.Review and approve that read-only tool call. Its JSON result includes
retained_bytes, byte_quota, entries, entry_quota, bytes_read_30d
and bytes_written_30d. Zero usage is valid. For an authentication or
grant error, check the key and filesystem ID, then restart the MCP server.
To opt into another management tool, add its exact
mountable_ name after the deny rule with "ask". Review each call:
some tools create paid resources, mint tickets or revoke active sessions.
A mount ticket is a credential; treat it as private.
Read and write files
Use the host CLI, Files API,
Python/TypeScript SDKs or a mount for file
contents. The MCP tools manage access and usage; starting a mount is a
separate local command. Wait for its mounted event before using the directory.
OpenCode discovers Agent Skills in
.agents/skills/. To install mountable.io’s existing instructions for the
CLI and SDK workflows, select OpenCode in the installer:
npx skills add writeitai/mountableA skill provides instructions, not credentials or additional API access. Review shell commands and the permissions they need before running them.
Disconnect
Set the server’s enabled field to false and restart OpenCode. Then
opencode mcp list should show it disabled. Run unset MOUNTABLE_API_KEY
in the terminal when finished. Revoke the API key in mountable.io if you
no longer need it; disconnecting the client does not revoke the key or
stop existing mount sessions.
Sources checked 2026-10-27: stable release, local MCP setup, config variables and permissions.