comprasal-mcp
This server lets you query El Salvador's public procurement system (COMPRASAL) directly from an AI assistant, providing read-only access to government contract and spending data.
Search awarded procurement processes (
search_procurement): Find public contracts by institution, fiscal year, modality, state, date range, or free-text keyword. Returns supplier name, awarded amount, dates, and process code.Get full process detail (
get_process_detail): Retrieve complete information for a specific procurement process, including publication/award dates, awarded amount, contracting form, follow-up state, and the full stage calendar.Get rich award reports (
get_award_report): Access the most detailed view of an award, including bidder lists, planned vs. certified amounts, budget codes, signature date, and contractual term.Look up a supplier's contract history (
get_supplier_contracts): Find all public contracts won by a specific company across government institutions, useful for building a supplier's public-sector track record (bounded to recent records due to API limitations).Resolve institution names to IDs (
list_institutions): Search for government institutions by partial name to get the numeric ID required for filtering other queries.Browse reference catalogs: List available contracting modalities (
list_modalities), procurement process states (list_states), and fiscal years (list_years) to build precise filters for searches.
All access is read-only, covering public information published under El Salvador's LACAP procurement law.
Click on "Deploy 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., "@comprasal-mcp Show me recent contracts from the Ministry of Health."
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.
COMPRASAL MCP
Query El Salvador's public procurement data straight from your AI assistant.
This is a Model Context Protocol server that wraps the public COMPRASAL API (comprasal.gob.sv) — the country's electronic public-purchasing system — so you can ask Claude (or any MCP client) things like:
"What did the Ministry of Health award in 2025, and for how much?" "Show me the latest public contracts and their suppliers." "Pull the full detail and stage calendar for process 83743."
All data is public information published by the State under the LACAP procurement law. This server is read-only.
What you can ask
Once connected, your assistant gains these tools:
Tool | What it does |
| Search awarded processes by institution, year, modality, or free text. Returns supplier, amount, dates, code. |
| Full detail of one process: amounts, dates, and the complete stage calendar. |
| Richest view: bidders, planned vs certified amounts, budget codes, signature date. |
| A supplier's public-sector track record: contracts won, by company name (bounded recent scan). |
| Resolve an institution name (e.g. "salud") into its id. |
| Catalogs for building precise filters. |
Related MCP server: mcp-colombia-secop
Install
Requires Node.js 18+.
git clone https://github.com/glassbit/comprasal-mcp.git
cd comprasal-mcp
npm install
npm run build
npm testConnect to Cursor
This repo ships a project-level MCP config at .cursor/mcp.json. After npm run build:
Open this folder in Cursor.
Go to Settings → MCP and enable the comprasal server (or restart Cursor).
The assistant can call the COMPRASAL tools in Agent mode.
The config runs node dist/index.js against the live COMPRASAL API (cache off by default). To override globally, add the same block to your user MCP settings.
Connect to Claude Desktop
Add this to your claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"comprasal": {
"command": "node",
"args": ["/absolute/path/to/comprasal-mcp/dist/index.js"]
}
}
}Restart Claude Desktop. You'll see the COMPRASAL tools available. Ask it about El Salvador's public spending.
Local cache (opt-in)
By default every request goes to the live COMPRASAL API — a fresh clone behaves identically for everyone. You may opt in to a local, per-user response cache to speed up repeated queries within a session:
Variable | Default | Description |
|
| Set to |
|
| Cache directory (gitignored, never committed) |
|
| Entry lifetime; expired entries are deleted on read |
The cache is not a shared or committed database — it is created at runtime on your machine only. After TTL expiry, the next request fetches live data again. Disable it anytime with COMPRASAL_CACHE_ENABLED=false.
Tests
npm test # unit + mocked integration only (no network)
npm run test:live # optional smoke test against real COMPRASAL API (~7s)Tests cover client-side filters, Zod argument validation, file cache behaviour, and mocked HTTP flows.
Notes & caveats
The upstream government API only filters reliably by institution. This is the single most important thing to understand about this tool:
id_institucionis the only server-side filter that works. Year, free-text search, and date range are silently ignored by the COMPRASAL backend.This server compensates by filtering client-side (over the real award date
fecha_adjudicacionand text fields), scanning newest-first pages up to a bounded limit.Consequence: deep historical queries are not practical. Asking for "all contracts from supplier X since January 2025" or "institution Y in 2024" can require scanning thousands of records at ~7s/page — so those tools return a bounded recent window and clearly say so in a
coverage/filteringblock. A bounded result is never presented as exhaustive.Backend latency is ~7s per request (this is the government server, not the MCP). Tools make one request per page and cap how many pages they scan, so a call may take 10-50s.
get_supplier_contractscannot filter by supplier upstream, so it scans the most-recent global records and matches locally. Passid_institucionwhen you know it — the scan becomes far faster and deeper.Date filters apply to the award date (
fecha_adjudicacion) in this server, even though the raw upstream API filters on the process start date.get_award_reportuses a different id than the other endpoints (a known upstream quirk). Preferget_process_detailunless you specifically need the bidder/budget breakdown.The dataset holds ~100k+ awarded processes, current through 2026. Each process may appear as several rows (one per lot/supplier).
Tool arguments are validated with Zod before any upstream call; invalid inputs return a clear error without hitting the API.
Why no local database / committed cache?
This server queries the live public API so that anyone who clones it gets identical results with zero setup — no pre-scraped dataset, no shared state in the repo. A committed database would mean either hosting a central server (defeating the "run it yourself" model) or asking every user to scrape COMPRASAL first (hours of work).
An optional, opt-in file cache is available for convenience: it lives in .comprasal-cache/ on your machine only (gitignored), expires after 1 hour, and is off by default. It does not change what a fresh clone returns on first run. A full local-database variant for deep historical analysis remains a possible separate, opt-in project.
Data, source & legality
Data comes from the public COMPRASAL portal (comprasal.gob.sv), accessed through its public, unauthenticated REST API. Public procurement acts are public by law under the LACAP (Ley de Adquisiciones y Contrataciones de la Administración Pública). Public registries are excluded from the scope of El Salvador's Personal Data Protection Law (Decreto 144, 2024, art. 3). This project redistributes already-public information for transparency and research purposes and performs no scraping of authenticated areas.
License
MIT. Not affiliated with or endorsed by the Government of El Salvador.
Available Tools
8 toolsget_award_reportA
Get the richest award report for a process: contract name, contracting form, contractual term, planned vs certified amounts, signature date, budget codes (cifrados presupuestarios), and the list of bidders (oferentes). CAVEAT: this endpoint's id is NOT the proceso_compra.id used elsewhere; it lives in a different id space. Obtain the correct id from a process detail payload. If you pass the wrong id you will get a different contract. When unsure, prefer get_process_detail.
Inputs: id (required).
get_process_detailA
Get full detail of one procurement process by its proceso_compra id: code, internal code, publication/award dates, awarded amount, contracting form, follow-up state, and the full stage calendar (reception of offers, evaluation, etc.). The id comes from the 'proceso_compra.id' field of a search_procurement result.
Inputs: id_proceso_compra (required).
get_supplier_contractsA
Find the public contracts won by a specific SUPPLIER (company), by name, across institutions. Useful to build a supplier's public-sector track record ('what has company X been awarded?'). CRITICAL LIMITATION: the upstream government API cannot filter by supplier, and only sorts newest-first, so this performs a BOUNDED scan of the most-recent records — it does NOT return a supplier's full multi-year history. The response includes a 'coverage' block stating exactly what was scanned and warning when the result is bounded. Always relay that limitation to the user; never present a bounded scan as exhaustive. If you know which institution to look within, pass id_institucion to make the scan far faster and deeper. Each page is ~7s; raising max_pages increases coverage but also wait time.
Inputs: supplier (required), anio, max_pages, id_institucion.
list_institutionsA
List/search government institutions registered in COMPRASAL, to resolve a name into the numeric id_institucion used by search_procurement. Pass 'search' with a partial name (e.g. 'salud', 'hacienda').
Inputs: page, search, per_page.
list_modalitiesA
List contracting modalities (formas de contratación: Licitación competitiva, Libre Gestión, Contratación Directa, Comparación de precios, etc.) with their ids, to use as id_modalidad filters.
Inputs: no named parameters.
list_statesA
List procurement process states with their ids, to use as id_estado filters.
Inputs: no named parameters.
list_yearsA
List the fiscal years (ejercicios) available in COMPRASAL.
Inputs: no named parameters.
search_procurementA
Search awarded public procurement processes from El Salvador's COMPRASAL system. Returns matched awards, each with institution, supplier, awarded amount, dates, and process code. Use list_institutions first to turn an institution name into id_institucion. HOW FILTERING WORKS: the upstream government API only filters server-side by id_institucion. Year, free-text and date-range are applied CLIENT-SIDE by this server over the award date (fecha_adjudicacion) and text fields, by scanning newest-first pages. Because of that, prefer always passing id_institucion to keep the scan focused. The response includes a 'filtering' block: if window_fully_covered is false, increase 'page' to keep scanning older records. fecha_inicio/fecha_fin here DO filter on the actual award date. Each upstream record may represent one lot/supplier line of a larger process. One call scans a bounded number of pages (~7s each upstream), so it may take 10-40s.
Inputs: anio, page, search, per_page, +6 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Most tools have distinct purposes, but get_award_report and get_process_detail could be confused since both provide process details. The caveat about different IDs and the distinct focus (richest award vs full detail) help clarify, but there is potential for misselection.
All tool names follow a consistent snake_case verb_noun pattern (get_, list_, search_), making the set predictable for an agent.
8 tools is well-scoped for a procurement data retrieval system, covering search, detail views, supplier lookup, and listing of reference entities without unnecessary bloat.
The tool set covers the main read operations (search, detail, supplier contracts, reference lists). A minor gap is the lack of a straightforward 'list all processes' tool, but search can be used broadly. Overall, the surface is adequate for the domain.
Maintenance
Related MCP Connectors
MCP access to the U.S. federal procurement graph: contracts, opportunities, entities, and more.
Ecuador Government Procurement MCP — SERCOP / Compras Públicas (keyless).
Query Brazil's public procurement portal (PNCP): tenders, contracts and price records.
Chile Government Procurement MCP — Mercado Público / ChileCompra (keyless-ish).
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables access to Chile's government procurement data (Mercado Público / ChileCompra) via MCP, allowing AI agents to query public procurement information.65 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to query Colombian government procurement data via MCP tools or natural language questions.54 npmMIT
- FlicenseNot gradedqualityBmaintenanceEnables AI assistants to query and analyze Costa Rica's public procurement (SICOP) data, including supplier profiles, market trends, product price histories, and bid comparisons, through a suite of MCP tools.-
- FlicenseCqualityBmaintenanceEnables read-only access to official Brazilian government procurement data from Compras.gov.br and the PNCP, covering all cataloged public GET endpoints through MCP tools.1751-