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.0.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.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wigolo_langchain-0.2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 778f2258a4135550e6417776ee91cc3f4f06a3b6483a7c8dab78fda88a7ed2f6
MD5 6dbc2c3c582bb8f07970655233ec454f
BLAKE2b-256 343c6dc15f19ff904c1f8f90b35a7b1532d94e1761d8cf64f0a6d1fb0f3c07bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wigolo_langchain-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6503123a09d09942fa53154b387ba49e9dce78d91f61ed47423c814a49687f8e
MD5 28cceb9a765c1e7fd0d531cf5223c9f7
BLAKE2b-256 c9451897fec9df4c2714c2c61c5820b0aeca57ce09916debcae02f332142e568

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