Skip to content

Commit f6000ef

Browse files
authored
Chore: Some required clean up (#40)
* Remove DEBUG log lines that leak req/resp data * Docsgen logger should use stderr (visible in CI) * Update GH action for docs to trigger for changes to our tools/docsgen files * Log line added for starting the health check
1 parent 3b18f84 commit f6000ef

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

.github/workflows/deploy-docs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
paths:
77
- "cmd/**"
88
- "docs/**"
9+
- "tools/docsgen/**"
910
workflow_dispatch:
1011

1112
permissions:

internal/daemon/daemon.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ func (d *Daemon) launchServer(ctx context.Context, server runtime.Server, wg *sy
177177
"environment", env,
178178
)
179179
fmt.Println(fmt.Sprintf("Starting MCP server: '%s'...", server.Name))
180-
181180
stdioClient, err := client.NewStdioMCPClient(runtimeBinary, env, args...)
182181
if err != nil {
183182
return fmt.Errorf("error starting MCP server: '%s': %w", server.Name, err)
@@ -292,6 +291,8 @@ func (d *Daemon) healthCheckLoop(
292291
interval time.Duration,
293292
timeout time.Duration,
294293
) {
294+
d.logger.Info("Starting health check loop", "interval", interval, "timeout", timeout)
295+
295296
ticker := time.NewTicker(interval)
296297
defer ticker.Stop()
297298

internal/daemon/server.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ func (a *ApiServer) handleApiRequest(w http.ResponseWriter, r *http.Request) {
129129
if err != nil {
130130
a.handleError(w, err)
131131
} else {
132-
// TODO: Remove debug logging for this later to prevent data leaking into logs.
133-
a.logger.Debug("API request response", "method", r.Method, "path", path, "result", result)
134132
a.writeJSON(w, result)
135133
}
136134
}
@@ -215,9 +213,6 @@ func (a *ApiServer) callTool(ctx context.Context, serverName, toolName string, a
215213
return nil, fmt.Errorf("%w: %s/%s", ErrToolForbidden, serverName, toolName)
216214
}
217215

218-
// TODO: Remove debug logging later to prevent data leaking into logs.
219-
a.logger.Debug("Calling tool", "server", serverName, "tool", toolName, "args", args)
220-
221216
result, err := mcpClient.CallTool(ctx, mcp.CallToolRequest{
222217
Params: mcp.CallToolParams{
223218
Name: toolName,

tools/docsgen/cli/cmds.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package main
55

66
import (
7-
"io"
87
"os"
98

109
"github.com/hashicorp/go-hclog"
@@ -19,7 +18,7 @@ func main() {
1918
logger := hclog.New(&hclog.LoggerOptions{
2019
Name: "mcpd.docsgen",
2120
Level: hclog.Info,
22-
Output: io.Discard, // TODO: need to be able to configure this for log file/stdout/stderr.
21+
Output: os.Stderr,
2322
})
2423

2524
// docsPath is the path to the commands documentation, relative to the repository root.

0 commit comments

Comments
 (0)