Runtime information about a running MCP App.
| 19 | |
| 20 | |
| 21 | class AppInfo(BaseModel): |
| 22 | """Runtime information about a running MCP App.""" |
| 23 | |
| 24 | tool_name: str = Field(description="Tool that triggered this app") |
| 25 | resource_uri: str = Field(description="ui:// resource URI") |
| 26 | server_name: str = Field(description="MCP server providing this tool") |
| 27 | state: AppState = AppState.PENDING |
| 28 | port: int = Field(description="Local server port for this app") |
| 29 | html_content: str = Field(default="", description="Fetched HTML content") |
| 30 | csp: dict[str, Any] | None = Field( |
| 31 | default=None, description="CSP configuration from resource metadata" |
| 32 | ) |
| 33 | permissions: dict[str, Any] | None = Field( |
| 34 | default=None, description="Requested iframe permissions" |
| 35 | ) |
| 36 | |
| 37 | model_config = {"frozen": False} |
| 38 | |
| 39 | @property |
| 40 | def url(self) -> str: |
| 41 | """URL to open in the browser.""" |
| 42 | return f"http://localhost:{self.port}" |
| 43 | |
| 44 | |
| 45 | class HostContext(BaseModel): |
no outgoing calls