mcp-context-cache
Allows configuring the mcp-context-cache server in JetBrains IDEs (IntelliJ, WebStorm, PyCharm) to provide efficient context caching for AI agents, enabling single-tool access to project files.
Allows configuring the mcp-context-cache server in PyCharm to provide efficient context caching for AI agents, enabling single-tool access to project files.
Allows configuring the mcp-context-cache server in WebStorm to provide efficient context caching for AI agents, enabling single-tool access to project files.
Click on "Install 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., "@mcp-context-cacheload project context using contextcache.json"
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.
mcp-context-cache
Caché de contexto para agentes de IA. Carga, almacena y entrega el contexto de archivos del proyecto de forma eficiente usando el Protocolo de Contexto de Modelos (MCP).
¿Por qué usarlo?
Sin este servidor | Con este servidor |
El agente llama a | Una sola llamada devuelve todo el proyecto |
30 archivos = 30 tool calls | 30 archivos = 1 tool call |
Related MCP server: MCP Filesystem Server
Características
Caché LRU — Los archivos se hashean con SHA-256 y se almacenan en memoria. Los archivos sin cambios nunca se vuelven a leer del disco.
Pipeline de seguridad — 8 pasos de validación bloquean archivos sensibles (
.env,*.pem, credenciales, binarios, etc.).3 herramientas MCP — Carga de contexto flexible: por lista de archivos, directorio o archivo de configuración.
Truncado inteligente — Respeta límites de tamaño configurables y reporta los archivos omitidos.
Orden alfabético — Salida determinista para respuestas estables del agente de IA.
Instalación
Instalación global (recomendada)
npm install -g mcp-context-cacheCon pnpm:
pnpm add -g mcp-context-cacheVerificar la instalación:
mcp-context-cache --versionSin instalar
npx mcp-context-cache --initGuía de configuración
Paso 1 — Registra el servidor MCP en tu IDE
VS Code
Opción A — Global (todos los workspaces):
Edita ~/.config/Code/User/mcp.json en macOS/Linux o %APPDATA%\Code\User\mcp.json en Windows:
{
"servers": {
"mcp-context-cache": {
"type": "stdio",
"command": "mcp-context-cache"
}
}
}Opción B — Por workspace:
Crea .vscode/mcp.json en la raíz del proyecto:
{
"servers": {
"mcp-context-cache": {
"type": "stdio",
"command": "mcp-context-cache"
}
}
}JetBrains (IntelliJ, WebStorm, PyCharm, etc.)
Crea .mcp.json en la raíz del proyecto:
{
"mcpServers": {
"mcp-context-cache": {
"command": "mcp-context-cache"
}
}
}JetBrains AI Assistant detecta
.mcp.jsonautomáticamente desde la versión 2024.3.
Paso 2 — Instrucciones al agente para preferir las herramientas MCP
Los agentes de IA usan sus herramientas nativas por defecto. Debes indicarles explícitamente que prefieran las del servidor MCP.
VS Code — Instrucciones globales
Crea el archivo ~/.config/Code/User/prompts/mcp-context-cache.instructions.md:
---
applyTo: "**"
---
# Carga de contexto — mcp-context-cache
## HERRAMIENTAS PROHIBIDAS
NUNCA uses estas herramientas para leer archivos del proyecto:
- `read_file`
- `list_dir`
- `file_search`
- `semantic_search`
- `grep_search`
Solo se permite usarlas si TODAS las herramientas MCP fallan con error.
## PROCEDIMIENTO OBLIGATORIO
Antes de cualquier otra llamada al inicio de una tarea:
1. Verifica si el workspace contiene un archivo `contextcache.json`.
2. Si existe → llama a `get_context_from_config` con `{ "projectRoot": "<ruta-absoluta>" }`.
3. Si no existe y necesitas un directorio → llama a `get_directory_context`.
4. Para archivos específicos → llama a `get_project_context` con un array `paths`.
5. Solo usa `read_file` si las tres herramientas MCP devuelven error.
## Referencia de herramientas
- `get_context_from_config` → `{ "projectRoot": "<ruta-absoluta>" }`
- `get_project_context` → `{ "paths": ["rel/ruta.ts", ...], "projectRoot": "<ruta-absoluta>" }`
- `get_directory_context` → `{ "rootPath": "<ruta-absoluta-al-directorio>" }`El frontmatter
applyTo: "**"le indica a VS Code Copilot que inyecte este archivo en cada conversación.
VS Code — Por proyecto
Crea .github/copilot-instructions.md en la raíz del proyecto:
## PROHIBIDO — no uses estas herramientas para leer archivos
NUNCA llames a `read_file`, `list_dir`, `file_search`, `semantic_search` o `grep_search`.
Solo recurre a ellas si todas las herramientas MCP devuelven error.
## PRIMER PASO OBLIGATORIO
Este proyecto tiene un `contextcache.json`. Llama a `get_context_from_config` antes de cualquier otra herramienta:
{ "projectRoot": "<ruta-absoluta-a-este-repo>" }JetBrains — Prompt de sistema global (AI Assistant)
Ve a Settings → Tools → AI Assistant → System prompt y agrega:
Al trabajar en cualquier proyecto que tenga un archivo contextcache.json, llama a la herramienta MCP
get_context_from_config con la ruta raíz del proyecto antes de leer archivos individuales.
Prefiere get_directory_context sobre leer archivos uno por uno, y get_project_context
sobre múltiples llamadas a read_file.Paso 3 — Inicializa tu proyecto
Ejecuta en la raíz del proyecto para generar un contextcache.json:
npx @jdug-jadodev/mcp-context-cache --initO créalo manualmente:
{
"modules": [
{
"name": "src",
"path": "src",
"includeInstructions": true,
"excludePatterns": ["**/*.test.ts", "**/*.spec.ts", "**/__mocks__/**"]
}
],
"globalInstructions": ".github/copilot-instructions.md",
"maxTotalSizeKb": 2048,
"cache": {
"maxEntries": 5000,
"maxEntrySizeKb": 1024
},
"security": {
"allowedPaths": ["./"],
"deniedPaths": ["./node_modules", "./dist", "./secrets", "./.git"],
"deniedFiles": [".env", "credentials.json", "*.pem"],
"maxFileSizeKb": 500,
"allowedExtensions": [".ts", ".tsx", ".js", ".jsx", ".json", ".md", ".yaml", ".yml"]
}
}Referencia de campos
Campo | Descripción |
| Lista de directorios a empaquetar |
| Ruta relativa a la raíz del proyecto |
| Si es |
| Patrones glob a omitir |
| Ruta al Markdown incluido al inicio del bundle cuando |
| Tamaño máximo total del bundle en KB |
| Número máximo de archivos en la caché LRU |
| Tamaño máximo de archivo individual en caché |
| Rutas desde las que el servidor puede leer |
| Rutas siempre bloqueadas |
| Patrones de nombres de archivo siempre bloqueados |
| Tamaño máximo de archivo a servir |
| Lista blanca de extensiones de archivo |
Herramientas MCP
get_context_from_config
Carga el contexto completo del proyecto definido en contextcache.json. Úsala siempre primero.
{ "projectRoot": "/ruta/absoluta/al/proyecto" }Parámetro | Tipo | Requerido | Descripción |
| string | sí | Directorio que contiene |
| string | no | Ruta explícita a |
get_directory_context
Carga recursivamente todos los archivos de un directorio.
{ "rootPath": "/ruta/absoluta/al/directorio", "excludePatterns": ["*.test.ts"] }Parámetro | Tipo | Requerido | Descripción |
| string | sí | Directorio a escanear |
| string | no | Ruta a |
| string[] | no | Patrones glob adicionales a excluir |
get_project_context
Carga una lista específica de archivos por ruta.
{ "paths": ["src/auth/login.ts", "src/types.ts"], "projectRoot": "/ruta/absoluta" }Parámetro | Tipo | Requerido | Descripción |
| string[] | sí | Rutas de archivos a cargar |
| string | no | Raíz para resolver rutas relativas |
| string | no | Ruta a |
Formato de salida
Cada archivo en el bundle se envuelve con marcadores BUNDLE:
BUNDLE_START: <sha256-fingerprint>
ruta/al/archivo.ts
<contenido completo del archivo>
BUNDLE_END: ruta/al/archivo.tsLos archivos siempre se ordenan alfabéticamente para una salida determinista.
Manejo de BUNDLE_TRUNCATED
Cuando el tamaño total supera maxTotalSizeKb, la respuesta incluye:
BUNDLE_TRUNCATED: límite de tamaño excedido.
Límite configurado: 2048 KB
Tamaño total: 3100 KB
Archivos omitidos:
src/modulo-grande/archivo-a.ts
src/modulo-grande/archivo-b.tsLlama a get_project_context con las rutas omitidas para recuperarlos en una llamada de seguimiento.
Seguridad
Los siguientes archivos están siempre bloqueados, independientemente del contextcache.json:
.env,.env.*,credentials.json,*.pem,id_rsa,id_ed25519*.key,private.key,secret*,secrets.json,token*service-account.json,.npmrc,.pypircTodos los binarios:
.exe,.dll,.png,.zip,.wasm, etc.
Las rutas fuera de allowedPaths son rechazadas. El servidor nunca sigue symlinks fuera del árbol permitido.
Desarrollo
pnpm install
pnpm build # Compila TypeScript → dist/
pnpm dev # Ejecuta con tsx (sin paso de build)
pnpm test # Suite de tests con VitestLicencia
MIT
Available Tools
3 toolsget_context_from_configA
Reads contextcache.json and returns full project context with module instructions and caching.
| Name | Required | Description | Default |
|---|---|---|---|
| configPath | No | Explicit path to contextcache.json (optional) | |
| projectRoot | Yes | Directory where contextcache.json is located |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Indicates read operation and caching, but lacks details on error handling, permissions, or side effects. Without annotations, more transparency is needed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single concise sentence efficiently conveys purpose with no wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Adequate for simple structure (2 params, no output schema), but omits details on output format and error scenarios.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so parameters are well-documented. Description adds no extra meaning beyond the schema, meeting baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly specifies the tool reads a specific resource (contextcache.json) and returns a defined output (full project context with module instructions and caching), distinguishing it from sibling tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus siblings (get_directory_context, get_project_context) or any exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_directory_contextB
Recursively packages all files in a directory and returns them as formatted context for AI agents.
| Name | Required | Description | Default |
|---|---|---|---|
| rootPath | Yes | Root directory path to recursively include | |
| configPath | No | Path to contextcache.json (optional) | |
| excludePatterns | No | Additional glob patterns to exclude |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must disclose behavioral traits, but it only mentions 'recursively packages' without details on side effects, performance limits, or whether it modifies state. It lacks transparency beyond the basic operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, clear sentence with no unnecessary words. It conveys the core functionality efficiently, though it could benefit from slightly more structure.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (recursive directory traversal) and the lack of an output schema, the description is somewhat minimal. It doesn't explain the output format or any limitations, but it covers the basic purpose adequately.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so parameters are already documented. The description does not add any additional meaning or context beyond what the schema provides, hence baseline score of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'packages' and the resource 'all files in a directory', with the purpose of returning formatted context. It is specific and distinct from siblings by mentioning recursion and packaging.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus its siblings (get_context_from_config, get_project_context) or when not to use it. The description only states what it does.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_project_contextA
Returns formatted context for a list of files. Use this to load specific files into AI agent context with caching.
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes | List of absolute or relative file paths to include | |
| configPath | No | Path to contextcache.json for security configuration | |
| projectRoot | No | Project root for resolving relative paths (default: cwd) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description bears the full burden. It mentions caching and formatted output, but does not disclose side effects, authentication needs, rate limits, or what 'formatted context' entails. Adequate but limited.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences that are direct and front-loaded. The first states the action, the second gives usage guidance. No superfluous information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 3 parameters and no output schema or annotations, the description lacks details on return format, caching behavior, and error scenarios. It references sibling tools but does not clarify differentiation. Leaves gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so baseline is 3. The description adds 'with caching' but does not elaborate on parameter meaning beyond what the schema already provides. No extra value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it returns formatted context for a list of files and mentions caching. It distinguishes from siblings by specifying file paths, but does not explicitly compare to get_context_from_config or get_directory_context.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description advises 'Use this to load specific files into AI agent context with caching,' giving clear context and a specific usage intent. However, it does not provide when-not-to-use or compare with sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool has a distinct input source: config file, directory, or specific file list. No overlap in purpose.
All tools use the consistent 'get_<object>_context' pattern, making them predictable and easy to differentiate.
Three tools is well-scoped for a context-caching server, covering the primary ways to load context without unnecessary bloat.
The set covers the main context retrieval methods (config, directory, file list) but lacks cache management or update capabilities, which are minor gaps.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Securely search and manage workspace context files for AI agents and teams.
Project memory, semantic code search, and grounded agent context.
Shared project context for AI agents and teams: docs, tasks, and messages that stay current.
Stop re-explaining yourself to Agents. Give it the right context, right when needed.
Related MCP Servers
- AlicenseAqualityFmaintenanceA Model Context Protocol server that provides secure and intelligent interaction with files and filesystems, offering smart context management and token-efficient operations for working with large files and complex directory structures.2166MIT
- AlicenseAqualityDmaintenanceProvides secure filesystem access for AI models through the Model Context Protocol with strict path validation, file operations, directory management, and system command execution within predefined directories.1633MIT
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to securely read, search, and analyze local file systems through the Model Context Protocol. Provides tools for listing files, pattern-based searching, and reading file contents with built-in security validation.6
- FlicenseNot gradedqualityDmaintenanceEfficiently delivers project documentation to AI agents like Claude on-demand, optimizing token usage by loading context only when needed. Supports document retrieval, listing, and keyword search with security features.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jdug-jadodev/MCP-CACHING'
If you have feedback or need assistance with the MCP directory API, please join our Discord server