Skip to content

HttpMcpServer

Base classes

Name Children Inherits
BaseMcpServer
aclientp.schema.mcp
MCP server base class.

⋔ Inheritance diagram

graph TD
  95970861199872["mcp.HttpMcpServer"]
  95970858786304["mcp.BaseMcpServer"]
  95970862258240["base.AnnotatedObject"]
  95970862254416["base.Schema"]
  95970851503232["main.BaseModel"]
  125067848591872["builtins.object"]
  95970858786304 --> 95970861199872
  95970862258240 --> 95970858786304
  95970862254416 --> 95970862258240
  95970851503232 --> 95970862254416
  125067848591872 --> 95970851503232

🛈 DocStrings

Bases: BaseMcpServer

HTTP transport configuration.

Only available when the Agent capabilities indicate mcp_capabilities.http is true.

Source code in src/aclientp/schema/mcp.py
class HttpMcpServer(BaseMcpServer):
    """HTTP transport configuration.

    Only available when the Agent capabilities indicate `mcp_capabilities.http` is `true`.
    """

    headers: Sequence[HttpHeader] = Field(default_factory=list)
    """HTTP headers to set when making requests to the MCP server."""

    type: Literal["http"] = Field(default="http", init=False)
    """HTTP transport type."""

    url: HttpUrl
    """URL to the MCP server."""

    def get_headers_dict(self) -> dict[str, str]:
        return {header.name: header.value for header in self.headers}

headers class-attribute instance-attribute

headers: Sequence[HttpHeader] = Field(default_factory=list)

HTTP headers to set when making requests to the MCP server.

type class-attribute instance-attribute

type: Literal['http'] = Field(default='http', init=False)

HTTP transport type.

url instance-attribute

url: HttpUrl

URL to the MCP server.

:fa-brands-github: Show source on GitHub