Skip to main content
Glama
mauricio-cantu

brasil-api-mcp-server

BrasilAPI MCP Server

Query 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.

Check the complete and official documentation from BrasilAPI here.

Tools

This server provides tools to query every endpoint available from BrasilAPI. Under the hood, it uses this JS client to communicate with the API: https://github.com/WillianAgostini/brasilapi-js

Check the Tools page in Smithery to inspect and test each one of them.

Related MCP server: mcp-brasilapi

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. We recommend using the MCP Inspector, which is available as a package script:

npm run inspector

To generate an updated build and inspect:

npm run build-and-inspect

The Inspector will provide a URL to access debugging tools in your browser.

Integration with AI applications

Running through Smithery

Run the server automatically via Smithery:

npx -y @smithery/cli install @mauricio-cantu/brasil-api-mcp-server

Usage with Claude

npx -y @smithery/cli@latest install @mauricio-cantu/brasil-api-mcp-server --client claude

Cursor and other integrations

Check the Server page in Smithery to get other integration options such as Cursor and more.

Running the server with a local copy

After you've downloaded this project, you can run the server using node:

node /absolute/path/to/brasil-api-mcp-server/build/index.js

At the root of the project there's also a Dockerfile to build and run the image if you'd like.

Server's capabilities inspection

You can inspect this MCP server's capabilities using Smithery:

npx -y @smithery/cli@latest inspect @mauricio-cantu/brasil-api-mcp-server

This will show you all available tools, their parameters, and how to use them.

Project structure

src/
  ├── apiClient/   # BrasilAPI client
  ├── tools/       # Tools implementations
  ├── types/       # Interfaces and types
  ├── utils/       # Utility functions
  └── index.ts     # MCP main file (server setup and tools listing)

Available Tools

6 tools
get_all_banksB

Get information of all banks from Brazil.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states it 'gets information' but doesn't specify whether this is a read-only operation, requires authentication, has rate limits, or what the return format looks like. For a tool with zero annotation coverage, this leaves significant behavioral gaps unaddressed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It's appropriately sized for a simple tool with no parameters and is front-loaded with the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete for proper tool usage. It doesn't explain what information is returned (e.g., bank names, codes, addresses), the format of the response, or any behavioral constraints. For a tool with no structured metadata, the description should provide more context about the operation and results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't mention parameters, which is correct for this schema. A baseline of 4 is applied since the description doesn't need to compensate for any parameter gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('information of all banks from Brazil'), making the purpose immediately understandable. It distinguishes from siblings like 'get_bank_by_code' by specifying 'all banks' rather than individual lookup. However, it doesn't specify what type of information is retrieved, keeping it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_bank_by_code' for specific bank lookups or other sibling tools for different data types. It lacks any context about prerequisites, timing, or exclusions, leaving the agent to infer usage based on tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_bank_by_codeB

Get information from a specific bank given its code. The code from each bank is returned by get_all_banks tool.

ParametersJSON Schema
NameRequiredDescriptionDefault
codeYes

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it 'Get[s] information' but doesn't clarify what type of information is returned, whether it's a read-only operation, if there are rate limits, authentication needs, or error conditions. This leaves significant gaps for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded: the first sentence clearly states the tool's purpose, and the second sentence adds useful context about the parameter source. There is no wasted text, making it efficient and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (a lookup tool with no annotations, 1 parameter, 0% schema coverage, and no output schema), the description is incomplete. It doesn't explain what information is returned, potential errors, or behavioral traits, leaving the agent with insufficient context to use the tool effectively beyond basic parameter guidance.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate. It adds meaning by explaining that the 'code' parameter corresponds to a bank code obtained from 'get_all_banks', which clarifies the parameter's purpose beyond the schema's type definition. However, it doesn't provide details like format, valid ranges, or examples, so it only partially compensates for the low coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get information from a specific bank given its code.' It specifies the verb ('Get'), resource ('bank'), and key constraint ('given its code'). However, it doesn't explicitly differentiate from sibling tools like 'get_all_banks' beyond mentioning that tool as a source for codes, so it falls short of a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by referencing 'get_all_banks' as the source for bank codes, suggesting this tool should be used when you have a specific bank code from that sibling. However, it doesn't provide explicit guidance on when to use this versus alternatives (e.g., other bank-related tools if they existed) or any exclusions, so it's only implied rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_cnpjC

Get information about a company given a CNPJ.

ParametersJSON Schema
NameRequiredDescriptionDefault
CNPJYesThe CNPJ to query

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves information but does not describe traits like whether it's read-only, requires authentication, has rate limits, returns structured data, or handles errors. For a lookup tool with no annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to understand at a glance. Every part of the sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a lookup operation), lack of annotations, and no output schema, the description is incomplete. It does not explain what information is returned, potential error cases, or behavioral aspects like performance or data freshness. For a tool with no structured metadata, more detail is needed to be fully helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds minimal meaning beyond the input schema, which has 100% coverage and clearly documents the single parameter 'CNPJ' as 'The CNPJ to query.' The description implies the parameter is required but does not provide additional context like format examples or validation rules. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get information about a company given a CNPJ.' It specifies the verb ('Get'), resource ('information about a company'), and required input ('CNPJ'). However, it does not distinguish this tool from its siblings (e.g., get_isbn, get_postal_code_v1/v2) beyond the input type, which are similar lookup tools for different identifiers.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, exclusions, or comparisons to sibling tools like get_all_banks or get_bank_by_code, which might be relevant in a business context. Usage is implied by the description but not explicitly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_isbnB

Get information about a book given an ISBN.

