diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..226759a --- /dev/null +++ b/.env.example @@ -0,0 +1,13 @@ +# Provider: anthropic | openai | openai-compatible | gemini +CAPTCHA_LLM_PROVIDER=anthropic +# Optional endpoint override (local/Ollama/OpenRouter). Empty = provider default. +CAPTCHA_LLM_BASE_URL= +CAPTCHA_LLM_API_KEY=sk-... +# Vision-capable model id (e.g. claude-opus-4-8, gpt-4o, gemini-2.5-pro) +CAPTCHA_LLM_MODEL=claude-opus-4-8 +# Optional separate audio/transcription model (e.g. whisper-1). Empty = use MODEL. +CAPTCHA_LLM_AUDIO_MODEL= +CAPTCHA_LLM_TEMPERATURE=0 +CAPTCHA_LLM_MAX_TOKENS=1024 +CAPTCHA_LLM_TIMEOUT=60s +CAPTCHA_LOG_LEVEL=info diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..bc161e1 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,15 @@ +version: "2" +linters: + enable: + - govet + - staticcheck + - errcheck + - ineffassign + - unused + - gosec +linters-settings: + govet: + enable: + - fieldalignment +issues: + exclude-rules: [] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0d66663 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +.PHONY: build test e2e e2e-live lint tidy +build: + go build -o bin/captcha-solver-mcp ./cmd/captcha-solver-mcp +test: + go test ./... +e2e: + go test -tags e2e ./test/e2e/... +e2e-live: + CAPTCHA_E2E_LIVE=1 go test -tags e2e,live ./test/e2e/... +lint: + golangci-lint run +tidy: + go mod tidy diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..32b5fa6 --- /dev/null +++ b/go.mod @@ -0,0 +1,10 @@ +module github.com/lukaszraczylo/captcha-solver-mcp + +go 1.26.3 + +require ( + github.com/google/jsonschema-go v0.3.0 // indirect + github.com/modelcontextprotocol/go-sdk v1.2.0 // indirect + github.com/yosida95/uritemplate/v3 v3.0.2 // indirect + golang.org/x/oauth2 v0.30.0 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..54b584d --- /dev/null +++ b/go.sum @@ -0,0 +1,8 @@ +github.com/google/jsonschema-go v0.3.0 h1:6AH2TxVNtk3IlvkkhjrtbUc4S8AvO0Xii0DxIygDg+Q= +github.com/google/jsonschema-go v0.3.0/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE= +github.com/modelcontextprotocol/go-sdk v1.2.0 h1:Y23co09300CEk8iZ/tMxIX1dVmKZkzoSBZOpJwUnc/s= +github.com/modelcontextprotocol/go-sdk v1.2.0/go.mod h1:6fM3LCm3yV7pAs8isnKLn07oKtB0MP9LHd3DfAcKw10= +github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= +github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4= +golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= +golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU=