| Changelog | Added
-
files_download returns Nextcloud files as embedded MCP binary resources. It applies the
caller's existing Nextcloud permissions, refuses folders and supports files of any total
size through bounded 8 MiB chunks linked by next_offset.
-
files_upload accepts base64 chunks for PDFs and other binary files. Nextcloud assembles
the chunks server-side, with an 8 MiB per-call bound and Overwrite: F on the final step,
so an existing destination is still refused.
-
NC_MCP_FILES_ROOT can bind every file tool to one Nextcloud directory. Inside the sandbox,
/ is the configured directory and paths are resolved below it; the default remains the
whole files area.
-
File transfers now stream range responses with bounded memory, validate advertised byte
ranges, filter DAV and unified-search metadata against the directory binding, isolate
temporary uploads by destination and root, and reject inconsistent upload sizes and
replacement responses. DAV result paths now support Nextcloud installed under a URL
subpath. Documented the client-side PDF assembly and Mathpix upload-ticket handoff.
-
The token exchange path can be configured, through the variables of the
NC_MCP_EXCHANGE_ namespace. It is off in the factory state and stays off until
NC_MCP_EXCHANGE_ENABLED arms it, so an installation that sets none of these variables
behaves exactly as before. Armed, the path requires NC_MCP_EXCHANGE_ISSUER and
NC_MCP_EXCHANGE_AZP, and neither has a default: the first decides whose signatures are
trusted, the second decides who may act. NC_MCP_EXCHANGE_AUDIENCE defaults to the
resource URL of this instance and never to a generic name, so a token minted for one
installation does not hold at another. That default is derived from NC_MCP_PUBLIC_URL,
and an armed path that names neither of the two refuses the start instead of falling back
to the documented loopback address: derived from that, the audience would be the same
value on every installation and would bind a token to none of them.
NC_MCP_EXCHANGE_ACCOUNT_CLAIM defaults to sub,
the one claim every exchanged token carries. NC_MCP_EXCHANGE_JWKS_URI defaults to the
key set path of the configured realm, NC_MCP_EXCHANGE_JWKS_ORIGIN to nothing, and
NC_MCP_EXCHANGE_ALGORITHMS to RS256 alone. A half configuration refuses the start in
both directions: armed without its required values, and configured without the switch
that arms it. Nothing verifies an exchanged token yet; this release adds the
configuration surface and the refusals around it.
- The public URL is derived when nobody set one: an installation without a stored form
value and without
NC_MCP_PUBLIC_URL now calls itself
<NEXTCLOUD_URL>/exapps/mcp_connector, the address a HaRP ExApp is reachable under
anyway. On Nextcloud AIO with a custom domain that removes the last manual step of a
one click installation, asked for in the closing comment of
#4: AIO hands the
container its public custom domain as NEXTCLOUD_URL, and the 421 fix of 0.1.13
already derives the allowed hosts from the same variable. The derived candidate runs
through the same validation as a value entered in the admin form (https, or loopback
for a local topology), so an internal or http NEXTCLOUD_URL derives nothing and the
fail-closed behavior stays exactly as it was: documented loopback default, an error
line naming all three sources, and the setup state on the connections page. A stored
form value and the deploy variable both win over the derivation, and split-domain
deployments keep setting the override.
- An exchanged token acts under an existing Nextcloud account in the ExApp deployment.
The mapping from the checked claim set to the account runs over the configured profile
(
NC_MCP_EXCHANGE_MAPPING), no account is ever created on this way, and an account that
cannot be found, or whose existence cannot be determined, is refused: uncertainty about
the account list is a refusal here, deliberately the opposite of the audit sweep, which
keeps every chain on the same uncertainty. For such a call the container reaches
Nextcloud through AppAPI impersonation in the name of the mapped account, without
anything ever being provisioned for it, and the permission boundary stays with
Nextcloud: the call sees exactly what that account may see, never more. The account list
is cached inside the process for a minute, concurrent calls share one lookup, and after
a failed lookup a grace period refuses without asking again.
- Repeated refusals of the token exchange path are bounded before anybody is
authenticated. An armed path checks a signature and, when a key is unknown, fetches a key
set, so a stranger repeating a rejected assertion is answered with 429 and a
Retry-After
once a source has collected too many refusals in five minutes. The deliberate exception of
the MCP route holds unchanged for the tokens this app issues itself: a call carrying one of
those is never counted and never refused by this bound, not even while a flood of foreign
ones is running. With the exchange path off, nothing of this hangs at the route at all.
- In the standalone deployment a user grants, sees and withdraws the permission behind an
exchanged token, on one browser page at
/exchange. An exchanged token without such a
granted permission is refused, so nobody gets a standing pass in a user's name without
that user having granted it once. The page appears only while the exchange path is armed;
in the factory state the address does not exist. Granting demands the same independent
single sign-on as a consent decision, so the browser confirming the permission is proven
to be the browser that just signed in to Nextcloud, and the permission is written only
after that proof. The page then shows the permission with the day it was granted and the
service that may act, and it carries the action that withdraws it. A withdrawal runs over
the same revocation path as every other one in this app: the app password goes back to
Nextcloud, and the immediately following call with the same exchanged token is refused,
without a restart and without anything being emptied by hand. Every refusal of the page is
one answer, so it says nothing about which permission exists.
Changed
- The Findling sentence of the three store descriptions speaks plain language and no
longer carries the acronym; a unit gate holds the rule, and the store page shows the
new wording with the next release.
|