ScavioScavio
ProductoPreciosDocumentación
Iniciar sesionComenzar
  1. Inicio
  2. Tutoriales
  3. Cómo agregar Search MCP a oMLX Local LLM
Tutorial

Cómo agregar Search MCP a oMLX Local LLM

Ofrezca búsqueda web de modelos locales de oMLX a través de MCP. Conecte la búsqueda de Scavio a oMLX para obtener respuestas fundamentadas a $0,005/consulta.

Obtener clave API gratisDocumentacion API

oMLX ejecuta LLM localmente en Apple Silicon pero no tiene búsqueda web integrada. Agregar un servidor MCP de búsqueda brinda a los modelos locales acceso web en vivo para obtener respuestas fundamentadas. Este tutorial configura la conexión MCP, crea una herramienta de búsqueda y la prueba con consultas oMLX. Cada búsqueda cuesta $0,005.

Requisitos previos

  • oMLX instalado en macOS
  • Python 3.8+
  • Una clave API de Scavio de scavio.dev
  • Mac de silicona de Apple

Guia paso a paso

Paso 1: Crear servidor de búsqueda MCP para oMLX

Cree un servidor MCP liviano al que oMLX pueda conectarse para realizar búsquedas web.

Python
import os, requests, json
from http.server import HTTPServer, BaseHTTPRequestHandler

API_KEY = os.environ['SCAVIO_API_KEY']
SH = {'x-api-key': API_KEY, 'Content-Type': 'application/json'}

def web_search(query, num_results=5):
    data = requests.post('https://api.scavio.dev/api/v1/search',
        headers=SH, json={'query': query, 'country_code': 'us', 'num_results': num_results}).json()
    return [{'title': r.get('title', ''), 'link': r.get('link', ''),
             'snippet': r.get('snippet', '')} for r in data.get('organic_results', [])[:num_results]]

# MCP tool definition for oMLX
mcp_tool = {
    'name': 'web_search',
    'description': 'Search the web for current information. Use for any question about recent events, current data, or facts you are not certain about.',
    'input_schema': {
        'type': 'object',
        'properties': {
            'query': {'type': 'string', 'description': 'The search query'}
        },
        'required': ['query']
    }
}

# Test the tool
results = web_search('latest macOS release 2026')
for r in results:
    print(f'{r["title"]}: {r["link"]}')
print(f'\nTool definition ready for oMLX')
print(json.dumps(mcp_tool, indent=2))

Paso 2: Configura oMLX para usar la herramienta de búsqueda

Agregue la configuración del servidor MCP a la configuración de oMLX.

Python
# oMLX MCP configuration file: ~/.omlx/mcp.json
omlx_config = {
    'mcpServers': {
        'scavio-search': {
            'command': 'npx',
            'args': ['-y', '@anthropic-ai/mcp-server-scavio'],
            'env': {
                'SCAVIO_API_KEY': os.environ.get('SCAVIO_API_KEY', 'your-key-here')
            }
        }
    }
}

# Alternative: direct HTTP MCP server
# If oMLX supports HTTP MCP servers:
omlx_http_config = {
    'mcpServers': {
        'web-search': {
            'url': 'http://localhost:3100/mcp',
            'tools': [mcp_tool]
        }
    }
}

config_path = os.path.expanduser('~/.omlx/mcp.json')
print(f'Save this config to: {config_path}')
print(json.dumps(omlx_config, indent=2))
print(f'\nThen restart oMLX to pick up the new MCP server')

Paso 3: Pruebe la conexión a tierra de búsqueda con oMLX

Verifique que los modelos oMLX utilicen la herramienta de búsqueda para obtener información actual.

Python
def test_grounded_query(query):
    """Simulate what oMLX does: search then format context."""
    results = web_search(query)
    context = '\n'.join([f'[{i+1}] {r["title"]}: {r["snippet"]}' for i, r in enumerate(results)])
    print(f'Query: {query}')
    print(f'Search returned {len(results)} results')
    print(f'\nContext for LLM:')
    print(context[:500])
    print(f'\nThe local LLM now has current data to answer accurately.')
    print(f'Cost: $0.005')

test_queries = [
    'what is the latest version of python',
    'best local LLM for coding 2026',
    'apple silicon m5 benchmarks',
]
for q in test_queries:
    test_grounded_query(q)
    print()

Ejemplo en Python

Python
import os, requests
SH = {'x-api-key': os.environ['SCAVIO_API_KEY'], 'Content-Type': 'application/json'}

def omlx_search(query):
    data = requests.post('https://api.scavio.dev/api/v1/search',
        headers=SH, json={'query': query, 'country_code': 'us', 'num_results': 5}).json()
    for r in data.get('organic_results', [])[:3]:
        print(f'{r["title"]}: {r.get("snippet", "")[:60]}')

omlx_search('latest macOS release 2026')
print('Cost: $0.005')

Ejemplo en JavaScript

JavaScript
const SH = { 'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json' };
async function omlxSearch(query) {
  const data = await fetch('https://api.scavio.dev/api/v1/search', {
    method: 'POST', headers: SH,
    body: JSON.stringify({ query, country_code: 'us', num_results: 5 })
  }).then(r => r.json());
  (data.organic_results || []).slice(0, 3).forEach(r => console.log(`${r.title}`));
}
await omlxSearch('latest macOS release 2026');

Salida esperada

JSON
Query: what is the latest version of python
Search returned 5 results

Context for LLM:
[1] Python Release Python 3.13.2: Python 3.13.2 is the latest stable release...
[2] Download Python: The current production versions are Python 3.13.2 and...
[3] What's New In Python 3.13: This article explains the new features in...

The local LLM now has current data to answer accurately.
Cost: $0.005

Tutoriales relacionados

  • Cómo agregar una búsqueda web basada en tierra a un LLM local
  • Cómo conectar Scavio MCP a LLM locales
  • Cómo poner a tierra un LLM local con una API de búsqueda

Preguntas frecuentes

La mayoria de los desarrolladores completan este tutorial en 15 a 30 minutos. Necesitaras una clave API de Scavio (el plan gratuito funciona) y un entorno de Python o JavaScript.

oMLX instalado en macOS. Python 3.8+. Una clave API de Scavio de scavio.dev. Mac de silicona de Apple. Una clave API de Scavio te da 50 creditos gratuitos al registrarte.

Si. El plan gratuito incluye 50 creditos al registrarte, mas que suficiente para completar este tutorial y crear un prototipo funcional.

Scavio tiene un paquete nativo de LangChain (langchain-scavio), un servidor MCP y una API REST simple que funciona con cualquier cliente HTTP. Este tutorial usa the raw REST API, pero puedes adaptarlo al framework que prefieras.

Recursos relacionados

Best Of

Las mejores herramientas de base de conocimientos personales para LLM locales en mayo de 2026

Read more
Best Of

Los mejores servidores de búsqueda MCP para LLM locales (2026)

Read more
Use Case

Recuperación de búsqueda web local LLM 2026

Read more
Use Case

Búsqueda web de agentes para LLM local

Read more
Workflow

Diario Local LLM Search Grounding Pipeline

Read more
Solution

Búsqueda local de LLM después de Google Paywall

Read more

Empieza a construir

Ofrezca búsqueda web de modelos locales de oMLX a través de MCP. Conecte la búsqueda de Scavio a oMLX para obtener respuestas fundamentadas a $0,005/consulta.

Obtener clave API gratuitaLeer la documentacion
ScavioScavio

API de busqueda en tiempo real para agentes de IA. Busca en todas las plataformas, no solo en Google.

Producto

  • Funciones
  • Precios
  • Panel
  • Afiliados

Desarrolladores

  • Documentacion
  • Referencia de API
  • Inicio rapido
  • Integracion MCP
  • Python SDK

Alternativas

  • Alternativa a Tavily
  • Alternativa a SerpAPI
  • Alternativa a Firecrawl
  • Alternativa a Exa

Herramientas

  • Formateador JSON
  • cURL a codigo
  • Contador de tokens
  • Todas las herramientas

© 2026 Scavio. Todos los derechos reservados.

Featured on TAAFT
Terminos de servicioPolitica de privacidad