brave-mcp-langchain
Create venv
uv sync
Install package
uv pip install brave-mcp-langchain
Run MCP server in STDIO mode
uvx brave-mcp-langchain
To run MCP server in SSE mode
uvx brave-mcp-langchain sse 5003
MCP Setting
{
"mcpServers": {
"brave-mcp-langchain": {
"disabled": false,
"timeout": 60,
"type": "stdio",
"command": "uvx",
"args": [
"brave-mcp-langchain"
]
}
}
}
Use as Langchain tool
It can also be used as Langchain tool. Below is how to validate tool.
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())
Use with langchain example
import asyncio
from langchain.agents import initialize_agent
from langchain.agents.agent_types import AgentType
from langchain_ollama import ChatOllama
from brave_mcp_langchain import brave_tool
llm = ChatOllama(model="llama3.1:8b")
tools = [
brave_tool.search_tool,
brave_tool.fetch_content_tool
]
agent = initialize_agent(
tools=[brave_tool.search_tool, brave_tool.fetch_content_tool],
llm=llm,
agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION,
verbose=True
)
async def run_agent_query():
response = await agent.ainvoke(
"Search for 'iamatulsingh' overview, then fetch content from https://iamatulsingh.github.io"
)
print("\nAgent Response:")
print(response)
asyncio.run(run_agent_query())
🧠 Inspiration & Attribution
This project, brave-mcp-langchain, was inspired by and partially based on the excellent work in duckduckgo-mcp-server by @nickclyde. That project laid the groundwork for integrating DuckDuckGo search and content fetching into the MCP ecosystem.
While brave-mcp-langchain extends the concept to support Brave Search and LangChain workflows, several architectural ideas and implementation patterns were adapted from duckduckgo-mcp-server, which is licensed under the MIT License.
I'm grateful for the open-source community and contributors who make projects like this possible. If you’re interested in DuckDuckGo-based search tools, definitely check out the original repository!
Metadata
Release files for brave-mcp-langchain 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| brave_mcp_langchain-0.2.0.tar.gz | 45.6 kB | Without provenance | Details for brave_mcp_langchain-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| brave_mcp_langchain-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for brave_mcp_langchain-0.2.0-py3-none-any.whl |
Total release size: 53.0 kB
Release files / brave_mcp_langchain-0.2.0.tar.gz
| Download URL | brave_mcp_langchain-0.2.0.tar.gz |
|---|---|
| Size | 45.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9bd16c2e1be0bf5e879bac1a7bb9b46031fc4639573f08e31487d413af5cd969
|
|
BLAKE2b-256 checksum How to use checksums |
83bc96752d65eb8d6dc2612a0766303de454661f0a59c9680a5b9270c327bf45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Release files / brave_mcp_langchain-0.2.0-py3-none-any.whl
| Download URL | brave_mcp_langchain-0.2.0-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3799d7a53cb2f6cfe792c72aeec3353e7a6a963e1af72c4978235876e7e3c239
|
|
BLAKE2b-256 checksum How to use checksums |
6d3766e101638b13cbd84e0787aa20e888c8e5f0e9128f5be971757b90424b34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Security for brave-mcp-langchain 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.