Brazilian Sanctions MCP Server
Enables searching and analyzing Brazilian sanctions across multiple registers (CNEP, CEIS, CEPIM, CEAF, Leniency Agreements) via CNPJ/CPF or name for leniency agreements, with tools for status checks, sanctioning authorities, location info, and comprehensive reports.
README
Brazilian Sanctions MCP Server
An MCP (Model Context Protocol) server that provides access to Brazilian sanctions databases through the Porta da Transparência API.
Components
- mcp_server.py - MCP server exposing Brazilian sanctions search tools
- main.py - AI chatbot using LangChain with Ollama for natural language queries
- BrazillianSanctions.json - MCP configuration file
Features
- Search across 5 Brazilian sanctions registers
- Extract specific fields from API responses (names, sanctioning authorities, dates, locations)
- Check if sanctions are still active based on end dates
- Get comprehensive overview with maximum information from all registers
- A simple Natural language interface via AI chatbot (only for tests)
- Search by CNPJ, CPF, or company name
- Detailed sanction information including reasons, dates, and agencies
- Secure API key authentication
- Async-compatible tool execution
Sanctions Registers Supported
| Register | Purpose | Search By |
|---|---|---|
| CNEP | National Register of Punishments | CNPJ, CPF |
| CEPIM | Register of Sanctioned Public Employees | CNPJ, CPF |
| CEIS | Register of Ineligible Entities | CNPJ, CPF |
| CEAF | Ineligibility Register of Public Servants | CPF |
| Leniency Agreements | Leniency Agreement Records | Name, CNPJ |
Important: Name search is only available for Leniency Agreements. The other registers (CNEP, CEIS, CEPIM, CEAF) only support CNPJ/CPF searches due to API limitations.
API Key Configuration
An API key is REQUIRED to use this system.
Get your API key:
- Visit: https://www.portaldatransparencia.gov.br/ (Brazilian CPF is required)
- Login or create an account
- Go to "Minha Conta" → "API Keys" or "Desenvolvedor"
- Generate a new API key
- Copy the key (format:
abcd1234efgh5678ijkl9012)
Setup:
Create .env file in project root:
PORTAL_TRANSPARENCIA_API_KEY=your_key_here
SECURITY: Never commit your API key to version control!
Usage
Running the MCP Server
The MCP server can be run standalone or used by MCP clients:
python mcp_server.py
OR
To use in Claude/Cursor use
\BrazillianSanctions.json
Running the Chatbot (The chatbot it's just for test, make sure to setup the MCP server into a real AML Agentic AI enviroment to proper use)
The chatbot provides a natural language interface to query sanctions databases:
python main.py
Example queries:
- "Need to know if 30.477.220/0001-71 is sanctioned by Brazil and if yes why?"
- "Search for Petrobras in leniency agreements"
- "Check if company with CNPJ 11222333000181 has any sanctions"
MCP Server Tools
The MCP server exposes the following tools:
Search Tools
- search_cnep - Search CNEP (National Register of Punishments) by CNPJ, CPF, agency, or date range
- search_cepim - Search CEPIM (Register of Sanctioned Public Employees) by CNPJ, CPF, or superior agency
- search_ceis - Search CEIS (Register of Ineligible Entities) by CNPJ, CPF, agency, or date range
- search_ceaf - Search CEAF (Ineligibility Register of Public Servants) by CPF, agency, or date range
- search_acordos_leniencia - Search Leniency Agreements by name, CNPJ, status, or date range
- search_all_registers - Search all registers for a given CNPJ or CPF
Analysis Tools
- check_sanction_status - Check if an entity is still sanctioned across all registers based on end dates
- get_sanctioning_authorities - Get information about who sanctioned the entity (sanctioning agencies)
- get_location_info - Get location/state information (UF, agency location) for sanctioned entities
- get_comprehensive_overview - Get comprehensive overview with maximum information from all registers including names, authorities, dates, location, and status
Utility Tools
- get_sanction_details - Get detailed information about a specific sanction register type
- check_entity_sanctions - Complete sanctions check for an entity across all registers
- batch_search - Search multiple documents (CNPJs or CPFs) in one operation
- generate_sanctions_report - Generate a formatted text report from multiple search results
Chatbot Demo
I'm testing with a local chatbot based in Ollama but the MCP as you know can be plugged to any Agentic AI:
- LLM: Ollama with qwen3:8b model
- Agent: LangChain create_agent with tool calling
- Tools: Custom LangChain tools wrapping the sanctions API
Architecture
User Query (Natural Language)
↓
LangChain Agent (Ollama)
↓
Tool Selection & Execution
↓
MCP Tools / Direct API Calls
↓
Brazilian Sanctions API
↓
Detailed Sanction Information
↓
Natural Language Response
Document Formatting
The system automatically cleans document numbers(Brazilian CPNJ or CPF). Both formatted and unformatted documents work:
# These are equivalent:
"12.345.678/0001-00"
"123456780001000"
"123.456.789-66"
"12345678966"
Error Handling
The system includes comprehensive error handling:
- API connection errors
- Invalid document formats
- Missing API keys
- Rate limiting
- Malformed responses
Troubleshooting
| Issue | Solution |
|---|---|
| API key not found | Set PORTAL_TRANSPARENCIA_API_KEY in .env file |
| Ollama not running | Start Ollama service: ollama serve |
| Model not found | Pull model: ollama pull qwen3:8b |
| Connection timeout | Check internet connection and API status |
| No records found | Verify CNPJ/CPF format and check if entity exists |
References
- API Documentation: https://api.portaldatransparencia.gov.br/swagger-ui/index.html
- Porta da Transparência: https://www.portaldatransparencia.gov.br/
- MCP Protocol: https://modelcontextprotocol.io/
- LangChain: https://python.langchain.com/
- Ollama: https://ollama.ai/
Last Updated: June 2026 API Base URL: https://api.portaldatransparencia.gov.br/api-de-dados
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。