cvm-mcp

v0.2.0
cvm-mcp Checked 29 minutes ago Published 21 days ago

One MCP server for the whole CVM open-data repository (dados.cvm.gov.br)

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

search_company

Find the CVM code (`cd_cvm`) of a company by name, CNPJ, ticker or code. Accent- and case-insensitive. This is the entry point for every corporate tool: they key on `cd_cvm`, never on the ticker.

ParameterTypeDescription
query *stringCompany name, partial name, CNPJ, ticker or CVM code. E.g. 'petrobras', 'PETR4'.
limitintegerMaximum companies to return.
statusRegistry situation filter, e.g. 'ATIVO' or 'CANCELADO'.

resolve

Resolve any identifier to the CVM keys (cd_cvm, CNPJ, ticker, name).

ParameterTypeDescription
query *stringA ticker (PETR4), a CNPJ, a cd_cvm or a company name.

list_companies

Browse the CVM company registry, optionally filtered by sector.

ParameterTypeDescription
limitintegerPage size.
offsetintegerRows to skip (paging).
sectorPartial sector name, e.g. 'Energia'.
statusRegistry situation, e.g. 'ATIVO'.

get_tickers

Map tickers (PETR4, VALE3) to CVM codes and company names.

ParameterTypeDescription
cvm_codesOptional CVM codes.
limitintegerMaximum rows.
tickerFilter by trading code, e.g. 'PETR4'.
yearFCA reference year (2018+). Default: latest available.

list_account_codes

List the curated account codes and role names understood by this server.

ParameterTypeDescription
doc_typeOptional filter: BPA, BPP, DRE, DFC_MI, DVA.

get_financial_statements

Full statement lines for one or more companies, as CSV. One row per reported account, with the raw value (`VL_CONTA`) and the value in reais (`VL_CONTA_BRL`).

ParameterTypeDescription
cvm_codes *arrayCVM codes (see search_company).
data_typestring'dfp' = annual, 'itr' = quarterly.
doc_typestringOne or more of BPA, BPP, DRE, DFC_MD, DFC_MI, DMPL, DVA, or '*'.
first_yearFirst fiscal year.
formatstring'con' = consolidated, 'ind' = individual, or '*'.
last_yearLast fiscal year.
max_rowsintegerSafety cap on returned rows.

get_account_history

Follow one account over time for one or more companies (a compact series).

ParameterTypeDescription
account *stringAccount to follow: a CD_CONTA code ('3.01'), a role ('revenue', 'net_income', 'total_assets', 'equity', 'ebit') or, with by='name', a label fragment.
cvm_codes *arrayCVM codes of the companies.
bystringHow to read `account`.
data_typestring'dfp' = annual, 'itr' = quarterly.
doc_typestringBPA, BPP, DRE, DFC_MI, DFC_MD, DVA or DMPL.
first_yearFirst fiscal year.
formatstring'con' or 'ind'.
last_yearLast fiscal year.
max_rowsintegerSafety cap on returned rows.

get_statement_summary

Compact headline view of one company-year: totals, equity, revenue, profit. Returns the top-level accounts with a `role` column (`total_assets`, `equity`, `revenue`, `ebit`, `net_income`, ...).

ParameterTypeDescription
cvm_code *integerCVM code of the company.
data_typestring'dfp' = annual, 'itr' = quarterly.
depthintegerAccount nesting: 0 = totals only, 1 = headline (default).
doc_typestringDocuments to summarize. Default 'BPA,BPP,DRE'.
formatstring'con' = consolidated, 'ind' = individual.
yearFiscal year. Default: current year.

list_fre_tables

List the 36 FRE corporate tables understood by this server.

ParameterTypeDescription
detailbooleanInclude curated key columns.

get_fre_table

Read rows from one FRE table, filtered by company and year. The generic workhorse; prefer the curated helpers when they fit.

ParameterTypeDescription
table *stringTable slug from list_fre_tables, e.g. 'posicao_acionaria'.
cd_cvmOptional CVM code.
columnsOptional subset of columns.
first_yearFirst reference year.
last_yearLast reference year.
max_rowsintegerMaximum rows returned.
versionstring'last' (default), 'first' or 'all'.

get_company_overview

Show which FRE tables have data for one company-year. Downloads and parses the whole year once (the first call can take a while).

ParameterTypeDescription
cd_cvm *integerCVM code from search_company.
year *integerReference year.

get_shareholders

Shareholder position: who owns the company and how much.

ParameterTypeDescription
cd_cvm *integerCVM code from search_company.
year *integerReference year.
max_rowsintegerMaximum rows.
versionstring'last' (default), 'first' or 'all'.

get_compensation

Compensation of the board, officers and fiscal council.

ParameterTypeDescription
cd_cvm *integerCVM code from search_company.
year *integerReference year.
detailstring'orgao' = total by body, 'max_min_avg' = ranges, 'variavel' = bonus.
versionstring'last' (default), 'first' or 'all'.

get_board

Board, officers and fiscal council composition.

