secop-mcp
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., "@secop-mcp Which entities in Tolima bought software in the last 90 days?"
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.
secop-mcp
An MCP server that lets an AI assistant answer questions about Colombian public procurement — 9 million processes published on SECOP II — in plain language.
You: Which entities in Tolima bought software in the last 90 days, and who wins those contracts?
Assistant (via secop-mcp):
Top 3 by entity — department=Tolima, last_days=90:
1. GOBIERNO DEPARTAMENTAL — 2,448 processes · $176,998,874,872 COP
2. ALCALDIA MUNICIPIO DE IBAGUE — 1,426 processes · $73,548,019,088 COP
3. HOSPITAL REGIONAL ALFONSO JARAMILLO SALAZAR E.S.E. — 624 processes · $14,928,322,759 COP
Most awarded suppliers in category V1.80111600:
1. UNION TEMPORAL HUELLAS CHAPARRAL (NIT 902031694) — 1 award · $33,712,486,021 COP
2. LEON GRAFICAS S.A.S (NIT 809012539) — 10 awards · $11,998,277,451 COPThat output is real: it comes from npm run smoke, which runs this server against the live API.
Data source: SECOP II — Procesos de Contratación, the official open dataset published by Colombia Compra Eficiente on datos.gov.co (Socrata). Public, no API key required.
Why this exists
This repository is a reference implementation of a read-only MCP server over a public REST API. It is small enough to read in one sitting and complete enough to copy: tools, a resource, a prompt, structured output, input validation, retries, error handling, unit tests at the protocol level, and an end-to-end smoke test.
If you need the same thing over your API — internal ERP, CRM, warehouse, SaaS backend — the shape of the solution is in src/.
Related MCP server: mcp-ecuador-procurement
Install
npm install
npm test # builds and runs 33 tests, no network needed
npm run smoke # end-to-end against the live API (needs network)Requires Node.js 20 or newer.
Use it from a client
Any MCP client works. Point it at the built entry point:
{
"mcpServers": {
"secop": {
"command": "node",
"args": ["/absolute/path/to/secop-mcp/dist/index.js"],
"env": { "SECOP_APP_TOKEN": "optional-socrata-token" }
}
}
}Claude Desktop →
claude_desktop_config.json(seeexamples/)Claude Code →
claude mcp add secop -- node /absolute/path/to/secop-mcp/dist/index.jsOpenClaw / Cursor / Zed → same command, same arguments
Variable | Default | Purpose |
| (none) | Socrata app token. Anonymous requests share a small rate-limit pool and start returning HTTP 429 under load. Free to create. |
|
| Per-request timeout. |
|
| Retries after the first failure, for 429 and 5xx only. |
Tools
All tools are read-only and share one filter vocabulary, so the model learns it once: keyword, department, city, entity, entity_nit, unspsc, modality, contract_type, state, awarded, open_only, min_value_cop, max_value_cop, published_since, published_until, last_days, include_drafts.
Tool | What it answers |
| "What has been published in my department, in my category, in the last 30 days?" Returns newest first, plus the total number of matches, not just the page. |
| "Show me process CO1.REQ.11384484." |
| "How big is this market?" Groups by entity, department, modality, category or supplier and sums the budget. |
| "I sell software — which category codes should I be watching?" Ranks real UNSPSC codes by process count. |
| "Is this market open or captured?" Ranks suppliers by awarded value. |
Also exposed: the resource secop://dataset/schema (field dictionary) and the prompt qualify_opportunity (a checklist the model should follow before telling a small supplier to bid).
Design decisions worth stealing
Writing an MCP server over an open-data API is 20% protocol and 80% knowing which answers are useless. The decisions below are the difference between a demo and something a supplier would actually run.
Drafts are excluded by default. estado_del_procedimiento = 'Borrador' is a large slice of the dataset, and those processes were never offered to the market. Including them makes a result list technically accurate and practically worthless. include_drafts: true brings them back.
UNSPSC codes are prefix matches. The dataset stores V1.82141500. People type 82141500, V1.82141500, 8214-1500, or the 4-digit family 8214. All four work, and a family code matches every code inside it — which is how a supplier actually thinks about its own catalogue.
Totals come from a separate count(*) query. Socrata caps page size. "17 processes match, here are 3" is a useful answer; "here are 3" is not.
Placeholder text becomes null. The feed writes No Definido, No Adjudicado, No Aplica in empty fields, and urlproceso often points at the portal's login page instead of the process. Passing those through as data is how an assistant ends up confidently reporting a supplier named "No Definido" and a budget of zero pesos. Missing budgets are labelled sin valor publicado, never $0.
Money stays in COP, formatted es-CO. A model that sees 48000000 will eventually call it dollars.
Retries only where retrying helps. 429 and 5xx are retried with exponential backoff, honouring Retry-After. A 400 — which on Socrata means the SoQL is wrong — fails immediately: retrying a malformed query just hammers a public endpoint.
Every tool returns both text and structuredContent. The text is what the model reads out; the structured payload is what it quotes numbers from, including the exact SoQL predicate that was executed, so any answer can be audited.
Failures come back as tool errors, not exceptions. An upstream 503 returns isError with a readable message, which the model can relay or retry. A crashed server just looks broken.
Project layout
src/socrata.ts Dependency-free SODA 2.1 client: SoQL params, timeout, retries, Retry-After
src/secop.ts Domain layer: field dictionary, UNSPSC parsing, filter → SoQL, row → summary
src/server.ts MCP server: tools, resource, prompt, structured output
src/index.ts stdio entry point
test/ 33 tests: unit + protocol-level (real client, real server, stubbed HTTP)
scripts/smoke.mjs End-to-end run against the live APIThe test suite needs no network: src/socrata.ts takes an injectable fetch and sleep, and test/server.test.js drives a real MCP client over an in-memory transport with the HTTP layer stubbed. That is what catches an unregistered tool or structured output that does not match its own schema.
Limitations
The open dataset carries metadata, not tender documents. Eligibility requirements, addenda and deadlines must be read on the SECOP II portal. The
qualify_opportunityprompt makes the model say so.Values are self-reported by each entity. Blank and placeholder values are common, and
nombre_del_procedimientosometimes contains a person's name because the entity misused the column.The dataset covers SECOP II. Processes published only on SECOP I or on TVEC are not here.
Publication timestamps are floating (no timezone). Treat them as Bogotá local time.
License
MIT — see LICENSE.
Not affiliated with Colombia Compra Eficiente or datos.gov.co.
Available Tools
5 toolsdiscover_unspsc_codesDiscover UNSPSC codes from a keywordARead-only
Find which UNSPSC category codes actually carry the work a supplier describes in plain words ("software", "transporte escolar", "obra civil"), ranked by number of processes. Run this before searching by category.
Inputs: keyword (required), limit, last_days, department. Returns: codes, keyword
get_processGet one processARead-only
Fetch a single procurement process by its SECOP II process id (e.g. CO1.REQ.6690779).
Inputs: process_id (required). Returns: found, process
search_processesSearch procurement processesARead-only
Search SECOP II processes by place, category, entity, budget, state and date. Returns the newest matches first plus the total number of matching processes.
Inputs: city, limit, state, entity, +15 more. Returns: where, returned, processes, total_matching
summarize_procurementSummarize procurement by a fieldARead-only
Group matching processes by a field (entity, department, modality, category, supplier...) and return how many processes and how much budget each group holds. Use it to size a market before bidding.
Inputs: group_by (required), city, limit, state, +15 more. Returns: groups, group_by
top_awarded_suppliersTop awarded suppliersARead-only
Who actually wins this kind of contract: ranks suppliers by awarded amount for the given filters. Use it to check whether a market is open or captured before spending days on a bid.
Inputs: city, limit, state, entity, +14 more. Returns: suppliers
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly stated purpose: listing (search_processes), single fetch (get_process), aggregation (summarize_procurement), code discovery (discover_unspsc_codes), and supplier ranking (top_awarded_suppliers). The main risk is confusion between search_processes, summarize_procurement, and top_awarded_suppliers, which all take similar filters but return different shapes; the descriptions mostly disambiguate this, though an agent could still pick the wrong one when it wants both a list and a summary.
All names use snake_case, and four of five follow a verb_noun pattern (search_processes, get_process, summarize_procurement, discover_unspsc_codes). top_awarded_suppliers breaks the pattern as a bare noun phrase with an embedded adjective, a minor deviation that is still readable.
Five tools is well within the healthy range and each maps to a distinct stage of the procurement workflow (discover codes, search, fetch details, size the market, check competition). Nothing feels redundant or missing at the count level.
The surface covers discovery, search, detail, aggregation, and supplier ranking, but has notable gaps: there is no way to retrieve individual award/contract records or supplier profiles, and search_processes exposes no pagination or offset control despite returning large result sets. These omissions can become dead ends for deeper due-diligence workflows.
Maintenance
Related MCP Connectors
Query Brazil's public procurement portal (PNCP): tenders, contracts and price records.
Colombian company and public-procurement data by NIT: RUES commercial registry, SECOP contracts, Supersociedades financials, sanctions and OFAC/UN lists, each field with its official source URL and capture date. No key needed to connect or for radicadouno_comprobar (free, 10/day). Buy a signed report per company (89,900 COP) or a Business key from within the server: no human in the loop. Companies only: no natural persons (Law 1581/2012). Not a credit score.
Colombian law, tax, company, history and open-data agents, paid per call with x402 USDC.
Korean company facts in English for AI agents: ~830 KOSPI-listed companies (DART profiles, KRW financials, recent filings) and ~110,000 corporate public procurement suppliers (12-month KONEPS contract awards), plus live National Tax Service business status checks. 4 tools, keyless, read-only.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to query Colombian government procurement data via MCP tools or natural language questions.54 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to query Ecuador government procurement (SERCOP/Compras Públicas) data without API keys, via natural language or direct tools.55 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.-
- AlicenseAqualityCmaintenanceEnables an LLM to answer questions about Colombian public procurement from the SECOP II electronic contracts open dataset on datos.gov.co, with typed queries that are built into SoQL by the server. A column allowlist and local entity directory keep personal-data fields unreachable and resolve institution names to NITs, so users get aggregate contract figures without writing queries themselves.3MIT