MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / GlobalMCPConfig

Method GlobalMCPConfig

controller/mcp/iml.go:131–144  ·  view source on GitHub ↗
(ctx *gin.Context)

Source from the content-addressed store, hash-verified

129}
130
131func (i *imlMcpController) GlobalMCPConfig(ctx *gin.Context) (string, error) {
132 cfg := i.settingModule.Get(ctx)
133 if cfg.SitePrefix == "" {
134 return "", fmt.Errorf("site prefix is empty")
135 }
136 return mcp_server.NewMCPConfig(
137 mcp_server.TransportTypeStreamableHTTP,
138 fmt.Sprintf("%s%s", strings.TrimSuffix(cfg.SitePrefix, "/"), mcp_server.OpenGlobalMCPPath),
139 map[string]string{
140 "Authorization": "Bearer {your_api_key}",
141 },
142 nil,
143 ).ToString("APIPark-MCP-Server"), nil
144}
145
146func (i *imlMcpController) OnComplete() {
147 i.sseServers = make(map[string]http.Handler)

Callers

nothing calls this directly

Calls 2

ToStringMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected