internetsearch

package
v0.16.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

README

Internet Search Tools

This package contains tools for searching the internet using various search providers.

Available Providers

Only made available when the BRAVE_API_KEY environment variable is set.

  • Web Search: General web search using Brave Search API
  • Image Search: Search for images with metadata
  • News Search: Search for news articles and recent events
  • Local Search: Search for local businesses and points of interest
  • Video Search: Search for videos with metadata
SearXNG

Only made available when the SEARXNG_BASE_URL environment variable is set.

  • Web Search: General web search using SearXNG instance
  • Image Search: Search for images via SearXNG
  • News Search: Search for news articles via SearXNG
  • Video Search: Search for videos via SearXNG

Configuration

Brave Search

Set the BRAVE_API_KEY environment variable to enable Brave search:

"dev-tools": {
  "type": "stdio",
  "command": "/Users/samm/git/sammcj/mcp-devtools/bin/mcp-devtools",
  "env": {
    "BRAVE_API_KEY": "your-key-here"
  }
}

Get your API key from: https://brave.com/search/api/

SearXNG

Set the SEARXNG_BASE_URL environment variable to enable SearXNG search.

"dev-tools": {
  "type": "stdio",
  "command": "/Users/samm/git/sammcj/mcp-devtools/bin/mcp-devtools",
  "env": {
    "SEARXNG_BASE_URL": "https://your-searxng-instance.com"
  }
}

Conditional Registration

Tools only register when their required environment variables are present. This ensures:

  • Clean tool lists showing only functional tools
  • Clear startup logging about enabled/disabled providers
  • No runtime API key errors

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewToolResultJSON

func NewToolResultJSON(data interface{}) (*mcp.CallToolResult, error)

NewToolResultJSON creates a new tool result with JSON content

Types

type SearchResponse

type SearchResponse struct {
	Query       string         `json:"query"`
	ResultCount int            `json:"resultCount"`
	Results     []SearchResult `json:"results"`
	Provider    string         `json:"provider"`
	Timestamp   time.Time      `json:"timestamp"`
}

SearchResponse represents a unified response structure

type SearchResult

type SearchResult struct {
	Title       string                 `json:"title"`
	URL         string                 `json:"url"`
	Description string                 `json:"description"`
	Type        string                 `json:"type"` // web, image, news, video, local
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

SearchResult represents a unified search result

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL