MCP Compras.gov.br
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Compras.gov.brcheck sanctions for CNPJ 12.345.678/0001-99"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Compras.gov.br
MCP server that brings together in a single package the public APIs of the Compras.gov.br ecosystem, aimed at analysts and technicians in the areas of procurement planning and contract execution.
Supports the preparation of:
Preliminary Technical Studies (ETP)
Terms of Reference (TR)
Price research in the IN SEGES/ME 65/2021 standard
Checking supplier sanctions (CEIS, CNEP, CEAF)
Analysis of price registration minutes (ARP) for adherence (piggybacking)
Inter-agency benchmarking via the National Public Procurement Portal (PNCP)
Covered APIs (v1)
API | Base URL | Authentication |
Dados Abertos Compras |
| public |
PNCP — National Portal |
| public |
Transparency Portal (CGU) |
| free key |
Comprasnet Contracts |
| public (routes |
⚠️ Operational notice
Family
/modulo-uasg/*dead on Dados Abertos upstream: confirmed via direct probe in 2026-05 —1_consultarUasg,2_consultarOrgaoand CSV variants return HTTP 404 ("Resource not found") despite being listed in the official swagger. SEGES server bug with no possible fix via MCP. The 5 affected tools (compras_uasg_listar/_consultar/_buscar+compras_orgao_listar/_consultar) detect the 404 and return an educational payload with alternatives:compras_pncp_orgao_unidades(cnpj)to resolve units by CNPJ (stable, may take 10-30s), orcompras_contrato_comprasnet_por_uasg(uasg)to list UGs with active contracts.UASG filter in
/modulo-legado/*: auctions and bids have a confirmed Hibernate bug upstream — the swagger documentsco_uasg/uasgbut the attribute does not exist in the view model. The parameters were removed from the toolscompras_legado_pregoes_listarandcompras_legado_licitacoes_listar; to filter by UASG, do it client-side on the return.Transparency Portal (CGU): the CGU server is protected by AWS WAF "Human Verification" that can block API calls even with a valid key (HTTP 405 + HTML page). When this occurs, all tools
compras_sancao_*+ the compositecompras_checar_sancoes_fornecedor* the sanction branches incompras_perfil_fornecedor_completowill return an error. It is an upstream problem — there is no fix on the MCP side.Comprasnet
/api/contrato/ug/{uasg}: the endpoint does not support pagination and returns the complete list in a single response (may exceed 1 MB). The toolcompras_contrato_comprasnet_por_uasgapplies client-side slicing with full payload cache to avoid flooding the LLM.CATMAT broken textual search: the
descricaofilter (and variantsnome,termo,q) of/modulo-material/4_consultarItemMaterialreturns the entire CATMAT universe (~340k items). Use structural filters viacompras_catmat_listar_grupos→_listar_classes→_buscarwithcodigo_grupo/codigo_classe. The tool emits_aviso_filtrowhen it detects the entire universe.
Related MCP server: narajangteo-pro
Installation
Desktop Extension (.mcpb) — recommended for Claude Desktop
python build_mcpb.py # gera dist/compras.mcpb
open dist/compras.mcpb # Claude Desktop instalaLocal (development)
uv sync
uv run compras-mcpRemote (Railway via Docker)
railway login && railway link
railway add redis # cache compartilhado
railway variables --set "TRANSPARENCIA_API_KEY=..."
railway up
railway domain # https://mcp-compras.up.railway.app/mcpConfiguration
Free registration of the Transparency key: https://api.portaldatransparencia.gov.br/api-de-dados/cadastrar-email
See .env.example for all configurable variables (timeouts, cache TTLs, base URLs).
Tools (85 total)
Grouped by functional domain:
Domain | Tools | Coverage |
Composite (agent) | 5 |
|
Catalog (CATMAT/CATSER) | 7 | Groups/classes/items, textual search |
Price research | 4 | Material/service, detail by purchase |
Planning (PGC + PCA) | 8 | PGC SISG, PCA PNCP (federal + states + municipalities) |
Price Registration Minutes | 8 | List, balance, adherences, participating units, PNCP |
Procurements (14.133 + legacy) | 12 | Law 14.133, Law 8.666, RDC, waivers |
Contracts | 12 | Open Data + Comprasnet (guarantees, invoices, occurrences, tax auditors, commitments, schedule) |
Suppliers | 4 | Registration, impediments, contracts by item |
Sanctions (Transparency/CGU) | 5 | CEIS, CNEP, CEAF, CEPIM, leniency agreements |
PNCP | 9 | Procurements (publication, proposal, update), contracts, modalities |
Organizations | 6 | UASG (list/consult/search), agencies, PNCP units |
Indicators | 2 | Consolidated, by period |
Diagnostics | 1 |
|
The complete list is in manifest.json or via tools/list in the MCP Inspector.
Typical flows
ETP for acquiring ergonomic chairs:
compras_catmat_buscarwithtermo="cadeira ergonomica"→ getcodigo_item_catalogocompras_pesquisar_precos_para_etp(composite) withtipo="material"→ median/mean/stddev + IQR discardcompras_pgc_por_catalogoto see what other agencies planned to buycompras_arp_listarwithapenas_vigentes=True→ active minutes for possible adherence
Supplier analysis before homologation:
compras_perfil_fornecedor_completo(composite) with the CNPJ — one call returns registration + sanctions + active contracts
Inventory of contracts to renew:
compras_contratos_listar_por_fim_vigenciawithdata_fim_vigencianearFor each relevant contract:
compras_contrato_historico_aditivos,compras_contrato_ocorrencias
Internal patterns
Standard envelope of the
listar_*tools:{resultado, _pagina_atual, _total_paginas, _total_registros, _proxima_pagina, _cache_hit, _latency_ms}.SSoT of descriptions: parameter descriptions live in
src/compras_mcp/schemas.py; tools read via_helpers.desc(Model, "campo"). Test intests/test_server.pydetects drift.LGPD: CPFs masked as
123.***.***-45; adjust withINCLUIR_CPF_COMPLETO=true. Affected tools include_aviso_lgpdin the payload.Cache: TTL+LRU in memory (default) or Redis when
REDIS_URLis set. Each domain has its prefix (CATALOGO, PRECOS, ATAS, etc.) — adjustable viaCACHE_<PREFIX>_TTLandCACHE_<PREFIX>_MAX_SIZE.Dates: 3 formats per API (
YYYY-MM-DD,yyyyMMdd,YYYY-MM-DD HH:mm:ss) transparently converted byformat_date(value, flavor).Framework: FastMCP 2.x. Transport detected by
PORT— present → HTTP on0.0.0.0:$PORT, absent → stdio.
Status
v0.2.0 — 85 tools registered and ready for end-to-end testing with Claude Desktop and Railway.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-quality-maintenanceConnects AI agents to 28 Brazilian public APIs, providing over 200 tools to access data on economy, legislation, transparency, and the judiciary. It enables complex queries and cross-referencing of government datasets like IBGE, the Central Bank, and the National Congress through natural language.
- AlicenseAqualityDmaintenanceIntegrates 6 Korean public procurement APIs to search, analyze, and manage procurement data using natural language.83MIT

licinexus-mcpofficial
AlicenseAqualityAmaintenancerazilian public procurement (PNCP) and Federal Revenue CNPJ data for any MCP client. 18 tools covering bids, contracts, atas de registro de preço, annual procurement plans, CNPJ enrichment, plus temporal aggregation and period comparison. MIT licensed, maintained by Licinexus under Law 14.133/2021.189475MIT- AlicenseAqualityDmaintenanceAllows AI assistants to query public procurement opportunities, purchase orders, and government entities from Chile's Mercado Público (ChileCompra) API in real time.12181MIT
Related MCP Connectors
Consolidated lookup of a company at the Federal Audit Court (TCU) from the CNPJ, gathering sanctions
Looks up records of a person or company at the Federal Comptroller General (CGU) from the CPF or CNP
Chile Government Procurement MCP — Mercado Público / ChileCompra (keyless-ish).
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/opedrosoares/MCP_Compras'
If you have feedback or need assistance with the MCP directory API, please join our Discord server