Skip to main content
Glama

MCP SECOP II Colombia

Servidor MCP (Model Context Protocol) e Inspector Web Suizo de Tonalidades Claras para SECOP II y Colombia Compra Eficiente, conectado en puente bidireccional con el proyecto SCRAPPING y generador de pipelines RAG.

License: MIT Python 3.12+ MCP SDK 2.x Managed with uv Ruff Archify Showcase


📖 Descripción general

MCP SECOP II Colombia (mcp-secop) es un servidor Model Context Protocol (MCP) de grado de producción que expone las capas técnicas del Sistema Electrónico para la Contratación Pública (SECOP II) y Colombia Compra Eficiente a cualquier agente LLM (Claude Desktop, Cursor, Google Antigravity, OpenCode), operando además en puente bidireccional en vivo con el proyecto SCRAPPING (http://127.0.0.1:8010 y workspace local ../SCRAPPING).

Incluye un Centro de Control Web en Minimalismo Suizo Institucional de tonalidades claras (http://127.0.0.1:8020) para invocar las 8 herramientas MCP desde el navegador, inspeccionar la taxonomía oficial de 6 dominios de SECOP II, lanzar el motor Spider sobre portales ASP.NET Vortal y exportar fragmentos vectoriales (.jsonl y Markdown contextual) listos para Qdrant, Chroma, pgvector, LangChain y LlamaIndex.

📘 La verdad técnica central —stack, decisiones, convenciones y flujo— vive en CONSTITUTION.md.

Related MCP server: mcp-colombia-secop

📑 Tabla de contenidos

⚡ Capacidades MCP (8 Tools, 4 Resources, 2 Prompts)

Código

Herramienta MCP (Tool)

Función Principal

TOOL-01

secop_search_processes

Búsqueda multidimensional SODA SoQL en p6dx-8zbt (Procesos) y jbjy-vk9h (Contratos) por palabra clave, entidad, NIT, departamento, modalidad, cuantía COP y código UNSPSC.

TOOL-02

secop_spider_crawl

Motor Spider asíncrono sobre colombiacompra.gov.co y community.secop.gov.co con detección de sesiones ASP.NET __VIEWSTATE y clasificación documental RAG.

TOOL-03

secop_inspect_opportunity

Inspector DOM profundo de expedientes OpportunityDetail (noticeUID=CO1.NTC.*), tablas contractuales y pliegos anexos.

TOOL-04

secop_generate_rag_chunks

Sintetizador de chunks Markdown con cabecera contextual institucional inyectada, hash SHA-256 y metadatos filtrables para bases vectoriales.

TOOL-05

secop_get_taxonomy_map

Catálogo estructurado de los 6 dominios y 11 enlaces principales del ecosistema SECOP II.

TOOL-06

secop_manage_rag_feeds

Listado y creación de feeds dinámicos (/api/v1/feeds/{slug}/rag y .jsonl) sincronizados con SCRAPPING.

TOOL-07

secop_bridge_status

Diagnóstico en tiempo real del puente HTTP (:8010) y detección de módulos en el workspace ../SCRAPPING.

TOOL-08

secop_analyze_procurement_budget

Analítica financiera en pesos colombianos (COP), distribución por modalidad/departamento y Top 5 de procesos de mayor cuantía.

Recursos MCP (Resources):

  • secop://taxonomy/catalog — Mapa completo de los 6 dominios de SECOP II.

  • secop://bridge/scrapping-status — Estado en vivo del puente con SCRAPPING.

  • secop://rag/default-feeds — Feeds RAG preconfigurados y snippets para LangChain/LlamaIndex.

  • secop://schemas/soql-dictionary — Diccionario técnico SoQL para Datos Abiertos Colombia.

Prompts MCP (Prompts):

  • auditoria_licitacion_secop2 — Auditoría integral legal, técnica y presupuestal de pliegos.

  • ingesta_rag_contratacion — Orquestación de ingesta vectorial hacia Qdrant/Chroma.

🔗 Puente Bidireccional con el proyecto SCRAPPING

El módulo scrapping_bridge.py conecta automáticamente este servidor MCP con el proyecto hermano SCRAPPING:

  1. Delegación HTTP en Vivo (ONLINE_HTTP_BRIDGE): Si el backend de SCRAPPING está activo en http://127.0.0.1:8010, las herramientas MCP delegan y sincronizan feeds directamente con él.

  2. Motor Híbrido Autónomo (LOCAL_WORKSPACE_HYBRID): Si SCRAPPING no está en ejecución por red, mcp-secop detecta el workspace local ../SCRAPPING y ejecuta de forma autónoma las consultas Socrata SODA SoQL, el Spider ASP.NET y el chunker RAG sin interrupción.

🛠️ Stack tecnológico

Categoría

Tecnología

Lenguaje

Python 3.12+

Gestor de paquetes

uv (uv_build src-layout)

Servidor MCP

mcp (MCPServer 2.x)

Pasarela Web & UI

FastAPI + Uvicorn + Minimalismo Suizo Institucional Claro (#F6F6F3 / #FFFFFF / #0D0E11 / #D9381E)

Scraping & SODA

httpx asíncrono + BeautifulSoup4 + Socrata SoQL

Calidad

Ruff (lint + format) · ty (typecheck) · pytest (7/7 pruebas AAA) · pre-commit

Arquitectura Viva

Archify (docs/arquitectura.html)

🚀 Primeros pasos y ejecución

git clone https://github.com/LUISBENJUMEARIVERA/MCP-SECOP.git
cd MCP-SECOP

# 1. Sincronizar entorno determinista con uv
uv sync

# 2. Verificar el puente con el proyecto SCRAPPING
uv run mcp-secop --check-bridge

# 3. Iniciar el Centro de Control Web Suizo (Tonalidades Claras) en http://127.0.0.1:8020
uv run mcp-secop --web

# 4. Ejecutar el servidor MCP en modo STDIO (para Claude Desktop / Cursor / Antigravity)
uv run mcp-secop --transport stdio

# 5. Ejecutar verificación completa (Ruff + ty + Pytest)
make check

🔌 Configuración en Clientes MCP

Agrega este bloque en tu archivo claude_desktop_config.json o configuración MCP de Cursor / Google Antigravity / OpenCode:

{
  "mcpServers": {
    "mcp-secop-colombia": {
      "command": "uv",
      "args": [
        "--directory",
        "C:/Users/luisa/OneDrive/Escritorio/SKILLS/mcp secop",
        "run",
        "mcp-secop"
      ],
      "env": {
        "SCRAPPING_API_URL": "http://127.0.0.1:8010"
      }
    }
  }
}

🗺️ Arquitectura del proyecto

Mapa de arquitectura interactivo autocontenido generado y validado con Archify en perfil showcase:

📂 Estructura del repositorio

mcp-secop/
├── src/mcp_secop/
│   ├── __init__.py          # Metadatos del paquete
│   ├── models.py            # Modelos Pydantic v2 (SODA, Spider, RAG, Bridge)
│   ├── taxonomy_spider.py   # Catálogo de 6 dominios SECOP II + Spider ASP.NET
│   ├── secop_engine.py      # Constructor SoQL, analítica COP y chunker RAG
│   ├── scrapping_bridge.py  # Puente bidireccional hacia el proyecto SCRAPPING (:8010)
│   ├── mcp_server.py        # Servidor MCP (8 Tools, 4 Resources, 2 Prompts)
│   ├── ui_template.py       # Interfaz Web en Minimalismo Suizo Claro
│   ├── web_app.py           # Pasarela HTTP FastAPI (:8020)
│   └── cli.py               # CLI unificada (mcp-secop)
├── tests/
│   └── test_mcp_secop.py    # Pruebas automatizadas pytest (patrón AAA)
├── docs/
│   ├── arquitectura.json    # Fuente tipada Archify
│   └── arquitectura.html    # Artefacto interactivo Archify
├── CONSTITUTION.md          # Fuente única de verdad del proyecto
├── AGENTS.md                # Contexto operativo para agentes IA
├── Makefile                 # Automatización de tareas
├── pyproject.toml           # Configuración uv, Ruff, pytest y scripts
└── uv.lock                  # Lockfile determinista versionado

📄 Licencia

Distribuido bajo la Licencia MIT.


Available Tools

8 tools
secop_analyze_procurement_budgetC

Ejecuta un análisis financiero y de concentración contractual en COP sobre procesos o contratos de SECOP II.

Inputs: limit, dataset, keyword, modalidad, +1 more. Returns: object

secop_bridge_statusA

Diagnostica el estado en vivo del puente bidireccional entre MCP-SECOP y el proyecto SCRAPPING.

Inputs: no named parameters. Returns: object

secop_generate_rag_chunksC

Genera chunks semánticos en Markdown con cabecera contextual institucional y metadatos para RAG (Qdrant/Chroma).

Inputs: limit, estado, dataset, entidad, +5 more. Returns: object

secop_get_taxonomy_mapC

Devuelve el mapa taxonómico de 6 dominios y 11 enlaces principales de SECOP II y Colombia Compra Eficiente.

Inputs: category_code. Returns: object

secop_inspect_opportunityB

Inspecciona en profundidad una URL OpportunityDetail de SECOP II (tablas DOM, __VIEWSTATE y pliegos anexos).

Inputs: process_url. Returns: object

secop_manage_rag_feedsC

Lista o crea feeds dinámicos de API RAG sincronizados con el proyecto SCRAPPING.

Inputs: name, slug, action, keyword, +3 more. Returns: object

secop_search_processesC

Busca procesos de contratación o contratos electrónicos en SECOP II (SODA SoQL + Puente SCRAPPING).

Inputs: limit, ciudad, estado, dataset, +9 more. Returns: object

secop_spider_crawlC

Ejecuta el Spider web asíncrono sobre SECOP II / Colombia Compra Eficiente clasificando enlaces y __VIEWSTATE.

Inputs: seed_url, max_links, category_filter, follow_internal_depth. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 8 tools

    Disambiguation4/5

    Most tools have clearly distinct roles: search, crawl, inspect, RAG chunking, taxonomy, bridge diagnostics, feed management, and budget analysis. Some potential overlap exists between search, spider crawl, and opportunity inspection since all involve retrieving SECOP II data, but descriptions make the intended granularity reasonably clear.

    Naming Consistency4/5

    All tools use the secop_ prefix and snake_case, which is highly predictable. Minor deviations appear in action-style consistency, especially secop_bridge_status and secop_spider_crawl, where the verb_noun pattern is less clean than in tools like secop_search_processes or secop_generate_rag_chunks.

    Tool Count5/5

    Eight tools is well-scoped for an integration server covering SECOP II search, crawling, inspection, RAG preparation, taxonomy, bridge diagnostics, feed management, and budget analysis. Each tool appears to serve a distinct function rather than bloating the surface.

    Completeness4/5

    The surface covers the main procurement data workflows: discovery, detailed inspection, crawling, RAG chunk generation, taxonomy mapping, bridge health, feed management, and financial analysis. Minor lifecycle gaps exist, such as no update/delete for RAG feeds and no obvious dedicated contract-by-ID retrieval tool, but core workflows are represented.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables access to Chile's government procurement data (Mercado Público / ChileCompra) via MCP, allowing AI agents to query public procurement information.
      95 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to query Ecuador government procurement (SERCOP/Compras Públicas) data without API keys, via natural language or direct tools.
      84 npm
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables 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.
      3
      MIT