Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feat/prompts caching#1087

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
amri369 wants to merge12 commits intoopenai:main
base:main
Choose a base branch
Loading
fromamri369:feat/prompts-caching

Conversation

amri369
Copy link
Contributor

@amri369amri369 commentedJul 12, 2025
edited
Loading

Summary

Integrate prompts list caching in MCP Servers. This allows agents to fetch prompts from local memory whencache_prompts_list is set toTrue. Otherwise, every time an agent runs, it callslist_prompts() on the MCP Server.

Key changes:

  • Updated the implementation oflist_prompts in_MCPServerWithClientSession to integrate caching using the same design pattern as caching integration inlist_tools.
  • Created example that uses caching with working demonstration.
  • Updated documentation with caching setting.
  • Renamed testtest_server_caching_works totest_server_caching_prompts_works in tests/mcp/test_caching.py.

Note: This PR does not implement caching inget_prompt which can be useful in certain situations.

Test plan

Unit tests: Added 1 unit test in tests/mcp/test_caching.py to cover prompts list caching.

Example verification: Created working example with MCP server and client.
All tests pass: 523/523 tests passing after adding optional dependencies

Checks

[x] I've added new tests (if relevant)
[x] I've added/updated the relevant documentation
[x] I've run make lint and make format
[x] I've made sure tests pass

@amri369amri369 marked this pull request as draftJuly 12, 2025 09:01
@amri369amri369 marked this pull request as ready for reviewJuly 12, 2025 09:46
@seratchseratch added enhancementNew feature or request feature:mcp labelsJul 14, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
enhancementNew feature or requestfeature:mcp
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@amri369@seratch

[8]ページ先頭

©2009-2025 Movatter.jp