Skip to main content

A tool that can give you freedom of using Brave search and content fetching using MCP and Langchan

Project description

Local test

Create venv

(base) ~/Documents/home_services/MCP/brave-mcp-langchain> uv sync
warning: Skipping installation of entry points (`project.scripts`) because this project is not packaged; to install entry points, set `tool.uv.package = true` or define a `build-system`
Using CPython 3.12.8 interpreter at: /home/oreo/miniconda3/python
Creating virtual environment at: .venv
Resolved 34 packages in 13ms
Installed 33 packages in 447ms
 + annotated-types==0.7.0
 + anyio==4.9.0
 + attrs==25.3.0
 + certifi==2025.6.15
 + click==8.2.1
 + colorama==0.4.6
 + h11==0.16.0
 + httpcore==1.0.9
 + httpx==0.28.1
 + httpx-sse==0.4.1
 + idna==3.10
 + jsonschema==4.24.0
 + jsonschema-specifications==2025.4.1
 + markdown-it-py==3.0.0
 + mcp==1.10.1
 + mdurl==0.1.2
 + pydantic==2.11.7
 + pydantic-core==2.33.2
 + pydantic-settings==2.10.1
 + pygments==2.19.2
 + python-dotenv==1.1.1
 + python-multipart==0.0.20
 + referencing==0.36.2
 + rich==14.0.0
 + rpds-py==0.26.0
 + shellingham==1.5.4
 + sniffio==1.3.1
 + sse-starlette==2.4.1
 + starlette==0.47.1
 + typer==0.16.0
 + typing-extensions==4.14.1
 + typing-inspection==0.4.1
 + uvicorn==0.35.0

Install package

(base) ~/Documents/home_services/MCP/brave-mcp-langchain>  uv pip install -e .
Using Python 3.12.8 environment at: /home/oreo/miniconda3
Resolved 34 packages in 632ms
      Built brave-mcp-langchain @ file:///home/oreo/Documents/home_services/MCP/brave-mcp-langchain
Prepared 1 package in 3.27s
Installed 1 package in 19ms
 + brave-mcp-langchain==0.1.0 (from file:///home/oreo/Documents/home_services/MCP/brave-mcp-langchain)

Add any dependency

uv add "beautifulsoup4>=4.13.3" "httpx>=0.28.1" "mcp[cli]>=1.3.0"

Run mcp inspector

mcp dev server.py

Run mcp server

uv run brave-mcp-langchain

OR

To run SSE mode

/usr/local/bin/uv run --directory /home/oreo/Documents/home_services/MCP/brave-mcp-langchain brave-mcp-langchain sse 5000

OR

To run STDIO mode

/usr/local/bin/uv run --directory /home/oreo/Documents/home_services/MCP/brave-mcp-langchain brave-mcp-langchain

Run SSE mode

python server.py sse 5000

MCP Setting

{
  "mcpServers": {
    "kubernetes": {
      "autoApprove": [
        "configuration_view",
        "events_list",
        "namespaces_list",
        "pods_get",
        "pods_log",
        "pods_run"
      ],
      "disabled": true,
      "timeout": 60,
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "kubernetes-mcp-server@latest"
      ]
    },
    "k8s": {
      "timeout": 60,
      "type": "stdio",
      "command": "C:\\Users\\oreo\\.local\\bin\\uv.EXE",
      "args": [
        "run",
        "--with",
        "kubernetes",
        "--with",
        "mcp[cli]",
        "mcp",
        "run",
        "C:\\Users\\oreo\\dummy_sevrer.py"
      ]
    },
    "brave-mcp-langchain": {
      "disabled": false,
      "timeout": 60,
      "type": "stdio",
      "command": "C:\\Users\\oreo\\.local\\bin\\uv.EXE",
      "args": [
        "run",
        "--directory",
        "C:\\Users\\oreo\\Documents\\home_services\\MCP\\brave-mcp-langchain",
        "brave-mcp-langchain"
      ]
    }
  }
}

Use installed dependencies

{
  "mcpServers": {
    "kubernetes": {
      "autoApprove": [
        "configuration_view",
        "events_list",
        "namespaces_list",
        "pods_get",
        "pods_log",
        "pods_run"
      ],
      "disabled": true,
      "timeout": 60,
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "kubernetes-mcp-server@latest"
      ]
    },
    "k8s": {
      "timeout": 60,
      "type": "stdio",
      "command": "C:\\Users\\oreo\\.local\\bin\\uv.EXE",
      "args": [
        "run",
        "--with",
        "kubernetes",
        "--with",
        "mcp[cli]",
        "mcp",
        "run",
        "C:\\Users\\oreo\\dummy_sevrer.py"
      ]
    },
    "brave-mcp-langchain": {
      "disabled": false,
      "timeout": 60,
      "type": "stdio",
      "command": "C:\\Users\\oreo\\.local\\bin\\uv.EXE",
      "args": [
        "run",
        "brave-mcp-langchain"
      ]
    }
  }
}

Use with Langchain

It can also be used as Langchain tool. Try below code to try

import httpx
import asyncio
from langchain.tools import Tool
from brave_mcp_langchain import brave_tool

async def test_search():
    result = await brave_tool.search_tool.ainvoke({"query": "LangGraph overview", "max_results": 10})
    print(result)

    result = await brave_tool.fetch_content_tool.ainvoke({
        "url": "https://iamatulsingh.github.io"
    })
    print(result)

asyncio.run(test_search())

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

brave_mcp_langchain-0.1.0.tar.gz (47.8 kB view details)

Uploaded Source

Built Distribution

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

brave_mcp_langchain-0.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file brave_mcp_langchain-0.1.0.tar.gz.

File metadata

  • Download URL: brave_mcp_langchain-0.1.0.tar.gz
  • Upload date:
  • Size: 47.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for brave_mcp_langchain-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d3f81128cbc0211514497b9c1cbdd62341f74da3e2db24ed0250850dcec318e9
MD5 2895058a8f9fb23282451addd44a6087
BLAKE2b-256 5148c089756461209c49a6a9ceef2042b888fd386ef7b237521b3ebf41e3e394

See more details on using hashes here.

File details

Details for the file brave_mcp_langchain-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for brave_mcp_langchain-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 853ac0e4b2cbd7f3be291dc6878d00332d713744046cffe586c88eb7c24cea07
MD5 9c212ed1fdb31b316c6f9324f2edcdf0
BLAKE2b-256 389d204284713912b0e4da664ede49718e36acfd4be400bbd310f734122ebaef

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