ParameterTypeDescription
cd_cvm *integerCVM code from search_company.
year *integerReference year.
versionstring'last' (default), 'first' or 'all'.

get_capital

Share capital events: amounts, approvals and share counts.

ParameterTypeDescription
cd_cvm *integerCVM code from search_company.
year *integerReference year.
versionstring'last' (default), 'first' or 'all'.

get_insider_trades

Transactions by controllers, officers and board members (CVM/VLMO). Returns who traded, the role, the movement type, date, quantity, unit price and volume. This is the insider-trading signal dataset (Instruction 358).

ParameterTypeDescription
company *stringCompany: cd_cvm, CNPJ or name (partial). E.g. 'petrobras' or '9512'.
first_yearFirst year (2018+).
last_yearLast year.
max_rowsintegerMaximum rows.
operationOptional 'Credito' (buy) or 'Debito' (sell).
roleOptional role filter, e.g. 'Diretor', 'Conselho', 'Controlador'.

insider_summary

Net insider buying/selling by year and role (aggregate of VLMO).

ParameterTypeDescription
company *stringcd_cvm, CNPJ or company name.
first_yearFirst year (2018+).
last_yearLast year.

governance_practices

Explain-or-comply governance report: each practice and whether it was adopted.

ParameterTypeDescription
company *stringcd_cvm, CNPJ or company name.
year *integerReference year (2018+).
adoptedOptional filter: 'Sim', 'Nao' or 'Parcialmente'.
chapterOptional chapter filter, e.g. 'Acionistas'.
max_rowsintegerMaximum rows.

governance_score

Adoption rate of the recommended governance practices, overall and by chapter.

ParameterTypeDescription
company *stringcd_cvm, CNPJ or company name.
year *integerReference year (2018+).

get_dfp_document

Filing metadata and the download link of the full document. The link points to the CVM ZIP with the complete filing: an XML with the statement numbers, a PDF with the *notas explicativas* and the company data. Use `get_dfp_notes` to read the notes without handling the file yourself.

ParameterTypeDescription
cvm_codes *arrayCVM codes (see search_company).
year *integerReference year of the filing (YYYY).
data_typestring'dfp' = annual, 'itr' = quarterly.

get_dfp_notes

Read the explanatory notes of one company/year. Without `note` and `pages`, lists the detected numbered notes (number, title, pages). The first call for a company/year downloads the filing PDF (~15 MB) and extracts its text; later calls read the local cache.

ParameterTypeDescription
cvm_code *integerCVM code of the company.
year *integerReference year of the filing (YYYY).
data_typestring'dfp' = annual, 'itr' = quarterly.
max_charsintegerCap on the returned text.
noteNumber of the note to read (omit to list the notes).
pagesRaw page selection of the PDF, e.g. '25' or '25-31'. Use it when the notes could not be split into numbered sections.

search_dfp_notes

Search the extracted text of the filing, returning snippets with pages. Searches every page (not only the detected notes) so a hit is never lost to a segmentation failure. Each match carries the PDF page and, when known, the number of the note it belongs to.

ParameterTypeDescription
cvm_codes *arrayCVM codes to search (see search_company).
term *stringText to look for (accent and case insensitive).
year *integerReference year of the filing (YYYY).
contextintegerCharacters of context around each hit.
data_typestring'dfp' = annual, 'itr' = quarterly.
limitintegerMaximum number of snippets.

search_fund

Find a fund or class and get the CNPJ used by every fund tool. The CVM keys fund data on the *class* CNPJ. The result carries a `family` (`fi`, `fii`, `fidc`, `fiagro`, `fip`) that tells which monthly report covers it — `get_fund_nav` routes automatically.

ParameterTypeDescription
query *stringFund/class name (partial), CNPJ or CVM fund code. E.g. 'itau', '42737077000199'.
limitintegerMaximum matches.

get_fund_nav

NAV time series for any fund, routed to the right CVM dataset. * FIF/FAPI: daily quota, net asset value, subscriptions, redemptions, unitholders. * FII: monthly net asset value, book value per share, unitholders, dividend yield. * FIDC: monthly net asset value and average NAV. * FIAGRO: monthly net asset value, unitholders, returns and fees.

ParameterTypeDescription
fund *stringFund name (partial) or class CNPJ.
first_periodFirst month (YYYY-MM or YYYYMM).
last_periodLast month. Default: latest published.
max_rowsintegerMaximum rows.

get_fund_flows

Monthly subscriptions, redemptions and net flow for one FI fund. Only FIF/FAPI report daily subscriptions and redemptions (Informe Diário). FII, FIDC and FIAGRO do not publish a flow series in the monthly report.

ParameterTypeDescription
fund *stringFund name (partial) or class CNPJ.
first_periodFirst month.
last_periodLast month. Default: latest.

get_fund_portfolio

Holdings of any fund, routed to the right dataset. * FIF/FIAGRO: CDA portfolio (asset, issuer, quantity, market value, cost). * FII: balance-sheet composition (properties, CRI, FII quotas, cash...). * FIDC: credit portfolio by segment (industrial, real estate, payroll...). The output is long-form: one row per `component`, with its value in BRL.

