MCPcopy Create free account
hub / github.com/JordanCoin/codemap / handleStatus

Function handleStatus

mcp/main.go:383–421  ·  view source on GitHub ↗
(ctx context.Context, req *mcp.CallToolRequest, input EmptyInput)

Source from the content-addressed store, hash-verified

381type EmptyInput struct{}
382
383func handleStatus(ctx context.Context, req *mcp.CallToolRequest, input EmptyInput) (*mcp.CallToolResult, any, error) {
384 cwd, _ := os.Getwd()
385 home := os.Getenv("HOME")
386
387 // Check active watchers
388 watchersMu.RLock()
389 activeWatchers := len(watchers)
390 var watchedPaths []string
391 for path := range watchers {
392 watchedPaths = append(watchedPaths, path)
393 }
394 watchersMu.RUnlock()
395
396 watchStatus := "none"
397 if activeWatchers > 0 {
398 watchStatus = fmt.Sprintf("%d active: %s", activeWatchers, strings.Join(watchedPaths, ", "))
399 }
400
401 return textResult(fmt.Sprintf(`codemap MCP server v2.1.0
402Status: connected
403Local filesystem access: enabled
404Working directory: %s
405Home directory: %s
406Active watchers: %s
407
408Available tools:
409 list_projects - Discover projects in a directory
410 get_structure - Project tree view
411 get_dependencies - Import/function analysis
412 get_diff - Changed files vs branch
413 find_file - Search by filename
414 get_importers - Find what imports a file
415 get_handoff - Build/read cross-agent handoff summary
416
417Live watch tools:
418 start_watch - Start watching a project for changes
419 stop_watch - Stop watching a project
420 get_activity - See recent coding activity (hot files, edits, timeline)`, cwd, home, watchStatus)), nil, nil
421}
422
423func handleListProjects(ctx context.Context, req *mcp.CallToolRequest, input ListProjectsInput) (*mcp.CallToolResult, any, error) {
424 // Expand ~ to home directory

Callers 1

Calls 1

textResultFunction · 0.85

Tested by 1