4,500+ servers built on MCP Fusion
Vinkius
BrasilAPI logo
Vinkius
LangChain logo

How to Use the BrasilAPI MCP in LangChain

Run multi-step LangChain runs that query CNPJs, verify CEP addresses, and pull live Brazilian bank data in a single chain.

See Vinkius in Action

Works with every AI agent you already use

…and any MCP-compatible client

BrasilAPI MCP on Cursor AI Code Editor MCP Client BrasilAPI MCP on Claude Desktop App MCP Integration BrasilAPI MCP on OpenAI Agents SDK MCP Compatible BrasilAPI MCP on Visual Studio Code MCP Extension Client BrasilAPI MCP on GitHub Copilot AI Agent MCP Integration BrasilAPI MCP on Google Gemini AI MCP Integration BrasilAPI MCP on Lovable AI Development MCP Client BrasilAPI MCP on Mistral AI Agents MCP Compatible BrasilAPI MCP on Amazon AWS Bedrock MCP Support
MCP Servers - Free for Subscribers
LangChain

Connect BrasilAPI MCP to LangChain

Create your Vinkius account to connect BrasilAPI to LangChain and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.

GDPR Free for Subscribers

Chain CNPJ audits directly into LangChain agent runs

Let your LangChain agent pull official corporate records using `get_cnpj_details` and feed that raw text straight into your downstream processing chains. You don't have to manually parse Brazilian tax registration data because the agent handles the schema mapping on the fly. LangSmith tracks every step of these MCP Server calls, showing you the exact token usage and latency when fetching business structures. If a CNPJ query fails or returns unexpected data, your chain can catch the exception and try an alternative path without dropping the execution.

Resolve Brazilian addresses with CEP routing

Feed postal codes into `get_cep_details` to automatically resolve street names, neighborhoods, and states inside your conversational chains using this MCP Server. This tool lets your agent correct typos in user-submitted addresses before writing them to your database. Because LangChain handles state through graph structures, you can pass the resolved city data into `list_brazilian_states` to cross-reference regional tax rules. Your agent makes these decisions sequentially, using the output of the address lookup to decide which state policy to pull next.

Track vehicle values through FIPE lookup sequences

Build financial workflows that fetch current car valuations with `get_fipe_vehicle_price` and pipe those numbers into your custom calculation nodes. Your agent reads the vehicle's market value, compares it against historic trends, and formats the output for client reports. Combining this tool with `list_brazilian_banks` lets your chain build a complete auto-financing recommendation based on active institutions. The agent handles the multi-step logic, querying the vehicle price first, then searching for compatible lenders in the same run.

Setup guide

Set up BrasilAPI MCP in LangChain

Prerequisites

  • Python 3.10+ installed
  • langchain-mcp-adapters + langgraph packages
  • Active Vinkius subscription with a valid endpoint token
  1. 1

    Install dependencies

    Run pip install langchain-mcp-adapters langgraph langchain-openai. The MCP adapters package converts MCP tools into native LangChain BaseTool objects.

  2. 2

    Connect via HTTP transport

    Use MultiServerMCPClient with "transport": "http" pointing to your Vinkius endpoint. Replace [YOUR_TOKEN_HERE] with your token from cloud.vinkius.com.

  3. 3

    Create a ReAct agent

    Pass the discovered tools to create_react_agent() from LangGraph. The agent automatically routes BrasilAPI tool calls through the MCP protocol.

  4. 4

    Run with any LLM

    Swap ChatOpenAI for ChatAnthropic, ChatGoogleGenerativeAI, or any LangChain-compatible model. The MCP tools work identically across all providers.

agent.py
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI

async with MultiServerMCPClient({
    "brasilapi-mcp": {
        "transport": "http",
        "url": "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp",
    }
}) as client:
    tools = client.get_tools()

    agent = create_react_agent(
        ChatOpenAI(model="gpt-4o"),
        tools,
    )
    result = await agent.ainvoke({
        "messages": "List recent BrasilAPI transactions"
    })
    print(result["messages"][-1].content)

Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by BrasilAPI. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.

Why Choose Vinkius

Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.

Real-time monitoring

Live

visibility into every interaction

Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.

Built-in savings

60%

lower AI costs

Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.

Single dashboard

One

place for every integration

Every tool your AI connects to, managed from a single screen. One account, complete control.

Common questions about BrasilAPI MCP in LangChain

Install the adapter package and use the multi-server client to point to the Vinkius endpoint. Call the tool getter method and pass that list directly to your agent constructor to start querying Brazilian data.
Yes, every call to tools like `get_cnpj_details` is automatically tracked if you have LangSmith enabled. You will see exact execution times and payload sizes for every Brazilian corporate registry lookup.
Your agent can use standard ReAct logic to catch the error and retry or ask the user for clarification. If `get_cep_details` returns a 404 for a bad postal code, the chain won't crash; it just handles the failure gracefully.
You can load this MCP Server alongside database tools or search tools in the same LangChain agent. The agent decides when to pull bank registries or vehicle prices and when to write those details to your internal storage.
Your queries for specific postal codes and corporate tax IDs run in an isolated Vinkius sandbox that doesn't persist your payload history. No raw Brazilian business records or address lookups are stored on the host after the tool execution completes.

Start using the BrasilAPI MCP today

We host it, we monitor it, we maintain it. You just paste one token.

Built & Managed by Vinkius 30s setup 6 tools

We've already built the connector for BrasilAPI. Just plug in your AI agents and start using Vinkius.

No hosting. No infrastructure. No complex setup.
All 6 tools are live and waiting. You're up and running in seconds.

Claude Claude
ChatGPT ChatGPT
Cursor Cursor
Gemini Gemini
Windsurf Windsurf
VS Code VS Code
JetBrains JetBrains
Vercel Vercel
+ other MCP clients

Vinkius gives your AI agents access to the full catalog of app connectors, all fully managed, secure, and enterprise-ready. One subscription, every tool you need.

Zero hosting required Full MCP catalog included Enterprise-grade security Auto-updated by Vinkius

Built, hosted, and secured by Vinkius. You just connect and go.