MCPcopy Index your code
hub / github.com/github/github-mcp-server / generateRemoteServerDocs

Function generateRemoteServerDocs

cmd/github-mcp-server/generate_docs.go:107–129  ·  view source on GitHub ↗
(docsPath string)

Source from the content-addressed store, hash-verified

105}
106
107func generateRemoteServerDocs(docsPath string) error {
108 content, err := os.ReadFile(docsPath) //#nosec G304
109 if err != nil {
110 return fmt.Errorf("failed to read docs file: %w", err)
111 }
112
113 toolsetsDoc := generateRemoteToolsetsDoc()
114
115 // Replace content between markers
116 updatedContent, err := replaceSection(string(content), "START AUTOMATED TOOLSETS", "END AUTOMATED TOOLSETS", toolsetsDoc)
117 if err != nil {
118 return err
119 }
120
121 // Also generate remote-only toolsets section
122 remoteOnlyDoc := generateRemoteOnlyToolsetsDoc()
123 updatedContent, err = replaceSection(updatedContent, "START AUTOMATED REMOTE TOOLSETS", "END AUTOMATED REMOTE TOOLSETS", remoteOnlyDoc)
124 if err != nil {
125 return err
126 }
127
128 return os.WriteFile(docsPath, []byte(updatedContent), 0600) //#nosec G306
129}
130
131// octiconImg returns an img tag for an Octicon that works with GitHub's light/dark theme.
132// Uses picture element with prefers-color-scheme for automatic theme switching.

Callers

nothing calls this directly

Calls 3

replaceSectionFunction · 0.85

Tested by

no test coverage detected