Skip to content

Route MCP tool calls to mixer agent apis#201

Merged
keyurva merged 6 commits into
datacommonsorg:mainfrom
keyurva:refactor-mcp-mixer
Jun 11, 2026
Merged

Route MCP tool calls to mixer agent apis#201
keyurva merged 6 commits into
datacommonsorg:mainfrom
keyurva:refactor-mcp-mixer

Conversation

@keyurva

@keyurva keyurva commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
  • Added USE_MIXER_AGENT_APIS env var to enable direct routing to Mixer-side agent endpoints.
  • Created MixerClient to perform async POST requests with timing logging.
  • Implemented mixer_service functions to communicate directly with agent/get_observations and agent/search_indicators endpoints.
  • Created mixer_tools to expose tool signatures without legacy parameters like maybe_bilateral.
  • Modified application startup to conditionally skip initializing the Python client when Mixer mode is active.

Testing on staging

  • Triggered staging deployment, then manually edited variables to connect to Mixer on autopush and setting USE_MIXER_AGENT_APIS=true
  • Tested from both MCP inspector and Gemini CLI and inspected logs to verify the expected calls were made to the agent apis

@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 support for Mixer-side agent endpoints as an alternative to local processing, controlled by the USE_MIXER_AGENT_APIS configuration flag. It adds a new MixerClient for async communication, service and tool layers for fetching observations and searching indicators, and corresponding integration tests. Feedback on these changes suggests improving the LLM instructions in search_indicators.md by replacing the fictional parent place 'Middle Earth' with a real-world entity, and enhancing the robustness of MixerClient.post by handling network and JSON parsing errors while preventing potential sensitive data exposure in logs.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/datacommons-mcp/datacommons_mcp/agent_api_client.py
@keyurva keyurva changed the title Route observation and search tools to Mixer-side agent endpoints Integrate mixer agent apis to MCP server Jun 9, 2026
@keyurva keyurva requested a review from clincoln8 June 9, 2026 22:33
@keyurva keyurva changed the title Integrate mixer agent apis to MCP server Route MCP tool calls to mixer agent apis Jun 9, 2026

@clincoln8 clincoln8 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.

Let's go!

Consider removing the prefix "mixer" everywhere and replace with something like "api" or "agent_api"

@keyurva

keyurva commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Let's go!

Consider removing the prefix "mixer" everywhere and replace with something like "api" or "agent_api"

Thanks! Renamed to "agent_api".

@keyurva keyurva merged commit be8d923 into datacommonsorg:main Jun 11, 2026
12 of 13 checks passed
@keyurva keyurva deleted the refactor-mcp-mixer branch June 11, 2026 22:02
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.

2 participants