ParameterTypeDescription
fund *stringFund name (partial) or class CNPJ.
blockstringFI only: '1'..'8' for one CDA block, 'all' for every block.
max_rowsintegerMaximum rows.
periodMonth (YYYY-MM). Default: latest available.

get_fidc_report

Credit-fund dashboard: assets, portfolio, net asset value and delinquency. `inadimplencia_pct` is the overdue credit over the total credit portfolio (tables I.2A.2 and I.2 of the FIDC monthly report).

ParameterTypeDescription
fund *stringFIDC name (partial) or class CNPJ.
first_periodFirst month (YYYY-MM).
last_periodLast month. Default: latest.

rank_funds

Rank FI funds in one month by net asset value, net flow, return or unitholders.

ParameterTypeDescription
fund_typeOptional fund type filter, e.g. 'CLASSES - FIF'.
limitintegerRows returned.
metricstringRanking metric.
periodMonth (YYYY-MM). Default: latest.

list_datasets

List every CVM dataset this server understands. This is the entry point: each dataset has an `id`, a period granularity and one or more tables. Table ids are what `describe_dataset` and `run_query` use; SQL views are named `<dataset>__<table>`.

ParameterTypeDescription
detailbooleanInclude the table list of each dataset.
domainOptional domain filter: companies, funds, offerings, enforcement, registry.

describe_dataset

Show the tables, cached periods and columns of one dataset. Columns come from the local cache; if a table was never queried, `columns` is empty — call the corresponding data tool once to populate it. With `detail=True`, `column_details` explains units and pitfalls (e.g. `VL_CONTA` vs `VL_CONTA_BRL`, or FRE percentages).

ParameterTypeDescription
dataset *stringDataset id from list_datasets, e.g. 'dfp', 'fi_inf_diario'.
detailbooleanInclude curated column meanings (description, unit, caveats). Use this before writing run_query SQL.
tableOptional table inside the dataset.

cache_status

What is already downloaded and parsed locally, per dataset.

load_dataset

Download and parse a dataset/period into the local cache. This is the non-destructive counterpart of `refresh_cache`: it reuses archives that are still fresh and only builds the partitions that are missing. Call it before `run_query` so the SQL layer has the tables (and periods) it needs, and use `describe_dataset(detail=True)` for column meanings. Heavy optional tables (`dfp`/`itr` ``parecer``) are skipped unless named in ``table`` or ``include_optional`` is true.

ParameterTypeDescription
dataset *stringDataset id from list_datasets, e.g. 'dfp', 'fi_inf_diario'.
include_optionalbooleanAlso build the heavy optional tables (DFP/ITR `parecer`, which is free text and ~15 MB per year).
periodYear (YYYY) or month (YYYYMM); comma-separated values are accepted. Defaults to the latest published period. Use '*' for every period.
tableOptional table; omit for all tables in the dataset.

refresh_cache

Force a re-download and rebuild of cached partitions. CVM rewrites the current period in place, so use this when the latest month looks stale.

ParameterTypeDescription
dataset *stringDataset id from list_datasets.
periodYear (YYYY) or month (YYYYMM). Omit to refresh everything cached.
tableOptional table; omit for all tables.

run_query

Run SQL across cached CVM tables (DuckDB engine). Use it for questions that combine datasets, for aggregates the curated tools do not expose, and to inspect a table before writing a longer query. Only SELECT/WITH is allowed; the result is capped by `limit`.

ParameterTypeDescription
sql *stringA single read-only SELECT/WITH query. Views are named <dataset>__<table>, e.g. dfp__dre_con, fi_inf_diario__informe, vlmo__transacoes. Only cached periods exist.
limitintegerMaximum rows returned.

search_offerings

Search registered, exempt and restricted public offerings since 1988.

ParameterTypeDescription
asset_typeAsset type, e.g. 'ACOES', 'DEBENTURES', 'COTAS', 'CRI'.
first_dateFirst registration date (YYYY-MM-DD).
issuerIssuer name (partial).
last_dateLast registration date (YYYY-MM-DD).
limitintegerMaximum rows.
riteRite, e.g. 'ICVM 400' or 'RCVM 160'.

issuance_volume

Total offering volume, grouped by year, asset type, issuer, lead or rite. `valor_total` is as reported by CVM; amounts from different decades are not inflation-adjusted.

ParameterTypeDescription
asset_typeOptional asset type filter.
first_dateFirst registration date (YYYY-MM-DD).
group_bystringDimension to aggregate by.
last_dateLast registration date (YYYY-MM-DD).
limitintegerRows returned.
riteOptional rite filter.

league_table

Rank lead underwriters by total offering volume (the ECM/DCM league table).

ParameterTypeDescription
asset_typeOptional asset type filter.
first_dateFirst registration date (YYYY-MM-DD).
last_dateLast registration date (YYYY-MM-DD).
limitintegerUnderwriters returned.
riteOptional rite filter.