Skip to content

Commit dd7a77d

Browse files
committed
Add as_dict method
1 parent 6574cfc commit dd7a77d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/mcp/client/config/mcp_servers_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
class MCPServerConfig(BaseModel):
1919
"""Base class for MCP server configurations."""
2020

21-
pass
21+
def as_dict(self) -> dict[str, Any]:
22+
"""Return the server configuration as a dictionary."""
23+
return self.model_dump(exclude_none=True)
2224

2325

2426
class StdioServerConfig(MCPServerConfig):

0 commit comments

Comments
 (0)