Skip to main content

LangChain integration for wigolo — local-first web search MCP server

Project description

wigolo-langchain

LangChain integration for wigolo — a local-first web search MCP server for AI coding agents.

Installation

pip install wigolo-langchain

Requires wigolo to be available via npx:

npm install -g wigolo
# or use npx (default, no install needed)

Quick Start

As a Retriever

from wigolo_langchain import WigoloMcpClient, WigoloSearchRetriever

async def main():
    async with WigoloMcpClient() as client:
        retriever = WigoloSearchRetriever(
            client=client,
            max_results=5,
            include_domains=["docs.python.org"],
        )
        docs = await retriever.ainvoke("Python asyncio tutorial")
        for doc in docs:
            print(doc.metadata["title"], doc.metadata["url"])

As LangChain Tools (for Agents)

from wigolo_langchain import WigoloMcpClient, WigoloSearchTool, WigoloFetchTool

async def main():
    async with WigoloMcpClient() as client:
        search = WigoloSearchTool(client=client)
        fetch = WigoloFetchTool(client=client)

        # Use in a LangChain agent
        tools = [search, fetch]

Custom MCP Server Command

# Use a local development build instead of npx
client = WigoloMcpClient(command="node", args=["./dist/index.js"])

API Reference

WigoloMcpClient

Async MCP client that communicates with wigolo via subprocess.

  • command — executable to run (default: "npx")
  • args — arguments (default: ["wigolo"])
  • timeout — request timeout in seconds (default: 30.0)
  • connect() / disconnect() — lifecycle management
  • call_tool(name, arguments) — invoke any wigolo MCP tool
  • Supports async with context manager

WigoloSearchRetriever

LangChain BaseRetriever that searches via wigolo.

  • clientWigoloMcpClient instance
  • max_results — max search results (default: 5)
  • include_domains — domain whitelist
  • category — "general", "code", "docs", "news", "papers"

WigoloSearchTool / WigoloFetchTool

LangChain BaseTool wrappers for wigolo search and fetch.

  • Accept the same parameters as the wigolo MCP tools
  • Return JSON strings (for agent consumption)
  • Handle errors gracefully (return error JSON instead of raising)

License

GNU AGPL-3.0-only — same license as the parent wigolo project. Full terms in the root LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wigolo_langchain-0.2.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wigolo_langchain-0.2.1-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file wigolo_langchain-0.2.1.tar.gz.

File metadata

  • Download URL: wigolo_langchain-0.2.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for wigolo_langchain-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a3020506d51ba571c4c3a1c1243191ba89f522c053fe9c4d9a72c104e0f3660b
MD5 ccb42e1fb5a9fdac92bcfbb73eaf2cf2
BLAKE2b-256 054d15ae4c8f3ccf8ad544e0be50c64cd0add362cdeb121d80ae7a16f7132cec

See more details on using hashes here.

File details

Details for the file wigolo_langchain-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for wigolo_langchain-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e69b63b333112dcb0bcf279f3a813fb1492c8260b8731190952042e8229058cf
MD5 1ac1a89a674d2863d12e5a37487f22d7
BLAKE2b-256 4a1c3e69e2d9ba6394266c4d2e30d1a166c68b2c7b37553d8bb862e2c8ca199e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page