mcp-TesouroDireto
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_HOST | No | Bind address for HTTP transports. | 127.0.0.1 |
| MCP_PORT | No | Bind port for HTTP transports. | 8000 |
| MCP_TRANSPORT | No | Transport to use: stdio, streamable-http or sse. | stdio |
| TESOURO_DIRETO_CSV_URL | No | Override with a direct CSV URL or a local file path (useful offline/tests). | Official CKAN resource URL |
| TESOURO_DIRETO_CACHE_DIR | No | Where the raw CSV is cached. | ~/.cache/mcp-tesouro-direto |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Brazilian government bonds (Tesouro Direto) and the ANBIMA yield curve.
How to work with this server:
Call
list_bond_typeswhen you need the meaning of a bond code (LTN, LFT, NTN-B, NTN-B Principal, NTN-F, NTN-C, RendA+, Educa+).Call
get_bond_datafor historical daily prices and yields. Filter withasset_codes(bond family) and, to isolate one maturity,asset_code(e.g. "NTN-B Principal 150835").Call
get_current_ratesfor the latest snapshot of every bond.Call
get_bond_statsfor compact per-maturity summary statistics.Call
get_yield_curvefor ANBIMA's current real/nominal/inflation curve.
Important:
yield_bidis a decimal annual rate: 0.1183 means 11.83% p.a.yield_bid_pctand the*_pctstatistics are already in percent.Prices (
price_bid) are in Brazilian reais (R$).Asset codes end with the maturity date as DDMMYY, e.g. "LTN 010123".
Long daily series are truncated to the most recent
max_rowsrows; usefrequency="monthly"or a narrower date range for long histories.Cite the source as "Tesouro Transparente" (bond data) or "ANBIMA" (curve) and include the reference/retrieval date. Do not invent prices or yields; report what the tools return.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_bond_typesA | Describe the Brazilian government bond types available at Tesouro Direto. Returns each bond's short code, official name, indexer, coupon structure, a short description and the aliases accepted by the other tools. |
| get_bond_dataA | Historical daily prices and yields of Tesouro Direto bonds. |
| get_current_ratesA | Current prices and yields for all Tesouro Direto bonds. Returns the latest available snapshot (the most recent reference date in the data) as CSV, one row per bond and maturity, ordered by maturity. |
| get_bond_statsA | Summary statistics per bond maturity: last/min/max yield, mean and dates. |
| get_yield_curveB | Current Brazilian yield curve from ANBIMA (ETTJ). |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| analyze_bond | Prompt an agent to analyze one bond family with this server's data. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| bond_types_resource | Static catalog of Tesouro Direto bond types and aliases. |
TDQS
Scored across 5 tools
Each tool targets a distinct data shape: bond type metadata, historical series, current snapshot, summary statistics, and the ANBIMA yield curve. There is mild overlap between get_current_rates and get_bond_stats (both expose latest yields) and between get_bond_stats and get_bond_data aggregation, but descriptions clearly steer selection.
All names are snake_case with a predictable verb_noun structure (list_bond_types, get_bond_data, get_current_rates, get_bond_stats, get_yield_curve). The 'get_' retrieval prefix plus domain object makes intent obvious across the set.
Five tools is well-scoped for a read-only market-data source, and each covers a genuinely different access pattern (metadata, history, snapshot, stats, curve). No tool looks redundant enough to remove.
The read-only lifecycle is covered end to end: discover bond types, pull history, get current quotes, summarize, and fetch the reference curve. Minor gaps exist — no lookup of a single bond by code/alias alias beyond list_bond_types, no fee/tax or liquidity/coupon-payment detail.