mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
feat(mcp): add MCP extension support with routes and configuration
This commit is contained in:
@@ -496,6 +496,10 @@ func (c *Config) IsMgmtEnabled() bool {
|
||||
return c.IsSearchEnabled()
|
||||
}
|
||||
|
||||
func (c *Config) IsMCPEnabled() bool {
|
||||
return c.Extensions != nil && c.Extensions.MCP != nil && *c.Extensions.MCP.Enable
|
||||
}
|
||||
|
||||
func (c *Config) IsImageTrustEnabled() bool {
|
||||
return c.Extensions != nil && c.Extensions.Trust != nil && *c.Extensions.Trust.Enable
|
||||
}
|
||||
|
||||
@@ -33,4 +33,9 @@ const (
|
||||
UserPrefs = "/userprefs"
|
||||
ExtUserPrefs = ExtPrefix + UserPrefs
|
||||
FullUserPrefs = RoutePrefix + ExtUserPrefs
|
||||
|
||||
// mcp extension.
|
||||
MCP = "/mcp"
|
||||
ExtMCP = ExtPrefix + MCP
|
||||
FullMCP = RoutePrefix + ExtMCP
|
||||
)
|
||||
|
||||
@@ -212,6 +212,7 @@ func (rh *RouteHandler) SetupRoutes() {
|
||||
rh.c.Log)
|
||||
ext.SetupImageTrustRoutes(rh.c.Config, prefixedRouter, rh.c.MetaDB, rh.c.Log)
|
||||
ext.SetupMgmtRoutes(rh.c.Config, prefixedRouter, rh.c.Log)
|
||||
ext.SetupMCPRoutes(rh.c.Config, prefixedRouter, rh.c.StoreController, rh.c.MetaDB, rh.c.Log)
|
||||
ext.SetupUserPreferencesRoutes(rh.c.Config, prefixedRouter, rh.c.MetaDB, rh.c.Log)
|
||||
// last should always be UI because it will setup a http.FileServer and paths will be resolved by this FileServer.
|
||||
ext.SetupUIRoutes(rh.c.Config, rh.c.Router, rh.c.Log)
|
||||
|
||||
Reference in New Issue
Block a user