Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mcp_optimizer/toolhive/api_models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# generated by datamodel-codegen:
# filename: http://127.0.0.1:8080/api/openapi.json
# timestamp: 2025-11-02T00:37:46+00:00
# timestamp: 2025-11-21T00:35:37+00:00
2 changes: 1 addition & 1 deletion src/mcp_optimizer/toolhive/api_models/audit.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: http://127.0.0.1:8080/api/openapi.json
# timestamp: 2025-11-02T00:37:46+00:00
# timestamp: 2025-11-21T00:35:37+00:00

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion src/mcp_optimizer/toolhive/api_models/auth.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: http://127.0.0.1:8080/api/openapi.json
# timestamp: 2025-11-02T00:37:46+00:00
# timestamp: 2025-11-21T00:35:37+00:00

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion src/mcp_optimizer/toolhive/api_models/authz.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: http://127.0.0.1:8080/api/openapi.json
# timestamp: 2025-11-02T00:37:46+00:00
# timestamp: 2025-11-21T00:35:37+00:00

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion src/mcp_optimizer/toolhive/api_models/client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: http://127.0.0.1:8080/api/openapi.json
# timestamp: 2025-11-02T00:37:46+00:00
# timestamp: 2025-11-21T00:35:37+00:00

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion src/mcp_optimizer/toolhive/api_models/core.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: http://127.0.0.1:8080/api/openapi.json
# timestamp: 2025-11-02T00:37:46+00:00
# timestamp: 2025-11-21T00:35:37+00:00

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion src/mcp_optimizer/toolhive/api_models/groups.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: http://127.0.0.1:8080/api/openapi.json
# timestamp: 2025-11-02T00:37:46+00:00
# timestamp: 2025-11-21T00:35:37+00:00

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion src/mcp_optimizer/toolhive/api_models/ignore.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: http://127.0.0.1:8080/api/openapi.json
# timestamp: 2025-11-02T00:37:46+00:00
# timestamp: 2025-11-21T00:35:37+00:00

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion src/mcp_optimizer/toolhive/api_models/permissions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: http://127.0.0.1:8080/api/openapi.json
# timestamp: 2025-11-02T00:37:46+00:00
# timestamp: 2025-11-21T00:35:37+00:00

from __future__ import annotations

Expand Down
5 changes: 4 additions & 1 deletion src/mcp_optimizer/toolhive/api_models/registry.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: http://127.0.0.1:8080/api/openapi.json
# timestamp: 2025-11-02T00:37:46+00:00
# timestamp: 2025-11-21T00:35:37+00:00

from __future__ import annotations

Expand Down Expand Up @@ -94,6 +94,9 @@ class OAuthConfig(BaseModel):
None,
description='OAuthParams contains additional OAuth parameters to include in the authorization request\nThese are server-specific parameters like "prompt", "response_mode", etc.',
)
resource: Optional[str] = Field(
None, description='Resource is the OAuth 2.0 resource indicator (RFC 8707)'
)
scopes: Optional[list[str]] = Field(
None,
description='Scopes are the OAuth scopes to request\nIf not specified, defaults to ["openid", "profile", "email"] for OIDC',
Expand Down
39 changes: 39 additions & 0 deletions src/mcp_optimizer/toolhive/api_models/remote.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# generated by datamodel-codegen:
# filename: http://127.0.0.1:8080/api/openapi.json
# timestamp: 2025-11-21T00:35:37+00:00

from __future__ import annotations

from typing import Optional

from pydantic import BaseModel, Field

from . import registry


class Config(BaseModel):
authorize_url: Optional[str] = None
callback_port: Optional[int] = None
client_id: Optional[str] = None
client_secret: Optional[str] = None
client_secret_file: Optional[str] = None
env_vars: Optional[list[registry.EnvVar]] = Field(
None, description='Environment variables for the client'
)
headers: Optional[list[registry.Header]] = Field(
None, description='Headers for HTTP requests'
)
issuer: Optional[str] = Field(
None, description='OAuth endpoint configuration (from registry)'
)
oauth_params: Optional[dict[str, str]] = Field(
None, description='OAuth parameters for server-specific customization'
)
resource: Optional[str] = Field(
None, description='Resource is the OAuth 2.0 resource indicator (RFC 8707).'
)
scopes: Optional[list[str]] = None
skip_browser: Optional[bool] = None
timeout: Optional[str] = Field(None, examples=['5m'])
token_url: Optional[str] = None
use_pkce: Optional[bool] = None
42 changes: 14 additions & 28 deletions src/mcp_optimizer/toolhive/api_models/runner.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,24 @@
# generated by datamodel-codegen:
# filename: http://127.0.0.1:8080/api/openapi.json
# timestamp: 2025-11-02T00:37:46+00:00
# timestamp: 2025-11-21T00:35:37+00:00

from __future__ import annotations

from typing import Optional

from pydantic import BaseModel, Field

from . import audit, auth, authz, ignore, permissions, registry, telemetry, types


class RemoteAuthConfig(BaseModel):
authorize_url: Optional[str] = None
callback_port: Optional[int] = None
client_id: Optional[str] = None
client_secret: Optional[str] = None
client_secret_file: Optional[str] = None
env_vars: Optional[list[registry.EnvVar]] = Field(
None, description='Environment variables for the client'
)
headers: Optional[list[registry.Header]] = Field(
None, description='Headers for HTTP requests'
)
issuer: Optional[str] = Field(
None, description='OAuth endpoint configuration (from registry)'
)
oauth_params: Optional[dict[str, str]] = Field(
None, description='OAuth parameters for server-specific customization'
)
scopes: Optional[list[str]] = None
skip_browser: Optional[bool] = None
timeout: Optional[str] = Field(None, examples=['5m'])
token_url: Optional[str] = None
use_pkce: Optional[bool] = None
from . import (
audit,
auth,
authz,
ignore,
permissions,
remote,
telemetry,
tokenexchange,
types,
)


class ToolOverride(BaseModel):
Expand Down Expand Up @@ -116,7 +101,7 @@ class RunConfig(BaseModel):
None,
description='ProxyMode is the proxy mode for stdio transport ("sse" or "streamable-http")',
)
remote_auth_config: Optional[RemoteAuthConfig] = None
remote_auth_config: Optional[remote.Config] = None
remote_url: Optional[str] = Field(
None,
description='RemoteURL is the URL of the remote MCP server (if running remotely)',
Expand All @@ -141,6 +126,7 @@ class RunConfig(BaseModel):
None,
description='ThvCABundle is the path to the CA certificate bundle for ToolHive HTTP operations',
)
token_exchange_config: Optional[tokenexchange.Config] = None
tools_filter: Optional[list[str]] = Field(
None, description='ToolsFilter is the list of tools to filter'
)
Expand Down
2 changes: 1 addition & 1 deletion src/mcp_optimizer/toolhive/api_models/secrets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: http://127.0.0.1:8080/api/openapi.json
# timestamp: 2025-11-02T00:37:46+00:00
# timestamp: 2025-11-21T00:35:37+00:00

