Skip to content

Commit 29309e1

Browse files
committed
db schema changes for streamablehttp
1 parent d8ee922 commit 29309e1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

mcpgateway/db.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,7 @@ class Gateway(Base):
933933
name: Mapped[str] = mapped_column(unique=True)
934934
url: Mapped[str]
935935
description: Mapped[Optional[str]]
936+
transport: Mapped[str] = mapped_column(default="SSE")
936937
capabilities: Mapped[Dict[str, Any]] = mapped_column(JSON)
937938
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(timezone.utc))
938939
updated_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(timezone.utc), onupdate=lambda: datetime.now(timezone.utc))

mcpgateway/schemas.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,15 +271,15 @@ class ToolCreate(BaseModelWithConfig):
271271
- Unique tool name
272272
- Valid endpoint URL
273273
- Valid JSON Schema for input validation
274-
- Request type (HTTP method)
275274
- Integration type: 'MCP' for MCP-compliant tools or 'REST' for REST integrations
275+
- Request type (For REST-GET,POST,PUT,DELETE and for MCP-SSE,STDIO,STREAMABLEHTTP)
276276
- Optional authentication credentials: BasicAuth or BearerTokenAuth or HeadersAuth.
277277
"""
278278

279279
name: str = Field(..., description="Unique name for the tool")
280280
url: Union[str, AnyHttpUrl] = Field(None, description="Tool endpoint URL")
281281
description: Optional[str] = Field(None, description="Tool description")
282-
request_type: Literal["GET", "POST", "PUT", "DELETE", "SSE", "STDIO"] = Field("SSE", description="HTTP method to be used for invoking the tool")
282+
request_type: Literal["GET", "POST", "PUT", "DELETE", "SSE", "STDIO", "STREAMABLEHTTP"] = Field("SSE", description="HTTP method to be used for invoking the tool")
283283
integration_type: Literal["MCP", "REST"] = Field("MCP", description="Tool integration type: 'MCP' for MCP-compliant tools, 'REST' for REST integrations")
284284
headers: Optional[Dict[str, str]] = Field(None, description="Additional headers to send when invoking the tool")
285285
input_schema: Optional[Dict[str, Any]] = Field(
@@ -340,7 +340,7 @@ class ToolUpdate(BaseModelWithConfig):
340340
name: Optional[str] = Field(None, description="Unique name for the tool")
341341
url: Optional[Union[str, AnyHttpUrl]] = Field(None, description="Tool endpoint URL")
342342
description: Optional[str] = Field(None, description="Tool description")
343-
request_type: Optional[Literal["GET", "POST", "PUT", "DELETE", "SSE", "STDIO"]] = Field(None, description="HTTP method to be used for invoking the tool")
343+
request_type: Optional[Literal["GET", "POST", "PUT", "DELETE", "SSE", "STDIO", "STREAMABLEHTTP"]] = Field(None, description="HTTP method to be used for invoking the tool")
344344
integration_type: Optional[Literal["MCP", "REST"]] = Field(None, description="Tool integration type")
345345
headers: Optional[Dict[str, str]] = Field(None, description="Additional headers to send when invoking the tool")
346346
input_schema: Optional[Dict[str, Any]] = Field(None, description="JSON Schema for validating tool parameters")
@@ -641,6 +641,7 @@ class GatewayCreate(BaseModelWithConfig):
641641
name: str = Field(..., description="Unique name for the gateway")
642642
url: Union[str, AnyHttpUrl] = Field(..., description="Gateway endpoint URL")
643643
description: Optional[str] = Field(None, description="Gateway description")
644+
transport: str = Field(default="SSE", description="Transport used by MCP server: SSE or STREAMABLEHTTP")
644645

645646
# Authorizations
646647
auth_type: Optional[str] = Field(None, description="Type of authentication: basic, bearer, headers, or none")
@@ -752,6 +753,7 @@ class GatewayUpdate(BaseModelWithConfig):
752753
name: Optional[str] = Field(None, description="Unique name for the gateway")
753754
url: Optional[Union[str, AnyHttpUrl]] = Field(None, description="Gateway endpoint URL")
754755
description: Optional[str] = Field(None, description="Gateway description")
756+
transport: str = Field(default="SSE", description="Transport used by MCP server: SSE or STREAMABLEHTTP")
755757

756758
name: Optional[str] = Field(None, description="Unique name for the prompt")
757759
# Authorizations
@@ -877,6 +879,7 @@ class GatewayRead(BaseModelWithConfig):
877879
name: str = Field(..., description="Unique name for the gateway")
878880
url: str = Field(..., description="Gateway endpoint URL")
879881
description: Optional[str] = Field(None, description="Gateway description")
882+
transport: str = Field(default="SSE", description="Transport used by MCP server: SSE or STREAMABLEHTTP")
880883
capabilities: Dict[str, Any] = Field(default_factory=dict, description="Gateway capabilities")
881884
created_at: datetime = Field(default_factory=datetime.utcnow, description="Creation timestamp")
882885
updated_at: datetime = Field(default_factory=datetime.utcnow, description="Last update timestamp")

0 commit comments

Comments
 (0)