Skip to content

feat(mcp): add upload_context_set and download_context_set tools - #178

Merged
wangauone merged 1 commit into
mainfrom
feat/context-store-mcp-tools
Jul 10, 2026
Merged

feat(mcp): add upload_context_set and download_context_set tools#178
wangauone merged 1 commit into
mainfrom
feat/context-store-mcp-tools

Conversation

@wangauone

Copy link
Copy Markdown
Collaborator

Summary

  • Adds two MCP tools — upload_context_set and download_context_set — for programmatic Context Store access, removing the manual "upload via GCP Database Studio" step from evaluation / hillclimb workflows.
  • New hand-rolled REST client (common/context_store_client.py) since the Context Store API has no public SDK yet — marked in comments as a stopgap to be replaced when the SDK ships.
  • Enables Pydantic camelCase aliases on ContextSet models so downloaded bodies validate without conversion.

@wangauone
wangauone requested review from g-lynnzee and helloeve July 6, 2026 23:30
@wangauone

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a hand-rolled REST client, ContextStoreClient, along with new MCP tools (upload_context_set and download_context_set) to interact with the internal Context Store API. It also updates the Pydantic models to support camelCase validation for API compatibility and adds comprehensive unit tests. The review feedback highlights several robustness and idempotency improvements: checking if LROs are already completed before polling, handling 409 conflicts during group creation, ignoring 404 errors on group deletion, and ensuring parent directories are created before writing downloaded files to disk.

Comment thread src/google/cloud/db_context_enrichment/common/context_store_client.py Outdated
Comment thread src/google/cloud/db_context_enrichment/common/context_store_client.py Outdated
Comment thread src/google/cloud/db_context_enrichment/main.py Outdated
@wangauone
wangauone force-pushed the feat/context-store-mcp-tools branch 4 times, most recently from 82e89e0 to 9e17726 Compare July 7, 2026 23:10

@helloeve helloeve left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks good to me. At the same time I wonder if we should hide the MCP tools at the moment given we have skills that instruct the user to manually upload the context

@wangauone
wangauone force-pushed the feat/context-store-mcp-tools branch from 9e17726 to 60887b9 Compare July 8, 2026 21:37
@wangauone

Copy link
Copy Markdown
Collaborator Author

This change looks good to me. At the same time I wonder if we should hide the MCP tools at the moment given we have skills that instruct the user to manually upload the context

Good point. Removed the @mcp.tool annotation to hide the tools from agents.

@wangauone

Copy link
Copy Markdown
Collaborator Author

/gcbrun

@wangauone
wangauone requested a review from helloeve July 8, 2026 21:47
@wangauone
wangauone merged commit b4f7b13 into main Jul 10, 2026
12 checks passed
@wangauone
wangauone deleted the feat/context-store-mcp-tools branch July 10, 2026 18:53
@wangauone
wangauone restored the feat/context-store-mcp-tools branch July 10, 2026 18:53
@wangauone
wangauone deleted the feat/context-store-mcp-tools branch July 10, 2026 19:00
wangauone pushed a commit that referenced this pull request Jul 27, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.7.0](v0.6.0...v0.7.0)
(2026-07-25)


### Features

* Enable sheperding of users through context engineering workflow
([#168](#168))
([3231e59](3231e59))
* golden dataset generation and expansion
([#187](#187))
([694cc3c](694cc3c))
* **mcp:** add upload_context_set and download_context_set tools
([#178](#178))
([b4f7b13](b4f7b13))


### Bug Fixes

* restore Best Practices heading in context-generation-guide
([#174](#174))
([5d111e7](5d111e7))


### Miscellaneous Chores

* release 0.7.0
([#198](#198))
([350ec43](350ec43))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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 this pull request may close these issues.

3 participants