brasilapi-mcp
brasilapi-mcp
自作の Model Context Protocol (MCP) サーバーであり、公開されている BrasilAPI を、LLMクライアント(Claude Desktop、Claude Code、または任意のMCPホスト)が呼び出せるツールとして提供します:CEP、CNPJ、銀行、FIPE車両価格、国民の祝日、DDD市外局番を検索できます。
なぜこれを作ったのか
他人のMCPサーバーを利用するのは簡単です。私が証明したかったのは、自分で構築できるということです — ツールスキーマ、型付きHTTPクライアント、そして全体をテスト可能に保つ境界。BrasilAPIはうってつけです:APIキーが不要で公開データを提供しているため、誰でもこれをクローンしてすぐに実行でき、すべてのツールはネットワークに触れることなくテストで検証されます。
Related MCP server: MCP Brasil API
ツール
ツール | 返す内容 |
| ブラジルの郵便番号に対する住所( |
| CNPJの事業者登録情報(法人名、住所、事業内容、ステータス) |
| ブラジル中央銀行に登録されているすべての銀行 |
| 数値コードによる単一の銀行(例: |
| 指定した年の国民の祝日 |
| 2桁の電話市外局番が対象とする州と都市 |
|
|
| モデルコードに対するFIPE参考価格表 |
インストール
pip install -e .依存関係は mcp(公式Python SDK、v2)と httpx だけです。
実行
brasilapi-mcp # runs the MCP server over stdio (what an MCP client launches)
brasilapi-mcp --help # prints usage and exits, without opening a socketサーバーはstdio経由でMCPを話します — 通常は手動で実行しません。MCPクライアントが起動して通信します。python -m brasilapi_mcp.server でも実行できます。
クライアントへの組み込み
Claude Desktop — claude_desktop_config.json に追加します:
{
"mcpServers": {
"brasilapi": {
"command": "brasilapi-mcp"
}
}
}brasilapi-mcp がPATHにない場合は、command にvenvのスクリプト(例:Windowsでは .../.venv/Scripts/brasilapi-mcp)を指定するか、"command": "python", "args": ["-m", "brasilapi_mcp.server"] を使用してください。
Claude Code — コマンド1つ:
claude mcp add brasilapi -- brasilapi-mcpその後、平易な言葉で 「CEP 01001-000の住所は?」 や 「2026年の国民の祝日を一覧して」 と尋ねると、モデルが対応するツールを呼び出します。
設計 — なぜオフラインでテストするのか
ネットワークは注入可能な境界の背後にあります。BrasilAPIClient はオプションの httpx.Client/トランスポートを受け取るため、テストスイートは固定JSONを備えた httpx.MockTransport を渡し、実際のネットワークI/Oなしで実行します。ツール本体は、クライアントを明示的に受け取る素の同期関数の薄いラッパーであり、ロジックは単体でユニットテスト可能です。また BrasilAPIError は、トレースバックではなく、モデルが読み取れる明確なメッセージになります。
テスト
pip install -e ".[dev]"
pytest -qテストスイートは、モックトランスポートに対するクライアント(すべてのエンドポイント、入力の正規化、404/500の処理)、ツールのロジック関数、サーバーのツール登録をカバーしています。ネットワークには一切アクセスしません。
データに関する注意
BrasilAPIは公開サービスであり、キーは不要です。このサーバーはシークレットを保存せず、環境変数も読み取りません。実際のレスポンスはBrasilAPIおよびその上流ソースに帰属します。
ライセンス
MIT — LICENSE を参照してください。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- FlicenseBqualityDmaintenanceQuery a variety of data from Brasil resources seamlessly. Access information on postal codes, area codes, banks, holidays, taxes, and more through a unified interface. Enhance your AI agents and applications with rich and updated data from BrasilAPI effortlessly.67
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to query Brazilian public data such as CEP, CNPJ, DDD, exchange rates, banks, and holidays via the Model Context Protocol.12MIT
- AlicenseAqualityCmaintenanceExposes the BrasilAPI as MCP tools, enabling AI agents to query Brazilian public data such as CEP, CNPJ, DDD, IBGE, banks, PIX, FIPE, NCM, exchange rates, taxes, weather, CVM information, holidays, ISBN, domains, stock tickers, and TUSS.41Apache 2.0
- AlicenseNot gradedqualityCmaintenanceBrazilian company-registry lookup via Receita Federal, allowing AI agents to query CNPJ data.6MIT
Related MCP Connectors
Validate LatAm IDs: Mexican CLABE, Brazilian CNPJ/CPF checksums + BrasilAPI company/CEP/bank lookups
IBGE: geography, census, economy and health from the official APIs, with provenance. 21 tools.
Free Brazilian CNPJ lookup (legal name, status, partners) + lawsuit discovery. Public data, no login
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/monkaS013/brasilapi-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server