{"id":"f332f59b-55a4-465e-808e-8ab33d304c89","slug":"tesouro-direto-mcp","kind":"mcp","name":"tesouro-direto-mcp","summary":"🗣️ Query Brazilian treasury bond data with natural language","owner":"AtilioA","repoUrl":"https://github.com/AtilioA/tesouro-direto-mcp","license":"AGPL-3.0","licenseTier":"strong-copyleft","trust":"community","stars":4,"match":null,"fewStars":true,"format":"mcp","createdAt":"2025-04-14T19:04:15.000Z","addedAt":"2026-10-21T03:58:00.698Z","logoUrl":"https://avatars.githubusercontent.com/u/27153776?u=df26762941f5a1709432ad74eaf9169072876d1c&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["cloud-infra","data-analytics"],"tags":["tesouro-direto","treasury-bonds"],"runtime":"node","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-21T03:58:17.155Z","sample":false,"url":"https://conduits.dev/tools/tesouro-direto-mcp","language":"TypeScript","transports":["stdio"],"install":{"npm":"tesouro-direto-mcp"},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# Tesouro Direto MCP Server\n\n[![smithery badge](https://smithery.ai/badge/@AtilioA/tesouro-direto-mcp)](https://smithery.ai/server/@AtilioA/tesouro-direto-mcp)\n[![npm version](https://img.shields.io/npm/v/tesouro-direto-mcp.svg)](https://www.npmjs.com/package/tesouro-direto-mcp)\n[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](LICENSE)\n\nA Model Context Protocol (MCP) server implementation for integrating with the Tesouro Direto API, enabling natural language access to Brazilian treasury bond data.\n\n---\n\n## Features\n\nQuery market data, bond details, and search/filter bonds using everyday language through MCP-compatible clients.\n\n- **MCP tools**:\n  - `market_data`: Retrieve general treasury bond market data (opening/closing times, status)\n  - `bond_data`: Get detailed information about a specific bond\n  - `search_bonds`: Search/filter bonds by type, maturity, and other criteria\n- **Smart caching**: 10-minute in-memory cache based on API update timestamps to reduce calls while ensuring data freshness.\n\n---\n\n## Example usage\n\nIn a MCP-compatible client, you can use the following prompts:\n\n- *\"Show all available Tesouro Direto bonds\"*\n- *\"Get details for the bond IPCA+ 2029\"*\n- *\"Search for IPCA bonds maturing after 2045\"*\n- *\"What is the current treasury bond market status?\"*\n- *\"Provide a detailed analysis of the top three bonds with the highest yields for both IPCA and fixed-rate bonds.\"*\n\n---\n\n## Installation\n\n### Installing via Smithery\n\nTo install Tesouro Direto MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@AtilioA/tesouro-direto-mcp):\n\n```bash\nnpx -y @smithery/cli install @AtilioA/tesouro-direto-mcp --client claude\n```\n\n### Installing via npm\n\n### Example JSON for MCP client configuration (Cursor/Claude)\n\nWith [npx](https://docs.npmjs.com/cli/commands/npx), add this to your `~/.cursor/mcp.json`, or `claude_desktop_config.json` if you are using its desktop app:\n\n```json\n{\n    \"mcpServers\": {\n        \"tesouro-direto\": {\n            \"command\": \"npx\",\n            \"args\": [\n                \"-y\",\n                \"tesouro-direto-mcp\"\n            ],\n            \"env\": {\n                \"USE_MCP_CACHE\": \"true\"\n            }\n        }\n    }\n}\n```\n\n---\n\n### Building from source\n\n```bash\n# Clone the repository\ngit clone https://github.com/AtilioA/tesouro-direto-mcp.git\ncd tesouro-direto-mcp\n\n# Install dependencies\npnpm install\n\n# Build the project\npnpm run build\n```\n\nYou can run the MCP server directly after building:\n\n```bash\nnode dist/index.js\n```\n\nOr use it with any MCP-compatible client (e.g., MCP Inspector):\n\n```bash\nnpx @modelcontextprotocol/inspector dist/index.js\n```\n\n---\n\n## Tools\n\n### `market_data`\n\nRetrieve general market data, including opening/closing times and current status.\n\n### `bond_data`\n\nGet detailed information for a specific bond by its code.\n\n### `search_bonds`\n\nSearch and filter bonds by type (SELIC, IPCA, PREFIXADO), maturity date, and more.\n\n---\n\n## Environment variables\n\n| Variable         | Description                                 | Default |\n|------------------|---------------------------------------------|---------|\n| `USE_MCP_CACHE`  | Enable the in-memory cache for API responses| `true`  |\n\nSet these in your environment or in your MCP client configuration.\n\n---\n\n## Project structure\n\n```\nsrc/\n├── api/         # API client for Tesouro Direto\n│   └── tesouroDireto.ts\n├── cache/       # Caching implementation\n│   └── apiCache.ts\n├── resources/   # MCP resources implementation\n│   └── index.ts\n├── tools/       # MCP tools implementation\n│   ├── bondData.ts\n│   ├── marketData.ts\n│   └── searchBonds.ts\n├── types/       # Type definitions\n│   └── index.ts\n├── utils/       # Utility functions\n│   ├── errorHandler.ts\n│   └── logger.ts\n├── client.ts    # Example MCP client\n├── index.ts     # Entry point\n└── server.ts    # MCP server implementation\n```\n\n---\n\n## Available scripts\n\n- `pnpm run build` / `npm run build`: Build the project\n- `pnpm start` / `npm start`: Start the server\n- `pnpm run dev` / `npm run dev`: Start the server in development mode with auto-reload\n\n---\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request on [GitHub](https://github.com/AtilioA/tesouro-direto-mcp).\n\n---\n\n## License\n\nThis project is licensed under the GNU Affero General Public License v3.0. See the [LICENSE](LICENSE) file for details.\n"}