ParametersJSON Schema
NameRequiredDescriptionDefault
ISBNYesThe book's ISBN to query

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the basic function without details on permissions, rate limits, error handling, or what 'information' includes (e.g., title, author, availability). This leaves significant gaps for an AI agent to understand the tool's behavior beyond the simple query.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It is front-loaded and appropriately sized for a simple tool, making it easy for an AI agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter, no annotations, no output schema), the description is minimally adequate. It covers the basic purpose but lacks details on output format, error cases, or usage context. Without an output schema, the description should ideally hint at what 'information' is returned, but it doesn't, leaving room for improvement.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, with the single parameter 'ISBN' documented as 'The book's ISBN to query.' The description adds no additional meaning beyond this, such as format examples or validation rules. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get information about a book given an ISBN.' It specifies the verb ('Get information'), resource ('book'), and input ('ISBN'), making the function unambiguous. However, it doesn't differentiate from sibling tools, which are unrelated to books (e.g., get_cnpj, get_postal_code_v1), so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any prerequisites, limitations, or scenarios where other tools might be more appropriate. For example, it doesn't clarify if this is for ISBN-10 or ISBN-13, or if there are other book-related tools available.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_postal_code_v1C

Get a location data given a CEP (postal code).

ParametersJSON Schema
NameRequiredDescriptionDefault
cepYesThe CEP to query

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves location data but lacks details on error handling, rate limits, authentication needs, or response format. For a read operation with no structured safety hints, this leaves significant gaps in understanding how the tool behaves beyond its basic function.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: 'Get a location data given a CEP (postal code).' It's front-loaded with the core purpose and avoids unnecessary words. However, the phrasing 'a location data' is slightly awkward grammatically, which detracts from perfect clarity, but it remains concise and to the point.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, no output schema, no annotations), the description is incomplete. It doesn't explain what 'location data' includes, potential errors, or how it differs from 'get_postal_code_v2'. For a tool with no annotations or output schema, more context is needed to fully understand its operation and limitations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'cep' parameter documented as 'The CEP to query.' The description adds minimal value beyond this, only implying that CEP is a postal code. Since the schema already covers the parameter well, the baseline score of 3 is appropriate, as the description doesn't provide additional syntax or format details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get a location data given a CEP (postal code).' It specifies the verb ('Get'), resource ('location data'), and input ('CEP'), making it easy to understand what the tool does. However, it doesn't differentiate from its sibling 'get_postal_code_v2', which slightly reduces clarity about when to use this version versus the other.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention the sibling 'get_postal_code_v2' or explain any differences, such as version-specific features or deprecation status. There's no context about prerequisites, limitations, or when not to use it, leaving the agent without usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_postal_code_v2C

Version 2 of get a location data given a CEP (postal code).

ParametersJSON Schema
NameRequiredDescriptionDefault
cepYesThe CEP to query

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral context. It doesn't disclose whether this is a read-only operation, what authentication might be needed, rate limits, error conditions, or what format the location data returns. 'Version 2' implies some improvement but doesn't specify what behavioral changes exist from v1.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise - a single sentence that communicates the core purpose. However, it's arguably too concise given it's a v2 tool that should explain improvements over v1. Every word earns its place, but more context would be helpful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what 'location data' includes, how results differ from v1, error handling, or any behavioral characteristics. The agent has minimal guidance beyond the basic purpose.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with the single 'cep' parameter well-documented in the schema. The description adds no additional parameter semantics beyond what the schema already provides - it doesn't clarify CEP format requirements, validation rules, or examples. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool retrieves 'location data given a CEP (postal code)', which clarifies the verb (get) and resource (location data). However, it doesn't distinguish this from its sibling 'get_postal_code_v1' - it only mentions it's 'Version 2' without explaining what differentiates it from the previous version.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to use v2 over v1, what specific improvements v2 offers, or any prerequisites for usage. The agent must infer usage from the name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

B3.2/5.0
Disambiguation4/5

Most tools have distinct purposes targeting different Brazilian data types (banks, CNPJ, ISBN, postal code), but get_postal_code_v1 and get_postal_code_v2 create ambiguity as they appear to serve the same function with only version differences. The descriptions clarify they both get location data from CEP, which could cause confusion about which to use.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern with 'get_' prefix and descriptive suffixes (e.g., get_all_banks, get_bank_by_code, get_cnpj). The naming is perfectly uniform across all six tools, making them predictable and easy to understand.

Tool Count4/5

Six tools is a reasonable count for a Brazilian API server covering multiple data domains. However, having two postal code tools for essentially the same function feels slightly redundant, making the set a bit over-scoped for its apparent purpose of providing Brazilian data lookups.

Completeness3/5

The server covers several distinct Brazilian data types (banks, CNPJ, ISBN, postal code), but there are notable gaps. For example, it lacks tools for other common Brazilian identifiers like CPF or tools for related operations like searching or filtering within these domains. The coverage feels patchy rather than comprehensive for a Brazilian data API.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables LLMs to query Brazilian public data such as CEP, CNPJ, DDD, exchange rates, banks, and holidays via the Model Context Protocol.
    12
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Exposes 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.
    41
    Apache 2.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    Validates LatAm banking and tax IDs (Mexican CLABE, Brazilian CNPJ/CPF checksums) and performs BrasilAPI company, CEP, and bank lookups, enabling AI agents to verify financial and tax information in Latin America.
    17
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables lookup of Brazilian public data including companies (CNPJ), postal codes (CEP), banking, economy, geography, and more through 15 tools and 2 guided prompts, powered by BrasilAPI with no API key required.
    15
    MIT

Appeared in Searches

Latest Blog Posts

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/mauricio-cantu/brasil-api-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server