Skip to content

Cursors are not sent to the server correctly #735

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

Closed
nbarbettini opened this issue May 16, 2025 · 0 comments · Fixed by #745
Closed

Cursors are not sent to the server correctly #735

nbarbettini opened this issue May 16, 2025 · 0 comments · Fixed by #745

Comments

@nbarbettini
Copy link
Contributor

nbarbettini commented May 16, 2025

Describe the bug
The PaginatedRequest model has the cursor parameter in the wrong place: request.cursor instead of request.params.cursor as defined by the pagination spec.

Since the methods updated in #718 pass the cursor parameter down to the PaginatedRequest model, they are also affected by this bug.

To Reproduce

from mcp import types

list_tools_request = types.ListToolsRequest(
    method="tools/list",
    cursor="123",
)

client_request = types.ClientRequest(list_tools_request)

# Dump to JSON
client_request_json = client_request.model_dump_json()
print(client_request_json)
❯ python test.py
{"method":"tools/list","params":null,"cursor":"123"}

Expected behavior
A request that conforms to the pagination spec:

{"method":"tools/list","params":{"cursor":"123"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant