Tesouro Direto▌

by atilioa
Access real-time Tesouro Direto bond data, market status, and investment analysis tools for Brazil's Treasury Direct pla
Provides real-time access to Brazil's Treasury Direct bond market data, enabling users to retrieve market status, search bonds by type and maturity date, and access detailed information for investment analysis.
best for
- / Brazilian investors researching treasury bonds
- / Financial analysts tracking bond markets
- / Investment advisors comparing bond options
capabilities
- / Retrieve treasury bond market status and hours
- / Search bonds by type and maturity date
- / Get detailed bond information and yields
- / Filter IPCA and fixed-rate bonds
- / Access real-time Brazilian government bond data
what it does
Connects to Brazil's Treasury Direct API to retrieve real-time bond market data, bond details, and search Brazilian government bonds by various criteria.
about
Tesouro Direto is a community-built MCP server published by atilioa that provides AI assistants with tools and capabilities via the Model Context Protocol. Access real-time Tesouro Direto bond data, market status, and investment analysis tools for Brazil's Treasury Direct pla It is categorized under finance.
how to install
You can install Tesouro Direto in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
license
AGPL-3.0
Tesouro Direto is released under the AGPL-3.0 license.
readme
Tesouro Direto MCP Server
A Model Context Protocol (MCP) server implementation for integrating with the Tesouro Direto API, enabling natural language access to Brazilian treasury bond data.
Features
Query market data, bond details, and search/filter bonds using everyday language through MCP-compatible clients.
- MCP tools:
market_data: Retrieve general treasury bond market data (opening/closing times, status)bond_data: Get detailed information about a specific bondsearch_bonds: Search/filter bonds by type, maturity, and other criteria
- Smart caching: 10-minute in-memory cache based on API update timestamps to reduce calls while ensuring data freshness.
Example usage
In a MCP-compatible client, you can use the following prompts:
- "Show all available Tesouro Direto bonds"
- "Get details for the bond IPCA+ 2029"
- "Search for IPCA bonds maturing after 2045"
- "What is the current treasury bond market status?"
- "Provide a detailed analysis of the top three bonds with the highest yields for both IPCA and fixed-rate bonds."
Installation
Installing via Smithery
To install Tesouro Direto MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @AtilioA/tesouro-direto-mcp --client claude
Installing via npm
Example JSON for MCP client configuration (Cursor/Claude)
With npx, add this to your ~/.cursor/mcp.json, or claude_desktop_config.json if you are using its desktop app:
{
"mcpServers": {
"tesouro-direto": {
"command": "npx",
"args": [
"-y",
"tesouro-direto-mcp"
],
"env": {
"USE_MCP_CACHE": "true"
}
}
}
}
Building from source
# Clone the repository
git clone https://github.com/AtilioA/tesouro-direto-mcp.git
cd tesouro-direto-mcp
# Install dependencies
pnpm install
# Build the project
pnpm run build
You can run the MCP server directly after building:
node dist/index.js
Or use it with any MCP-compatible client (e.g., MCP Inspector):
npx @modelcontextprotocol/inspector dist/index.js
Tools
market_data
Retrieve general market data, including opening/closing times and current status.
bond_data
Get detailed information for a specific bond by its code.
search_bonds
Search and filter bonds by type (SELIC, IPCA, PREFIXADO), maturity date, and more.
Environment variables
| Variable | Description | Default |
|---|---|---|
USE_MCP_CACHE | Enable the in-memory cache for API responses | true |
Set these in your environment or in your MCP client configuration.
Project structure
src/
├── api/ # API client for Tesouro Direto
│ └── tesouroDireto.ts
├── cache/ # Caching implementation
│ └── apiCache.ts
├── resources/ # MCP resources implementation
│ └── index.ts
├── tools/ # MCP tools implementation
│ ├── bondData.ts
│ ├── marketData.ts
│ └── searchBonds.ts
├── types/ # Type definitions
│ └── index.ts
├── utils/ # Utility functions
│ ├── errorHandler.ts
│ └── logger.ts
├── client.ts # Example MCP client
├── index.ts # Entry point
└── server.ts # MCP server implementation
Available scripts
pnpm run build/npm run build: Build the projectpnpm start/npm start: Start the serverpnpm run dev/npm run dev: Start the server in development mode with auto-reload
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
License
This project is licensed under the GNU Affero General Public License v3.0. See the LICENSE file for details.
FAQ
- What is the Tesouro Direto MCP server?
- Tesouro Direto is a Model Context Protocol (MCP) server profile on explainx.ai. MCP lets AI hosts (e.g. Claude Desktop, Cursor) call tools and resources through a standard interface; this page summarizes categories, install hints, and community ratings.
- How do MCP servers relate to agent skills?
- Skills are reusable instruction packages (often SKILL.md); MCP servers expose live capabilities. Teams frequently combine both—skills for workflows, MCP for APIs and data. See explainx.ai/skills and explainx.ai/mcp-servers for parallel directories.
- How are reviews shown for Tesouro Direto?
- This profile displays 41 aggregated ratings (sample rows for discoverability plus signed-in user reviews). Average score is about 4.6 out of 5—verify behavior in your own environment before production use.
Ratings
4.6★★★★★41 reviews- ★★★★★Isabella Bansal· Dec 28, 2024
Tesouro Direto reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
- ★★★★★Olivia Okafor· Dec 24, 2024
Strong directory entry: Tesouro Direto surfaces stars and publisher context so we could sanity-check maintenance before adopting.
- ★★★★★Meera Tandon· Dec 12, 2024
We wired Tesouro Direto into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
- ★★★★★Dhruvi Jain· Dec 4, 2024
Tesouro Direto has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
- ★★★★★Oshnikdeep· Nov 23, 2024
According to our notes, Tesouro Direto benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.
- ★★★★★Meera Verma· Nov 19, 2024
Useful MCP listing: Tesouro Direto is the kind of server we cite when onboarding engineers to host + tool permissions.
- ★★★★★Ira Taylor· Nov 15, 2024
We wired Tesouro Direto into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
- ★★★★★Isabella Agarwal· Nov 7, 2024
Tesouro Direto is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
- ★★★★★Daniel Li· Nov 3, 2024
Strong directory entry: Tesouro Direto surfaces stars and publisher context so we could sanity-check maintenance before adopting.
- ★★★★★Amina Tandon· Oct 26, 2024
Tesouro Direto is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.
showing 1-10 of 41