diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-10 19:28:27 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-10 19:28:27 +0200 |
| commit | 5551695f3b0d10c9a22cfacdb10c2cf7bd572421 (patch) | |
| tree | 282611eacf1fd4c38d54d5cea87decdf2b1cbdb7 /Magefile.go | |
| parent | ec745129258ae800065e302a2a40b54488cbca08 (diff) | |
Add MCP server implementation with comprehensive test coverage
Implements a full Model Context Protocol (MCP) server for managing and serving prompts
to LLM applications. The server provides CRUD operations for prompts with automatic
backups and template rendering support.
Key additions:
- cmd/hexai-mcp-server: Main MCP server binary entrypoint
- internal/hexaimcp: Server orchestrator with configuration and setup
- internal/mcp: Core MCP protocol implementation (JSON-RPC 2.0)
- internal/promptstore: Prompt storage with JSONL backend and automatic backups
- Comprehensive test suites achieving 80%+ coverage for all MCP packages
- Magefile targets for building and installing the MCP server
- Complete documentation for setup, API, prompts, and backups
Test coverage:
- internal/hexaimcp: 84.3%
- internal/mcp: 80.3%
- internal/promptstore: 81.2%
- Overall project: 81.5%
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Diffstat (limited to 'Magefile.go')
| -rw-r--r-- | Magefile.go | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/Magefile.go b/Magefile.go index fb43238..f0ce2f0 100644 --- a/Magefile.go +++ b/Magefile.go @@ -24,7 +24,7 @@ var ( // Build builds binaries. func Build() error { - mg.Deps(BuildHexaiLSP, BuildHexaiCLI, BuildHexaiTmuxAction, BuildHexaiTmuxEdit) + mg.Deps(BuildHexaiLSP, BuildHexaiCLI, BuildHexaiTmuxAction, BuildHexaiTmuxEdit, BuildHexaiMCPServer) printCoverage() return nil } @@ -53,7 +53,13 @@ func BuildHexaiTmuxEdit() error { return sh.RunV("go", "build", "-o", "hexai-tmux-edit", "cmd/hexai-tmux-edit/main.go") } -// Dev runs tests, vet, lint, then builds with race for both binaries. +// BuildHexaiMCPServer builds the MCP server binary. +func BuildHexaiMCPServer() error { + printCoverage() + return sh.RunV("go", "build", "-o", "hexai-mcp-server", "cmd/hexai-mcp-server/main.go") +} + +// Dev runs tests, vet, lint, then builds with race for all binaries. func Dev() error { printCoverage() mg.Deps(Test, Vet, Lint) @@ -66,7 +72,10 @@ func Dev() error { if err := sh.RunV("go", "build", "-race", "-o", "hexai-tmux-action", "cmd/hexai-tmux-action/main.go"); err != nil { return err } - return sh.RunV("go", "build", "-race", "-o", "hexai-tmux-edit", "cmd/hexai-tmux-edit/main.go") + if err := sh.RunV("go", "build", "-race", "-o", "hexai-tmux-edit", "cmd/hexai-tmux-edit/main.go"); err != nil { + return err + } + return sh.RunV("go", "build", "-race", "-o", "hexai-mcp-server", "cmd/hexai-mcp-server/main.go") } // Run launches the LSP server via go run (useful during development). @@ -109,7 +118,10 @@ func Install() error { if err := sh.RunV("cp", "-v", "./hexai-tmux-action", bin+"/"); err != nil { return err } - return sh.RunV("cp", "-v", "./hexai-tmux-edit", bin+"/") + if err := sh.RunV("cp", "-v", "./hexai-tmux-edit", bin+"/"); err != nil { + return err + } + return sh.RunV("cp", "-v", "./hexai-mcp-server", bin+"/") } // RunTmuxAction runs the hexai-tmux-action TUI via go run (reads stdin). |
