How to Use the BCB Economia — PIB, Dívida, Reservas, PIX e SGS MCP in LangChain
Build multi-step economic reasoning pipelines in LangChain using live Brazilian Central Bank data.
Works with every AI agent you already use
…and any MCP-compatible client
Connect BCB Economia — PIB, Dívida, Reservas, PIX e SGS MCP to LangChain
Create your Vinkius account to connect BCB Economia — PIB, Dívida, Reservas, PIX e SGS 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.
Chain Brazilian Macro Indicators in LangChain
ReAct agents need sequential data to make sense of emerging markets. You give your LangChain agent access to `get_pib` and `get_desemprego`, and it decides the order of operations. It pulls the IBC-Br monthly GDP proxy, evaluates the trend, and conditionally triggers the unemployment rate fetch based on the first result. This sequential logic turns raw endpoints into actual economic analysis. Instead of dumping numbers into a prompt, your agent chains `get_divida_pib` directly into a vector store lookup for historical context. You track every token and latency spike through LangSmith tracing while the agent builds a complete fiscal picture of Brazil.
Map PIX Payment Velocity to Trade Balance
Brazil runs on PIX. Your LangChain pipelines can hit `get_pix_estatisticas` to track domestic transaction volumes in real time. The agent then pulls the export surplus via `get_balanca_comercial` to compare internal liquidity against external commodity flows. Passing these outputs between chain links creates a dynamic view of the Brazilian economy. The agent evaluates the trade balance first, formats the output, and feeds it as the prompt context for the PIX volume analysis. You control the entire flow with standard LangChain composability.
Query 20,000+ Custom SGS Series via MCP
Hardcoding specific indicators limits your agent's reasoning. The `get_serie_bcb` tool lets your LangChain setup query any of the 20,000+ time series from the Central Bank's SGS database dynamically. If the agent needs the Selic rate (11) or inflation (IPCA 433), it just asks for the code. Multi-step pipelines thrive on this flexibility. The agent starts with a broad query for international reserves using `get_reservas`. If it detects a drop, it automatically calls the custom SGS MCP tool to pull the USD exchange rate (SGS code 1) to check for currency intervention, all within a single execution trace.
Validate Outputs with Built-in Guardrails
Financial data requires strict formatting before it hits your downstream apps. You can wrap the `get_pib` output in a LangChain Pydantic parser to guarantee the agent returns a valid float for the GDP percentage variation. The system catches bad parsing immediately and forces the agent to retry the tool call. This keeps your pipelines from crashing when the Central Bank updates an indicator format. The agent handles the error, adjusts its parsing strategy, and re-runs the specific tool without breaking the entire chain.
Set up BCB Economia — PIB, Dívida, Reservas, PIX e SGS MCP in LangChain
Prerequisites
- Python 3.10+ installed
-
langchain-mcp-adapters+langgraphpackages - Active Vinkius subscription with a valid endpoint token
- 1
Install dependencies
Run
pip install langchain-mcp-adapters langgraph langchain-openai. The MCP adapters package converts MCP tools into native LangChainBaseToolobjects. - 2
Connect via HTTP transport
Use
MultiServerMCPClientwith"transport": "http"pointing to your Vinkius endpoint. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. - 3
Create a ReAct agent
Pass the discovered tools to
create_react_agent()from LangGraph. The agent automatically routes BCB Economia — PIB, Dívida, Reservas, PIX e SGS tool calls through the MCP protocol. - 4
Run with any LLM
Swap
ChatOpenAIforChatAnthropic,ChatGoogleGenerativeAI, or any LangChain-compatible model. The MCP tools work identically across all providers.
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
async with MultiServerMCPClient({
"bcb-economia-pib-divida-reservas-pix-e-sgs-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 BCB Economia — PIB, Dívida, Reservas, PIX e SGS 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 Banco Central do Brasil. 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 BCB Economia — PIB, Dívida, Reservas, PIX e SGS MCP in LangChain
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the BCB Economia — PIB, Dívida, Reservas, PIX e SGS MCP today
We host it, we monitor it, we maintain it. You just paste one token.