Repository navigation
feat: add native MCP prompt discovery and reads - #5604
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (1)
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 45e5cb7272
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Request changes: [P2] bound prompt response and aggregate catalog bytes. I independently confirmed the existing finding; no duplicate inline comment.
A selected compromised HTTP MCP server can return very large descriptions or _meta within the 2,048-item/100-page limits. The pinned collector checks item count and then extends the retained catalog without a byte budget; the pinned HTTP JSON transport deserializes response.json() without a response-size cap. Thus one response or several individually acceptable pages can exhaust host memory before the timeout. Bound response bytes before materializing/deserializing the body and accumulated catalog bytes before retaining another page; reject overflow without partial results. Add coverage for oversized single responses and cumulative overflow across pages.
The API, metadata preservation, selected-server restrictions, idle mutation fencing, cancellation/close and caller-data isolation otherwise look sound after independent static reviews. Hosted CI remains in progress. No candidate code or tests executed.
45e5cb7 to
9049d54
Compare
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Approved at 9049d54. The prior byte-bound finding is resolved: serialized prompt arrays share an 8 MiB budget checked before catalog retention; prompt HTTP POST bodies are bounded before parsing, and resumed SSE honors the configured per-event bound. Counting includes preserved metadata and escaped UTF-8 without materializing a second catalog copy. Existing pagination, authority, cancellation, and caller-data isolation behavior remains intact. Reviewed focused regressions for cumulative pages, exact bounds, oversized JSON/SSE, resumed unterminated events, and session reuse. Hosted CI remains pending. Static review only; no candidate code or tests run.
Summary
This pull request adds MCP prompt discovery and reads to idle native sessions. Applications can call
list_mcp_prompts(server)to get the complete prompt inventory andget_mcp_prompt(server, name, arguments)to read a named prompt with optional string arguments.Listing follows every cursor page and fails if pagination cannot complete. Both methods preserve prompt metadata and content. They use the existing server selection and lifecycle rules. Prompt content does not enter model instructions or conversation history automatically.
The native collector limits the complete serialized prompt catalog to 8 MiB. Prompt JSON responses and POST SSE events are also capped at 8 MiB. GET SSE streams now enforce their configured event limit, including legacy mode (16 MiB by default).
Test plan
Issue number
No linked public issue.
Checks
AGENTS.md, including.agents/skills/code-change-verification/scripts/run.shwhen requiredAGENTS.md