cvm-mcp
The cvm-mcp server provides financial data from the CVM's Open Data Portal, enabling LLMs to consult financial statements of publicly traded companies. You can:
Search for companies by name, CNPJ, or CVM code before conducting any analysis.
Analyze companies with a standard 5-year financial analysis covering metrics like Net Revenue, EBIT, estimated EBITDA, Net Income, Net Margin, EBITDA Margin, ROE, Current Liquidity, Gross Debt, Cash, Net Debt, and Net Debt/EBITDA.
Obtain financial indicators for a specified range of years, with options for consolidated or individual statements.
Retrieve raw financial statements from specific statements (e.g., BPA, BPP, DRE, DFC_MD, DFC_MI, DVA, DMPL, DRA) for a given year, including account codes, descriptions, and values in R$ millions, with consolidated or individual statement options.
Allows querying financial data from the Brazilian Securities and Exchange Commission (CVM) through an MCP server that retrieves company financial statements, indicators, and raw accounting data.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cvm-mcpanalise a Petrobras"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cvm-mcp
MCP server that fetches and processes financial data directly from the CVM Open Data Portal (dados.cvm.gov.br), without relying on third parties. It exposes tools for an LLM client (Claude Desktop, Claude Code, etc.) to query the financial statements published by publicly traded companies.
The default view is quarterly: the tools start from the last quarter the company published and return the previous 12 months, quarter by quarter, with the accounting accounts as published by the CVM — without calculated indicators.
What it does
Tool | When to use |
| Resolve name/CNPJ/CVM code before any analysis |
| Generic request ("analyze company X") — DRE for the last 4 quarters |
| Other statement (balance sheet, cash flow) or more than 4 quarters |
| When the user explicitly asks for the closed annual period (DFP) |
All monetary values are normalized to R$ millions. See Limitations below — the AI always receives warnings when a data point is derived or could not be obtained.
Related MCP server: FinancialReports MCP Server
How the quarter is assembled
The CVM's ITR publishes only Q1, Q2, and Q3, and already brings each quarter isolated in addition to the year-to-date accumulations — so cutting a quarter is filtering by period, not subtracting.
Q4 does not exist in the ITR. It is derived as exercício completo (DFP) − acumulado até o 3T (ITR), matched account by account by the accounting code. Every such period is marked with derivado: true in the response, along with an explicit warning.
Two consequences worth understanding:
Stock accounts are never derived. BPA and BPP are balances on a date, so the year-end closing is already the Q4 value. Only flow accounts (DRE, DFC, DVA, DRA, DMPL) undergo subtraction.
The "last quarter" is per company, not global. Non-calendar fiscal years close in other months — Camil, for example, has quarters Mar–May, Jun–Aug, Sep–Nov, and Dec–Feb. The server resolves this by each company's dates, and the label (
2T26) is always accompanied byinicioandfim.
Installation
Requires Python 3.10+. Works the same on Windows, macOS, and Linux.
Option 1 — pipx (recommended, isolates the environment)
pipx install .Runs from any folder afterwards, as the command cvm-mcp.
Option 2 — pip in a virtual environment
python -m venv .venv
# Windows (PowerShell)
.venv\Scripts\Activate.ps1
# macOS / Linux
source .venv/bin/activate
pip install -e .Option 3 — directly from source, without installing
pip install -r requirements.txt # ou: pip install mcp[cli] httpx pandas platformdirs
python -m cvm_mcpConfiguring in Claude Desktop
Edit claude_desktop_config.json (Windows: %APPDATA%\Claude\claude_desktop_config.json; macOS: ~/Library/Application Support/Claude/claude_desktop_config.json) and add:
{
"mcpServers": {
"cvm": {
"command": "cvm-mcp"
}
}
}If you prefer not to install with pipx (Option 3), use:
{
"mcpServers": {
"cvm": {
"command": "python",
"args": ["-m", "cvm_mcp"]
}
}
}Local cache
The files downloaded from the CVM (registry + annual ZIPs of ITR and DFP) are cached locally to avoid re-downloading on every query — the check uses ETag/Last-Modified, so updates on the CVM portal are detected automatically.
Worth sizing: the packages come compressed (~20–30 MB per year), but are extracted for use, and each year-type takes up a few hundred MB on disk. The quarterly view typically touches two years of ITR plus one year of DFP.
Default location (via platformdirs, without OS hardcoding):
Windows:
%LOCALAPPDATA%\cvm-mcpmacOS:
~/Library/Caches/cvm-mcpLinux:
~/.cache/cvm-mcp
To use another directory (e.g., restricted environments/CI), set CVM_MCP_CACHE_DIR before running the server.
Important limitations
Q4 is derived, not published. The CVM does not disclose the 4th quarter separately; the value comes from
ano cheio − acumulado 9M. It matches the fiscal year by construction, but it is not a number the company reported.No calculated indicators. This version returns published accounting accounts, not margins, ROE, or EBITDA. The indicator code remains in the repository (
indicators.py,accounts.py), not linked to any tool, to be readapted to the quarterly base later.No market data: the CVM does not publish stock prices, market value, or multiples (P/E, EV/EBITDA). Requests of this type are outside the scope of this source.
Stock accounts do not add up. BPA and BPP are balances: adding up the 4 quarters of equity produces nothing meaningful. Only flow accounts can be accumulated over 12 months.
Not every company has 4 quarters (recent IPO, suspension, registration cancellation, late ITR filing). The window returns the periods that exist, without filling gaps with zero.
Financial sector companies use a different DRE chart of accounts, so the accounting codes are not comparable line by line with those of non-financial companies.
Development
python -m venv .venv
.venv\Scripts\Activate.ps1 # ou source .venv/bin/activate
pip install -e .
python -m cvm_mcp # roda o servidor via stdioProject structure:
src/cvm_mcp/
config.py # constantes e diretório de cache (cross-platform)
cache.py # download HTTP com cache condicional + extração de ZIP
parsers.py # leitura dos CSVs (encoding/separador da CVM)
cvm_client.py # busca de empresas e carregamento dos demonstrativos
quarters.py # montagem da janela trimestral e derivação do 4T
models.py # estruturas de dados (Company, Quarter)
server.py # servidor MCP (FastMCP) e definição das tools
accounts.py # (inativo) mapa do plano de contas -> itens financeiros
indicators.py # (inativo) cálculo de indicadores em base anualaccounts.py and indicators.py are not imported by any tool in this version — they remain in the repository to serve as a base when indicators are reintroduced on a quarterly basis.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceMCP Server for accessing 36 Brazilian public data sources and 1 agent, enabling AI agents to query government data on economy, legislation, transparency, judiciary, elections, environment, health, and more.MIT
- AlicenseNot gradedqualityBmaintenanceOfficial MCP server for the FinancialReports API. Provides direct access to regulatory filings, financial data, and corporate information from listed companies worldwide via 15 curated tools.2MIT
- AlicenseBqualityCmaintenanceMCP server for B3 (Brazilian stock exchange) data, offering tools for real-time quotes, historical prices, dividends, FIIs, fundamental analysis, options, and indices via natural language.9MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that exposes real-time financial data tools for stock search, company info, historical prices, and financial metrics from Yahoo Finance, enabling AI agents to answer natural-language questions about stocks and financial markets.MIT
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
The financial MCP for AI agents - 90+ financial tables, SEC filings, signals, alt-data.
Real SEC, 13F, insider, congress & macro data your AI agent can cite. Hosted MCP, 24 tools.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/IgormCarvalho/cvm-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server