MCPcopy Create free account
hub / github.com/cronitorio/cronitor-cli / runMCPServer

Function runMCPServer

cmd/dash.go:1036–1061  ·  view source on GitHub ↗

runMCPServer starts the MCP server for Cursor integration

(instanceName string)

Source from the content-addressed store, hash-verified

1034
1035// runMCPServer starts the MCP server for Cursor integration
1036func runMCPServer(instanceName string) {
1037 // Create MCP server
1038 s := server.NewMCPServer(
1039 fmt.Sprintf("Cronitor Dashboard (%s)", instanceName),
1040 Version,
1041 server.WithToolCapabilities(false),
1042 )
1043
1044 // Create and register the Cronitor MCP handler
1045 handler := lib.NewCronitorMCPHandler(instanceName)
1046
1047 // Register tools
1048 if err := handler.RegisterTools(s); err != nil {
1049 fatal(fmt.Sprintf("Failed to register MCP tools: %v", err), 1)
1050 }
1051
1052 // Register resources
1053 if err := handler.RegisterResources(s); err != nil {
1054 fatal(fmt.Sprintf("Failed to register MCP resources: %v", err), 1)
1055 }
1056
1057 // Start the stdio server
1058 if err := server.ServeStdio(s); err != nil {
1059 fatal(fmt.Sprintf("MCP server error: %v", err), 1)
1060 }
1061}
1062
1063// Helper function to slugify a string for filenames
1064func slugify(s string) string {

Callers 1

dash.goFile · 0.85

Calls 4

RegisterToolsMethod · 0.95
RegisterResourcesMethod · 0.95
NewCronitorMCPHandlerFunction · 0.92
fatalFunction · 0.85

Tested by

no test coverage detected