MCPcopy Create free account
hub / github.com/Flagsmith/flagsmith / get_schema

Method get_schema

api/api/openapi.py:80–95  ·  view source on GitHub ↗
(
        self, request: Request | None = None, public: bool = False
    )

Source from the content-addressed store, hash-verified

78 MCP_TAG = "mcp"
79
80 def get_schema(
81 self, request: Request | None = None, public: bool = False
82 ) -> dict[str, Any]:
83 oauth = OAuthConfig.from_settings()
84 schema = super().get_schema(request, public)
85 schema["paths"] = self._filter_paths(schema.get("paths", {}))
86 schema = self._update_security_for_mcp(schema, oauth)
87 schema.pop("$schema", None)
88 info = schema.pop("info").copy()
89 info["title"] = "mcp_openapi"
90 return {
91 "openapi": schema.pop("openapi"),
92 "info": info,
93 "servers": [{"url": oauth.api_url}],
94 **schema,
95 }
96
97 def _filter_paths(self, paths: dict[str, Any]) -> dict[str, Any]:
98 """Filter paths to only include operations tagged with 'mcp'."""

Calls 5

_filter_pathsMethod · 0.95
from_settingsMethod · 0.80
get_schemaMethod · 0.45
getMethod · 0.45