part…
Building governance for MCP?
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
Listings can be large; MCP paginates with opaque cursors, not page numbers.
Response with a page and an optional nextCursor:
{ "jsonrpc": "2.0", "id": "123", "result": { "resultType": "complete", "resources": ["…"],
"nextCursor": "eyJwYWdlIjogM30=", "ttlMs": 300000, "cacheScope": "public" } }
Continuation request:
{ "jsonrpc": "2.0", "id": "124", "method": "resources/list", "params": { "cursor": "eyJwYWdlIjogMn0=" } }
resources/list, resources/templates/list, prompts/list, tools/list (and, in extensions, skills/list, resources/directory/read).
Servers SHOULD: stable cursors; handle invalid cursors gracefully (SHOULD -32602). Clients SHOULD: treat the absence of nextCursor as the end; support both paginated and non-paginated flows. Clients MUST treat cursors as opaque: no assumptions about format, no parsing or modification, and no inference beyond whether there is a non-null value. An empty string is a valid cursor and MUST NOT be treated as the end.
Each page has its own TTL and is refetched with its cursor; no consistency across pages; the same cacheScope on all of them; invalid cursor → discard everything and start from scratch (lesson 7.5).
tools/list, it needs its own cursor that encodes (opaquely and protected) the position in each underlying server. Treat it like requestState: sign or encrypt it.nextCursor: clients usually tolerate it, but it is better to keep reading until the page is full.1. How must a client interpret a nextCursor equal to the empty string?
Only absence (null/omitted) indicates the end.
2. Who decides the page size?
The client must not assume a fixed size.
3. Which error corresponds to an invalid cursor?
Invalid params.