Skip to content

Conversation

@stackloke2e
Copy link

Summary

This PR updates the ToolHive API models generated from the latest OpenAPI specification.

Changes

  • Updated Pydantic models in src/mcp_optimizer/toolhive/api_models/

Notes

  • This PR was automatically generated by the update-thv-models workflow
  • The models are generated using datamodel-codegen from ToolHive's OpenAPI endpoint

🤖 Generated with GitHub Actions

Automated update of ToolHive API models from OpenAPI specification.
@claude
Copy link

claude bot commented Nov 19, 2025

PR Review: Update ToolHive API Models

🚨 Critical Issue - Breaking Changes

BLOCKER: This PR introduces breaking changes that will cause import failures. Three files are importing from the now-deleted registry.py:

  • src/mcp_optimizer/toolhive/toolhive_client.py:15
  • src/mcp_optimizer/install.py:6
  • src/mcp_optimizer/ingestion.py:33

Fix Required: Update these imports from:

from mcp_optimizer.toolhive.api_models.registry import ImageMetadata, Registry, RemoteServerMetadata

To:

from mcp_optimizer.toolhive.api_models.types import ImageMetadata, Registry, RemoteServerMetadata

Code Quality

Structure: Code is auto-generated from OpenAPI spec, follows Pydantic conventions
Typing: Proper use of native Python types (list, dict, Optional)
Refactoring: Good consolidation - models moved from registry.pytypes.py for better organization

Changes Summary

Key structural changes:

  • Deleted registry.py (274 lines)
  • Moved registry models to types.py (+269 lines)
  • Added remote.py (+39 lines) - OAuth/auth config for remote servers
  • Added tokenexchange.py (+40 lines) - OAuth 2.0 token exchange (RFC 8693)
  • Refactored runner.py - replaced inline RemoteAuthConfig with remote.Config

New features:

  • resource field in OAuth config (RFC 8707 resource indicators)
  • Token exchange support with audience, scopes, custom headers
  • Enhanced remote server authentication

Performance & Security

✅ No performance concerns - data models only
✅ No security issues - proper handling of sensitive fields (client_secret, client_secret_file)
⚠️ Note: Token exchange adds OAuth 2.0 token exchange capability - ensure proper validation in consuming code

Recommendation

DO NOT MERGE until imports are fixed. Run task typecheck and task test to verify no runtime errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants