Adding surface metadata to search_indicators endpoint#108
Adding surface metadata to search_indicators endpoint#108lucyking140 merged 19 commits intodatacommonsorg:mainfrom
Conversation
…into lucysking/mcp-metadata
…into lucysking/mcp-metadata
| endpoint_url = f"{self.sv_search_base_url}/api/nl/search-indicators" | ||
| headers = {"Content-Type": "application/json"} | ||
| # 'x-surface' indicates to mixer that this call is coming from the MCP server | ||
| headers = { |
There was a problem hiding this comment.
Since these headers are used at multiple places, consider extracting it into a const.
Note that the |
| # shortly to include release candidates (TODO: lucysking) | ||
| SURFACE = f"mcp-{__version__.replace('rc', '.')}" | ||
|
|
||
| # 'x-surface' indicates to mixer that this call is coming from the MCP server |
There was a problem hiding this comment.
nit: s/mixer/DC APIs? (if we are to expand surface header's scope to non-mixer servers as well)
| # This is here temporarily because of validation in the DataCommonsClient | ||
| # that surface headers must only contain numbers, which will be updated | ||
| # shortly to include release candidates (TODO: lucysking) | ||
| SURFACE = f"mcp-{__version__.replace('rc', '.')}" |
There was a problem hiding this comment.
nit: s/SURFACE/SURFACE_HEADER_VALUE?
| # Replaces 'rc' with '.' in a version string if present. | ||
| # This is here temporarily because of validation in the DataCommonsClient | ||
| # that surface headers must only contain numbers, which will be updated | ||
| # shortly to include release candidates (TODO: lucysking) |
There was a problem hiding this comment.
Can we create a bug for this so it's tracked?
Building from this PR that added a
surfaceto theDataCommonsClientto also pass it in on any calls made to the DC Flask API. This header is ultimately passed into Mixer and used to identify that these calls come from the MCP server.