Skip to main content

AI Context Manager MCP

Servidor MCP (Model Context Protocol) en Python que actúa como sync agent entre el workspace local y la aplicación cloud.

¿Qué hace?

  • Gestiona la carpeta .ai/ en tu workspace (skills, prompts, specs, contexto, bootstrap)
  • Sincroniza assets con la app cloud (cloud_sync pull/push)
  • Genera MODEL_BOOTSTRAP.md adaptado al entorno (vscode, claude, opencode, cli, generic)
  • Mantiene .gitignore actualizado para no commitear el contexto local

Requisitos

  • Python 3.11+
  • pip / pipx

Instalación

# Con pipx (recomendado, instala en entorno aislado)
pipx install .

# O con pip en un virtualenv
python -m venv .venv
source .venv/bin/activate   # Linux/macOS
.venv\Scripts\activate      # Windows
pip install -e .

Variables de entorno (obligatorias para sync cloud)

# Linux/macOS
export AI_CONTEXT_MANAGER_BASE_URL="https://cloud.example.com"
export AI_CONTEXT_MANAGER_TOKEN="pat_xxx"

# Windows (PowerShell)
$env:AI_CONTEXT_MANAGER_BASE_URL="https://cloud.example.com"
$env:AI_CONTEXT_MANAGER_TOKEN="pat_xxx"

# Windows (cmd)
set AI_CONTEXT_MANAGER_BASE_URL=https://cloud.example.com
set AI_CONTEXT_MANAGER_TOKEN=pat_xxx

Arrancar el servidor MCP

# Modo stdio (para clientes MCP como Claude Desktop, OpenCode, etc.)
python -m mcp_server

# O usando el script instalado
ai-context-manager serve

Configuración en VS Code (tasks.json)

Crear .vscode/tasks.json en tu proyecto:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "AI Context Manager: Start MCP",
      "type": "shell",
      "command": "python -m mcp_server",
      "options": {
        "env": {
          "AI_CONTEXT_MANAGER_BASE_URL": "https://cloud.example.com",
          "AI_CONTEXT_MANAGER_TOKEN": "pat_xxx"
        }
      },
      "problemMatcher": []
    },
    {
      "label": "AI Context Manager: Sync (pull)",
      "type": "shell",
      "command": "ai-context-manager cloud-sync --direction pull",
      "options": {
        "env": {
          "AI_CONTEXT_MANAGER_BASE_URL": "https://cloud.example.com",
          "AI_CONTEXT_MANAGER_TOKEN": "pat_xxx"
        }
      },
      "problemMatcher": []
    }
  ]
}

Configuración en Claude Desktop

Añadir en claude_desktop_config.json:

{
  "mcpServers": {
    "ai-context-manager": {
      "command": "python",
      "args": ["-m", "mcp_server"],
      "env": {
        "AI_CONTEXT_MANAGER_BASE_URL": "https://cloud.example.com",
        "AI_CONTEXT_MANAGER_TOKEN": "pat_xxx"
      }
    }
  }
}

Configuración en OpenCode

Añadir en tu config de OpenCode:

{
  "mcp": {
    "servers": {
      "ai-context-manager": {
        "command": "python",
        "args": ["-m", "mcp_server"],
        "env": {
          "AI_CONTEXT_MANAGER_BASE_URL": "https://cloud.example.com",
          "AI_CONTEXT_MANAGER_TOKEN": "pat_xxx"
        }
      }
    }
  }
}

Setup inicial de un proyecto

# 1. Inicializar .ai/ en el workspace
ai-context-manager init --mode workspace

# 2. Vincular con proyecto cloud
ai-context-manager cloud-link --project-key my-project

# 3. Descargar assets del cloud
ai-context-manager cloud-sync --direction pull

# 4. Asegurar .gitignore
ai-context-manager ensure-gitignore

Tools disponibles (MCP)

Tool Descripción
init_storage Inicializa .ai/ en workspace o global
ensure_gitignore Añade .ai/ al .gitignore
scan_repo Escanea el repo buscando assets IA
list_assets Lista assets (skills/prompts/specs/context)
register_asset Registra un asset existente en el registry
move_asset Mueve un asset actualizando el registry
remove_asset Elimina un asset del registry
create_skill Crea un nuevo skill desde template
create_prompt Crea un nuevo prompt desde template
create_spec Crea una nueva spec desde template
generate_bootstrap Genera MODEL_BOOTSTRAP.md para el entorno
cloud_project_link Vincula workspace con proyecto cloud
cloud_sync Sincroniza assets (pull: cloud→local, push: local→cloud)
cloud_pull_backup Descarga un backup específico del cloud

Resources disponibles (MCP)

Resource Descripción
registry:// Contenido completo del registry.json
context://bootstrap Contenido del MODEL_BOOTSTRAP.md
skills://<id> Contenido de un skill por ID
prompts://<id> Contenido de un prompt por ID
specs://<id> Contenido de una spec por ID

Estructura local generada

.ai/
  registry.json          # fuente de verdad local
  context/
    AI_GUIDELINES.md
    MODEL_BOOTSTRAP.md   # generado por generate_bootstrap
  skills/
    *.md
  prompts/
    *.md
  specs/
    *.md
  templates/
    skill.md
    prompt.md
    spec.md
  .sync/
    state.json           # estado de sync (hashes/ETags)
    project.json         # binding local_path <-> project_key

Metadata

Release files for ai-context-manager-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai-context-manager-mcp 0.1.0
File Size Uploaded Provenance Actions
ai_context_manager_mcp-0.1.0.tar.gz 49.5 kB Without provenance Details for ai_context_manager_mcp-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ai-context-manager-mcp 0.1.0
File Interpreter ABI Platform Actions
ai_context_manager_mcp-0.1.0-py3-none-any.whl Python 3 none any Details for ai_context_manager_mcp-0.1.0-py3-none-any.whl

Total release size: 97.2 kB

Release files / ai_context_manager_mcp-0.1.0.tar.gz

Download URL ai_context_manager_mcp-0.1.0.tar.gz
Size 49.5 kB
Tags Source
SHA-256 checksum
How to use checksums
88d87578b35fc16313b6373446972ee733e048cd2c987ce303c8c1b025208031
BLAKE2b-256 checksum
How to use checksums
7a6c1816fe1105dda913b502496fe550439ccbbe92ad717c1dc0b1cfc065347e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / ai_context_manager_mcp-0.1.0-py3-none-any.whl

Download URL ai_context_manager_mcp-0.1.0-py3-none-any.whl
Size 47.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
576b19b1b8e8ca8e304d92014702e6c2e239e3bd1274ef149a3b57d0ec8430ce
BLAKE2b-256 checksum
How to use checksums
391deb9bce4d8f2109abe8c15fd668d8c8a260e4cbf85c2d03d09c2dcfb5c878
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Security for ai-context-manager-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page