chariot.mcp package

Submodules

chariot.mcp.build module

class chariot.mcp.build.SDKTool(fn: collections.abc.Callable, meta: dict[str, Any] | None)[source]

Bases: object

fn: Callable
meta: dict[str, Any] | None
chariot.mcp.build.build(sdk_config: SDKConfig) list[SDKTool][source]

Build SDK tools with the given configuration

chariot.mcp.build.sanitize_function(function: Callable, origin: Callable = None) Callable[source]

Remove spicy kwargs from a function signature/annotations (like ones that start with ‘_’). Also removes untyped ‘**kwargs’ from the signature.

chariot.mcp.build.wrap_tool(func: Callable, package: ChariotMCPPackage = None, obj_path: str = None, name_override: str | None = None, is_mutating: bool = False, is_file_based: bool = False, soft_failures_enabled: bool = False, docstring_append: str | None = None) SDKTool[source]

Wrap a tool with extra data: 1. Add a prefix to the tool name based on the originating parent chariot package 2. Add the Object path to the docstring 3. Add the specified docstring_append to the docstring 4. Sanitize the signature to remove bad kwargs

chariot.mcp.config module

class chariot.mcp.config.ChariotMCPConfig(*, transport: ~typing.Literal['streamable-http', 'stdio', 'sse'] | None = 'streamable-http', name: str | None = 'Chariot', sdk: ~chariot.mcp.config.SDKConfig | None = <factory>)[source]

Bases: BaseModel

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: str | None
sdk: SDKConfig | None
transport: Literal['streamable-http', 'stdio', 'sse'] | None
class chariot.mcp.config.SDKConfig(*, include_packages: List[ChariotMCPPackage] | None = None, exclude_packages: List[ChariotMCPPackage] | None = None, disable_mutating_tools: bool = False, disable_file_based_tools: bool = False, soft_failures_enabled: bool = False)[source]

Bases: BaseModel

disable_file_based_tools: bool
disable_mutating_tools: bool
exclude_packages: List[ChariotMCPPackage] | None
include_packages: List[ChariotMCPPackage] | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

soft_failures_enabled: bool
validate() Self[source]

chariot.mcp.enum module

class chariot.mcp.enum.ChariotMCPPackage(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

SDK packages supported in MCP

BulkInference = 'bulk_inference'
Datasets = 'datasets'
InferenceStore = 'inference_store'
Models = 'models'
Projects = 'projects'
SystemResources = 'system_resources'
Training = 'training_v2'
Watchbox = 'watchbox'

chariot.mcp.run module

chariot.mcp.run.run(config: ChariotMCPConfig | None = None, bearer_token: str | None = None, dry: bool = False)[source]

chariot.mcp.utils module

chariot.mcp.utils.get_package_prefix(package: ChariotMCPPackage | None) str[source]
chariot.mcp.utils.is_file_based(func: Callable) bool[source]
chariot.mcp.utils.is_ignored(func: Callable) bool[source]
chariot.mcp.utils.is_mutating(func: Callable) bool[source]

Module contents