Skip to main content
Glama

la-caja-mcp

MCP system for accessing and debating La Caja (contextual memory). Repo B: consumer of La Caja (repo A). This repo does not touch the memory core; it communicates with it via API and exposes La Caja to agents.

What's Here

  • src/la_caja_mcp/protocolo.py — agent-agent-human debate protocol. Claims, interference requests, rounds with deadlines, human adjudication. Deterministic and replayable (event-sourcing, same discipline as La Caja).

  • src/la_caja_mcp/mcp_server.py — MCP server: debate tools + memory tools for La Caja (repo A, consumed via API), a single set of tools and two transports (local stdio / remote streamable HTTP).

  • tests/ — mini-falsification of the state machine + integration with real MCP client via stdio (debate and memory).

  • demo_debate.py — demo of debate that reaches consensus.

  • smoke_http.py — smoke test of streamable HTTP transport.

  • worker/ — portable ASGI host (uvicorn + Dockerfile) for remote MCP.

Related MCP server: Arena MCP Server

MCP Server

One set of tools, two transports:

# local (stdio): lo lanza el agente como subproceso
la-caja-mcp --transport stdio

# remoto (streamable HTTP): unico standard para MCP sobre red
la-caja-mcp --transport streamable-http --host 127.0.0.1 --port 8000

Debate: crear_sesion, mover (JSON payload), estado, ultimos_eventos, reproducir_sesion. Memory (requires pip install la-caja; repo A): procesar_consulta, declarar_relacion, consultar, contexto_primado, stats.

Memory is persistent with --caja-db <path> (SQLite, event-sourcing from La Caja) or LA_CAJA_DB; without these, purely in memory.

MCP Transports (Architecture Decision)

  • Local = stdio (the agent launches the server as a subprocess).

  • Remote = streamable HTTP (the only standard for remote MCP, + OAuth).

  • worker/ is an example of a deployable host (VPS/Docker); no public hosted MCP.

Test

$env:PYTHONPATH="src"; python -m pytest tests -q

Available Tools

10 tools
consultarA

Confianza de la relacion entre dos terminos: 1.0 observada, 0.5^puentes inferida por cierre transitivo, 0.0 sin relacion.

Inputs: a (required), b (required). Returns: object

contexto_primadoC

Contexto asociativo de un termino para inyectar en un modelo: las relaciones observadas primero, luego el vecindario de activacion, acotado al presupuesto. Mecanismo separado de la navegacion.

Inputs: termino (required), presupuesto. Returns: object

crear_sesionB

Crea una sesion de debate sobre un claim. Devuelve sesion_id y el estado inicial. El primer movimiento es proponer(actor).

Inputs: claim (required), participantes (required), arbitro, contexto, +1 more. Returns: object

declarar_relacionC

Declara una relacion entre dos terminos (co-ocurrencia explicita) sin pasar por texto crudo. Util para scripting e integraciones.

Inputs: a (required), b (required). Returns: object

estadoB

Estado actual de la sesion mas el log completo de eventos (replayable).

Inputs: sesion_id (required). Returns: object

moverC

Aplica un movimiento a la sesion. Ver docstring del modulo para el payload JSON que espera cada tipo. Devuelve el evento y el estado.

Inputs: tipo (required), actor (required), sesion_id (required), payload. Returns: object

procesar_consultaB

Ingesta: procesa una consulta humana completa en La Caja (tokeniza, normaliza a conceptos canonicos, filtra y crea/reforza las burbujas del contexto). Devuelve los terminos procesados y los eventos de la piscina.

Inputs: texto (required). Returns: object

reproducir_sesionA

Reconstruye una sesion replayando un log de eventos (JSON list). Verifica determinismo: el estado final debe coincidir con el que produjeron los eventos originales.

Inputs: log (required), claim (required). Returns: object

statsC

Dimensiones de la memoria: terminos, nodos, aristas.

Inputs: no named parameters. Returns: object

ultimos_eventosA

Eventos con seq mayor a desde_seq. Primitiva de sondeo para discusion en vivo: un agente pregunta que paso desde su ultimo corte.

Inputs: sesion_id (required), desde_seq. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 10 tools

    Disambiguation4/5

    Each tool has a distinct purpose: session creation, moves, state retrieval, event polling, replay, query processing, relation declaration, relation query, context retrieval, and stats. There is some overlap between `estado` and `ultimos_eventos` (both return events), but the descriptions clearly differentiate full state+log vs. incremental events, so agents can distinguish them effectively.

    Naming Consistency2/5

    Tool names follow snake_case but mix verb+noun (crear_sesion, procesar_consulta), bare verbs (mover, consultar), bare nouns (estado, stats), and noun phrases (ultimos_eventos, contexto_primado). This inconsistency in syntactic role makes the naming pattern hard to predict for an agent.

    Tool Count4/5

    With 10 tools, the set covers both session management and term/relation operations without feeling bloated. The scope is well-bounded; each tool adds a distinct capability. Slightly on the higher side but still appropriate for the domain.

    Completeness2/5

    Core operations are present (create session, move, query state, process queries, declare/query relations), but there are notable gaps: no session listing or deletion, no term/relation listing, no update or delete for relations. These missing CRUD operations would force agents into workarounds or failures.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Facilitates structured multi-agent debates with arguments, rebuttals, and judgments across multiple rounds, enabling diverse AI personas to engage in formal debate and collaborative problem-solving.
      1
      20 npm
      17
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables running position-driven adversarial debates and code reviews between AI agents via MCP tools, supporting custom positions, multiple rounds, and local CLI models like Claude, Codex, and Gemini.
      282 npm
      1
      MIT