mirror of
https://github.com/xlionjuan/searxng-mcp-go.git
synced 2026-11-17 04:17:51 +00:00
- Return context error instead of empty success when retry wait is canceled - Thread caller context into ShouldRetry so isRetryableError checks ctx.Err() - Add warning field to SearchResponse JSON and CLI text header for external content - Add regression test for empty-response retry cancellation - Update stale docs referencing removed performSearch function - Fix OUTPUT_FORMAT.md JSON example and gofmt formatting
2.4 KiB
2.4 KiB
SearXNG Language Parameter Research
Current Behavior
The implementation uses the language parameter end-to-end.
- MCP schema exposes
language SearchArgs.Languagemaps tolanguage- Search execution sends
languageto SearXNG when the field is non-empty ValidateSearchArgs()rejects invalid language codes
Semantics
- Empty
languagemeans auto mode: the parameter is omitted and SearXNG chooses its default - Valid values include codes like
en,zh-tw, andja - Invalid values are rejected with a validation error
- There is no fallback that rewrites invalid input to English
Historical Note
Earlier versions of this project and this document discussed a lang parameter and English fallback behavior. That no longer reflects the codebase.
Reference Points
internal/searxng/searcher.gointernal/searxng/validation.gomcp.go
Note: The curl examples below use both the
langandlanguageparameters for comparison testing and are for research purposes. The actual code only sends thelanguageparameter and does not uselang.
Query: python programming
curl -s "http://localhost:8888/search?q=python+programming&format=json&lang=en" | jq '[.results[] | {engine, title}]'
curl -s "http://localhost:8888/search?q=python+programming&format=json&language=en" | jq '[.results[] | {engine, title}]'
curl -s "http://localhost:8888/search?q=python+programming&format=json&lang=ja" | jq '[.results[] | {engine, title}]'
curl -s "http://localhost:8888/search?q=python+programming&format=json&language=ja" | jq '[.results[] | {engine, title}]'
Query: artificial intelligence
curl -s "http://localhost:8888/search?q=artificial+intelligence&format=json&lang=en" | jq '[.results[] | {engine, title}]'
curl -s "http://localhost:8888/search?q=artificial+intelligence&format=json&lang=de" | jq '[.results[] | {engine, title}]'
curl -s "http://localhost:8888/search?q=artificial+intelligence&format=json&lang=fr" | jq '[.results[] | {engine, title}]'
curl -s "http://localhost:8888/search?q=artificial+intelligence&format=json" | jq '[.results[] | {engine, title}]'
Reference Points
internal/searxng/types.go—SearchArgsstructinternal/searxng/searcher.go— search request construction and executioninternal/searxng/validation.go—ValidateSearchArgs()language validationmcp.go— MCP tool schema definition