Repository navigation
Strawman: Resource operations (stat, create, update, delete) with version-based concurrency #2
New issue
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
Merged
DanielTemesgen
merged 21 commits into
modelcontextprotocol:main
from
jayzuccarelli:resource-operations-strawman
Nov 11, 2026
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
11a9913
Add repository skeleton for Resource operations
jayzuccarelli b5a1eaa
Add problem statement and use cases; tie the reference implementation…
jayzuccarelli 79d67cf
Add Resource operations strawman: stat, create, update, delete with v…
jayzuccarelli 6940b5a
Prototype the strawman on the Python SDK's Extension/MethodBinding API
jayzuccarelli 025d241
Test the prototype over the in-process transport
jayzuccarelli 51dd27a
Proposal status line: drop informal wording
jayzuccarelli bc22619
docs: point at the Filesystems WG charter now that the Files WG merge…
jayzuccarelli d1b9d80
Merge branch 'repo-skeleton' into resource-operations-strawman
jayzuccarelli f1a3b2c
docs: update the strawman's references to the Filesystems WG charter
jayzuccarelli 99bd5ab
chore: name the Filesystems WG in CODEOWNERS and the package metadata
jayzuccarelli fdeea2d
Merge branch 'repo-skeleton' into resource-operations-strawman
jayzuccarelli 8c05c82
docs: last workstream reference in the strawman
jayzuccarelli dacf6b6
Merge branch 'main' into repo-skeleton
kziemski 4876c2f
Merge remote-tracking branch 'upstream/main' into repo-skeleton
jayzuccarelli f3f2514
Use the merged problem statements; drop the duplicate doc
jayzuccarelli ae6fe3f
Merge branch 'repo-skeleton' into resource-operations-strawman
jayzuccarelli 92dc2c4
Rename version to revision to match the problem statements; align wit…
jayzuccarelli 5fc9795
Use revision in the memory-server use case to match the problem state…
jayzuccarelli 8d0fa88
Merge branch 'repo-skeleton' into resource-operations-strawman
jayzuccarelli 3942088
Merge remote-tracking branch 'up/main' into resource-operations-strawman
jayzuccarelli db67f78
Address review: problem-statement refs, required ifMatch on delete, s…
jayzuccarelli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Scenarios: write conflicts | ||
|
|
||
| Implementation-independent checks for the conflict behaviour in the [Resource operations strawman](../docs/proposals/resource-operations.md). A harness runs them against any server that declares `io.modelcontextprotocol/resource-operations`, using one or two client connections. | ||
|
|
||
| Conventions: | ||
|
|
||
| - `<U>` is a URI the server accepts for writes and that does not exist at the start. The harness gets it from configuration. | ||
| - `<R…>` are revisions captured from earlier responses. Revisions are opaque: compare them only for equality, never parse them. | ||
| - "Precondition failed" means the error code assigned to precondition failures (provisionally `-32010`). | ||
| - Each step lists the request and the checks on its response. A step fails the scenario if any check fails. | ||
|
|
||
| ## RO-CONFLICT-1: create-if-absent | ||
|
|
||
| | # | Connection | Request | Expect | | ||
| | :--- | :--- | :--- | :--- | | ||
| | 1 | A | `resources/create {uri: <U>, contents: {text: "a"}}` | Result. `revision` is a non-empty string; save as `<R1>`. `changes` contains `{uri: <U>, effect: "created", revision: <R1>}`. | | ||
| | 2 | B | `resources/create {uri: <U>, contents: {text: "b"}}` | Error. Code is precondition failed. `data.uri` = `<U>`, `data.reason` = `"alreadyExists"`, `data.currentRevision` = `<R1>`. | | ||
| | 3 | A | `resources/stat {uri: <U>}` | Result. `revision` = `<R1>`. The second create changed nothing. | | ||
|
|
||
| ## RO-CONFLICT-2: lost update | ||
|
|
||
| The memory-server case from [use cases](../docs/use-cases.md): two sessions read the same revision and both write it back. | ||
|
|
||
| | # | Connection | Request | Expect | | ||
| | :--- | :--- | :--- | :--- | | ||
| | 1 | A | `resources/create {uri: <U>, contents: {text: "0"}}` | Result. | | ||
| | 2 | A | `resources/stat {uri: <U>}` | Result. Save `revision` as `<R1>`. | | ||
| | 3 | B | `resources/stat {uri: <U>}` | Result. `revision` = `<R1>`. | | ||
| | 4 | A | `resources/update {uri: <U>, contents: {text: "0A"}, ifMatch: <R1>}` | Result. Save `revision` as `<R2>`; `<R2>` != `<R1>`. `changes` contains `{uri: <U>, effect: "updated", previousRevision: <R1>, revision: <R2>}`. | | ||
| | 5 | B | `resources/update {uri: <U>, contents: {text: "0B"}, ifMatch: <R1>}` | Error. Code is precondition failed. `data.reason` = `"revisionMismatch"`, `data.currentRevision` = `<R2>`. | | ||
| | 6 | B | `resources/stat {uri: <U>}` | Result. `revision` = `<R2>`. The rejected write changed nothing. | | ||
| | 7 | B | `resources/update {uri: <U>, contents: {text: "0AB"}, ifMatch: <R2>}` | Result. `changes` contains `previousRevision: <R2>`. | | ||
| | 8 | B | `resources/delete {uri: <U>, ifMatch: <R1>}` | Error. Code is precondition failed. `data.reason` = `"revisionMismatch"`. | | ||
| | 9 | A | `resources/stat {uri: <U>}` | Result. The resource still exists. | | ||
|
|
||
| Optional, if the server reads back what it stores: after step 7, `resources/read {uri: <U>}` returns text `"0AB"`. |
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The create and update split gives the same guarantees as one resources/write that requires exactly one of ifMatch or ifNoneMatch: "*", as with HTTP PUT. I have a preference for fewer methods if possible, but this shouldn't block.