go/cmd/core-mcp/main.go
Snider 41a0faba75 refactor: migrate module path from Snider/Core to host-uk/core
Move Go module from github.com/Snider/Core to github.com/host-uk/core
to match the new repository location under the host-uk organization.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 15:29:42 +00:00

47 lines
891 B
Go

// core-mcp is a standalone MCP server for Core.
// It allows Claude Code and other MCP clients to interact with Core's
// file system and IDE functionality.
//
// Usage:
//
// Add to Claude Code's MCP settings:
// {
// "mcpServers": {
// "core": {
// "command": "/path/to/core-mcp"
// }
// }
// }
package main
import (
"context"
"log"
"os"
"os/signal"
"syscall"
"github.com/host-uk/core/pkg/mcp"
)
func main() {
// Create standalone MCP service (no Core instance needed)
svc := mcp.NewStandalone()
// Set up graceful shutdown
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM)
go func() {
<-sigCh
cancel()
}()
// Run the MCP server on stdio
if err := svc.Run(ctx); err != nil {
log.Printf("MCP server error: %v", err)
os.Exit(1)
}
}