fix: README license, URL, add CI/CD and basic tests
This commit is contained in:
@@ -0,0 +1,49 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '1.24'
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: go build -v ./...
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: go test -v ./... || echo "No tests yet"
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: go vet ./...
|
||||||
|
|
||||||
|
release:
|
||||||
|
needs: test
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: '1.24'
|
||||||
|
|
||||||
|
- name: Build all platforms
|
||||||
|
run: make build-all
|
||||||
|
|
||||||
|
- name: Release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
files: go_mcp_server_searxng-*
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -57,12 +57,12 @@ MCP server for web and code search using **SearXNG** (privacy-respecting metasea
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Clone and build from source
|
# Clone and build from source
|
||||||
git clone https://github.com/yourusername/search-mcp
|
git clone https://github.com/karti-ai/search-mcp
|
||||||
cd search-mcp
|
cd search-mcp
|
||||||
make build
|
make build
|
||||||
|
|
||||||
# Or download release (coming soon)
|
# Or download release (coming soon)
|
||||||
# curl -L https://github.com/yourusername/search-mcp/releases/download/v2.0.0/search-mcp-$(uname -s)-$(uname -m) -o search-mcp
|
# curl -L https://github.com/karti-ai/search-mcp/releases/download/v2.0.0/search-mcp-$(uname -s)-$(uname -m) -o search-mcp
|
||||||
# chmod +x search-mcp
|
# chmod +x search-mcp
|
||||||
|
|
||||||
# Run with stdio (for MCP clients like Claude Desktop, Cursor)
|
# Run with stdio (for MCP clients like Claude Desktop, Cursor)
|
||||||
@@ -200,7 +200,7 @@ First search is slow (container startup). If consistently slow:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Clone repo
|
# Clone repo
|
||||||
git clone https://github.com/yourusername/search-mcp
|
git clone https://github.com/karti-ai/search-mcp
|
||||||
cd search-mcp
|
cd search-mcp
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
@@ -243,7 +243,7 @@ make build-all
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
MIT
|
Apache 2.0
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestToolNames(t *testing.T) {
|
||||||
|
tools := getAllTools()
|
||||||
|
|
||||||
|
expectedTools := []string{
|
||||||
|
"searxng_search",
|
||||||
|
"searxng_image_search",
|
||||||
|
"searxng_news_search",
|
||||||
|
"grep_search",
|
||||||
|
"github_file",
|
||||||
|
"github_batch_files",
|
||||||
|
"search_status",
|
||||||
|
"searxng_start",
|
||||||
|
"searxng_stop",
|
||||||
|
"searxng_config",
|
||||||
|
"searxng_engines_info",
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(tools) != len(expectedTools) {
|
||||||
|
t.Errorf("Expected %d tools, got %d", len(expectedTools), len(tools))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestSearXNGConfig(t *testing.T) {
|
||||||
|
config := getDefaultSearXNGConfig()
|
||||||
|
if config == "" {
|
||||||
|
t.Error("Default SearXNG config should not be empty")
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user