from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion src/mcp_optimizer/toolhive/api_models/telemetry.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: http://127.0.0.1:8080/api/openapi.json
# timestamp: 2025-11-02T00:37:46+00:00
# timestamp: 2025-11-21T00:35:37+00:00

from __future__ import annotations

Expand Down
40 changes: 40 additions & 0 deletions src/mcp_optimizer/toolhive/api_models/tokenexchange.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# generated by datamodel-codegen:
# filename: http://127.0.0.1:8080/api/openapi.json
# timestamp: 2025-11-21T00:35:37+00:00

from __future__ import annotations

from typing import Optional

from pydantic import BaseModel, Field


class Config(BaseModel):
audience: Optional[str] = Field(
None, description='Audience is the target audience for the exchanged token'
)
client_id: Optional[str] = Field(
None, description='ClientID is the OAuth 2.0 client identifier'
)
client_secret: Optional[str] = Field(
None, description='ClientSecret is the OAuth 2.0 client secret'
)
external_token_header_name: Optional[str] = Field(
None,
description='ExternalTokenHeaderName is the name of the custom header to use when HeaderStrategy is "custom"',
)
header_strategy: Optional[str] = Field(
None,
description='HeaderStrategy determines how to inject the token\nValid values: HeaderStrategyReplace (default), HeaderStrategyCustom',
)
scopes: Optional[list[str]] = Field(
None,
description='Scopes is the list of scopes to request for the exchanged token',
)
subject_token_type: Optional[str] = Field(
None,
description='SubjectTokenType specifies the type of the subject token being exchanged.\nCommon values: tokenTypeAccessToken (default), tokenTypeIDToken, tokenTypeJWT.\nIf empty, defaults to tokenTypeAccessToken.',
)
token_url: Optional[str] = Field(
None, description='TokenURL is the OAuth 2.0 token endpoint URL'
)
2 changes: 1 addition & 1 deletion src/mcp_optimizer/toolhive/api_models/types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: http://127.0.0.1:8080/api/openapi.json
# timestamp: 2025-11-02T00:37:46+00:00
# timestamp: 2025-11-21T00:35:37+00:00

from __future__ import annotations

Expand Down
8 changes: 6 additions & 2 deletions src/mcp_optimizer/toolhive/api_models/v1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# generated by datamodel-codegen:
# filename: http://127.0.0.1:8080/api/openapi.json
# timestamp: 2025-11-02T00:37:46+00:00
# timestamp: 2025-11-21T00:35:37+00:00

from __future__ import annotations

Expand All @@ -17,8 +17,9 @@

class UpdateRegistryRequest(BaseModel):
allow_private_ip: Optional[bool] = Field(
None, description='Allow private IP addresses for registry URL'
None, description='Allow private IP addresses for registry URL or API URL'
)
api_url: Optional[str] = Field(None, description='MCP Registry API URL')
local_path: Optional[str] = Field(None, description='Local registry file path')
url: Optional[str] = Field(None, description='Registry URL (for remote registries)')

Expand Down Expand Up @@ -165,6 +166,9 @@ class RemoteOAuthConfig(BaseModel):
None,
description='Additional OAuth parameters for server-specific customization',
)
resource: Optional[str] = Field(
None, description='OAuth 2.0 resource indicator (RFC 8707)'
)
scopes: Optional[list[str]] = Field(None, description='OAuth scopes to request')
skip_browser: Optional[bool] = Field(
None,
Expand Down