This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For authenticated access, configure the client to send `Authorization: Bearer <token>`. Tokens come from `POST /idp/credentials` (username/password) or from any compatible OIDC/DPoP flow.
## Footguns
A short list of real gotchas to know about, learned from live-fire use:
### Use absolute WebIDs in `write_acl` agents
The `agents` array in a `write_acl` authorization is interpreted as a list of URIs. Relative paths (e.g. `../profile/card.jsonld#me`) resolve against the **.acl file's URL**, not the pod root — and the .acl URL changes depending on which resource the ACL applies to. Two pitfalls:
```json
// Pod owner WebID: http://example.com/profile/card.jsonld#me
// Writing this ACL to /public/forum/.acl:
{
"agents": ["../profile/card.jsonld#me"], // wrong — resolves to /public/profile/card.jsonld#me
"agents": ["./profile/card.jsonld#me"], // wrong — resolves to /public/forum/profile/card.jsonld#me
"agents": ["/profile/card.jsonld#me"], // right — absolute path, resolves to /profile/card.jsonld#me
"agents": ["http://example.com/profile/card.jsonld#me"] // right — absolute URL, host-portable
}
```
**Always use absolute WebID URLs unless you know exactly what relative-URL resolution will give you.** Absolute URLs also make the ACL portable across hostnames.
### `write_acl` will refuse if you'd lock yourself out
If the proposed ACL doesn't grant `Control` to the caller (typically a relative-URL mistake), `write_acl` refuses with an explanatory error. This is a safety, not a permission check — it's stopping you from breaking your own access.
If you really want to transfer ownership (remove your own access), do it in two steps:
1. First `write_acl` granting Control to the new owner *in addition to* yourself
2. Then the new owner calls `write_acl` removing you
### Subscribe over long-running connections needs a keep-alive client
The `subscribe` tool keeps an HTTP+SSE connection open indefinitely. Some HTTP clients, proxies, or load balancers will time out idle streams. If you're subscribing for hours, ensure your client handles SSE reconnect (most do; raw `curl` does not).
## What's not included (yet)
The current cut ships CRUD, structured ACL editing, subscribe, federation, skills, docs, and introspection. Deferred:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('write_acl refuses to lock caller out (safety)', async () => {
// Try to write an ACL that grants Control only to a foreign WebID
// — would lock the caller (mcptest owner) out. Safety should refuse.
const { body } = await rpc({
jsonrpc: '2.0', id: 204, method: 'tools/call',
params: { name: 'write_acl', arguments: {
path: '/mcptest/public/',
authorizations: [
{
agents: ['https://stranger.example/profile#me'],
modes: ['Read', 'Write', 'Control'],
isDefault: true
}
]
} }
}, { token });
assert.ok(body.result.isError);
assert.match(body.result.content[0].text, /lock the caller out|would not grant Control/i);
});
it('write_acl denied without Control', async () => {
const { body } = await rpc({
jsonrpc: '2.0', id: 203, method: 'tools/call',
Expand Down
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(mcp): write_acl safety check + footgun docs #498
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
fix(mcp): write_acl safety check + footgun docs #498
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing