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

Function getCoderMCPServerConfig

coderd/aibridgedserver/aibridgedserver.go:646–665  ·  view source on GitHub ↗

Deprecated: Injected MCP in AI Bridge is deprecated and will be removed in a future release.

(experiments codersdk.Experiments, accessURL string)

Source from the content-addressed store, hash-verified

644
645// Deprecated: Injected MCP in AI Bridge is deprecated and will be removed in a future release.
646func getCoderMCPServerConfig(experiments codersdk.Experiments, accessURL string) (*proto.MCPServerConfig, error) {
647 // Both the MCP & OAuth2 experiments are currently required in order to use our
648 // internal MCP server.
649 if !experiments.Enabled(codersdk.ExperimentMCPServerHTTP) {
650 return nil, xerrors.Errorf("%q experiment not enabled", codersdk.ExperimentMCPServerHTTP)
651 }
652 if !experiments.Enabled(codersdk.ExperimentOAuth2) {
653 return nil, xerrors.Errorf("%q experiment not enabled", codersdk.ExperimentOAuth2)
654 }
655
656 u, err := url.JoinPath(accessURL, codermcp.MCPEndpoint)
657 if err != nil {
658 return nil, xerrors.Errorf("build MCP URL with %q: %w", accessURL, err)
659 }
660
661 return &proto.MCPServerConfig{
662 Id: aibridged.InternalMCPServerID,
663 Url: u,
664 }, nil
665}
666
667// credentialKindOrDefault converts the proto credential kind string to
668// the database enum, defaulting to "centralized" when the value is

Callers 1

NewServerFunction · 0.85

Calls 2

EnabledMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected