MCPcopy Index your code
hub / github.com/coder/coder / GetMCPServerConfigs

Method GetMCPServerConfigs

coderd/aibridgedserver/aibridgedserver.go:437–460  ·  view source on GitHub ↗
(_ context.Context, _ *proto.GetMCPServerConfigsRequest)

Source from the content-addressed store, hash-verified

435}
436
437func (s *Server) GetMCPServerConfigs(_ context.Context, _ *proto.GetMCPServerConfigsRequest) (*proto.GetMCPServerConfigsResponse, error) {
438 cfgs := make([]*proto.MCPServerConfig, 0, len(s.externalAuthConfigs))
439 for _, eac := range s.externalAuthConfigs {
440 var allowlist, denylist string
441 if eac.MCPToolAllowRegex != nil {
442 allowlist = eac.MCPToolAllowRegex.String()
443 }
444 if eac.MCPToolDenyRegex != nil {
445 denylist = eac.MCPToolDenyRegex.String()
446 }
447
448 cfgs = append(cfgs, &proto.MCPServerConfig{
449 Id: eac.ID,
450 Url: eac.MCPURL,
451 ToolAllowRegex: allowlist,
452 ToolDenyRegex: denylist,
453 })
454 }
455
456 return &proto.GetMCPServerConfigsResponse{
457 CoderMcpConfig: s.coderMCPConfig, // it's fine if this is nil
458 ExternalAuthMcpConfigs: cfgs,
459 }, nil
460}
461
462func (s *Server) GetMCPServerAccessTokensBatch(ctx context.Context, in *proto.GetMCPServerAccessTokensBatchRequest) (*proto.GetMCPServerAccessTokensBatchResponse, error) {
463 if len(in.GetMcpServerConfigIds()) == 0 {

Callers 1

TestGetMCPServerConfigsFunction · 0.95

Calls 1

StringMethod · 0.45

Tested by 1

TestGetMCPServerConfigsFunction · 0.76