shared-context-cache-mcp-server
shared-context-cache-mcp-server
MCP server for shared context caching with trust verification -- AI agents share and verify computed results to reduce token cost and increase reliability.
Why?
Every AI agent constantly re-computes the same results: weather lookups, price checks, document summaries, research queries. With this MCP server, agents share their computed results through a common cache -- and verify each other's results.
The Trust Layer (v0.2.0)
Cached results are only useful if they're accurate. The trust verification system solves this:
Each cache entry has a trust score based on how many agents confirmed it
Agents call
confirm_entrywhen they verify a cached result is correctget_trustedreturns only entries confirmed by 3+ agents (configurable)Network effect: More agents verifying = more trusted results = everyone benefits
Like a CDN for agent intelligence -- with peer-reviewed accuracy.
Related MCP server: Agent Identity MCP Server
Install
pip install shared-context-cache-mcp-serverTools (8)
Tool | Description |
| Look up a cached result by key -- includes trust score |
| Search cache by keywords -- find precomputed results with trust levels |
| Store a computed result for other agents (starts with trust_score=1) |
| Confirm a cached result is accurate -- increases trust score |
| Get only entries confirmed by 3+ agents (high confidence) |
| Detailed analytics: hit rate, trust distribution, top agents, network score |
| Basic cache statistics (hits, misses, cost savings) |
| List cache entries with trust scores, optionally filtered by tags |
Usage Pattern
1. SEARCH: cache_search("weather berlin") or cache_lookup("weather:berlin:today")
2. HIT? Use the cached result. Check trust_score for confidence level.
3. VERIFY: If result is accurate, call confirm_entry("weather:berlin:today")
4. MISS? Compute the result, then cache_store(key, value, tags="weather,berlin")
5. TRUSTED: Use get_trusted(min_trust=3) for only peer-verified resultsTrust Levels
Trust Score | Level | Meaning |
1 | Unverified | Only the original agent stored it |
2 | Partially verified | One other agent confirmed it |
3-4 | Trusted | Multiple agents verified accuracy |
5+ | Highly trusted | Strong consensus across agents |
Claude Desktop Config
{
"mcpServers": {
"shared-context-cache": {
"command": "shared-context-cache-mcp-server"
}
}
}Cache Key Conventions
Use descriptive, hierarchical keys:
weather:berlin:2026-03-28research:arxiv:2501.00001:summaryprice:bitcoin:usd:2026-03-28analysis:company:AAPL:q1-2026
TTL Enforcement
Entries automatically expire after their TTL (default: 24h, max: 7 days). Expired entries return as cache misses -- compute fresh and store again.
Analytics
Use cache_analytics for detailed insights:
Hit rate -- How effective is the cache?
Most accessed entries -- What do agents need most?
Most trusted entries -- Highest peer-verified results
Top contributing agents -- Who's building the shared knowledge?
Trust distribution -- How verified is the cache overall?
Network effect score -- How strong is the agent network?
How It Works
Agent A stores result --> trust_score = 1 (unverified)
Agent B confirms result --> trust_score = 2 (partially verified)
Agent C confirms result --> trust_score = 3 (trusted)
Agent D uses get_trusted --> Gets only verified results, saves computationThe more agents participate, the more reliable the entire cache becomes. This is the core network effect.
Backend
Remote cache: agent-apis.vercel.app/api/cache
Trust layer: Local persistence in
~/.shared_context_cache_trust.json
License
MIT -- AiAgentKarl
Available Tools
8 toolscache_analyticsA
Detailed analytics about cache usage, trust, and network effects.
Shows: hit rate, most accessed entries, most trusted entries, top contributing agents, trust distribution, and network effect score.
Use this to understand how the shared cache is performing and how strong the network effect has become.
Inputs: no named parameters. Returns: result
cache_listB
List available cache entries with trust scores, optionally filtered by tags.
Browse what other agents have cached. Entries include trust scores showing how many agents have verified each result.
Args: limit: Max entries to return (default: 20, max: 100) tags: Filter by tags, comma-separated (e.g. 'weather,temperature')
Inputs: limit, tags. Returns: result
cache_lookupA
Look up a cached result by key. Returns the stored value if found, with trust score.
Use this BEFORE computing expensive results -- another agent may have already computed and cached the answer, saving tokens and latency.
Higher trust_score = more agents have verified this result is accurate.
Args: key: Cache key (e.g. 'weather:berlin:2026-03-28', 'research:quantum-computing') agent_id: Your agent identifier for analytics tracking
Inputs: key (required), agent_id. Returns: result
cache_searchA
Search the shared cache by keywords. Find relevant cached results from other agents.
Search before computing -- if another agent has cached a similar result, you can reuse it directly. Results include trust scores showing verification level.
Args: query: Keywords to search for (e.g. 'weather berlin', 'bitcoin price') limit: Max number of results to return (default: 10, max: 50)
Inputs: query (required), limit. Returns: result
cache_statsA
Get basic statistics about the shared cache -- hits, misses, top queries.
For more detailed analytics including trust scores and network effects, use cache_analytics instead.
Inputs: no named parameters. Returns: result
cache_storeA
Store a computed result in the shared cache so other agents can reuse it.
After computing an expensive result (web search, analysis, API call), store it here. Other agents will find it via cache_lookup or cache_search.
The entry starts with trust_score=1 (you as the first confirmer). Other agents can use confirm_entry to increase the trust score.
Args: key: Unique cache key (e.g. 'weather:berlin:2026-03-28', 'summary:arxiv:2501.00001') value: The result to cache (JSON string, text, or any serializable content) ttl_seconds: Time-to-live in seconds (default: 86400 = 24h, max: 604800 = 7 days) tags: Comma-separated tags for discovery (e.g. 'weather,berlin,temperature') agent_id: Your agent identifier for attribution (e.g. 'weather-agent-v2')
Inputs: key (required), value (required), ttl_seconds, tags, +1 more. Returns: result
confirm_entryA
Confirm a cached result is accurate. Increases the entry's trust score.
When you use a cached result and verify it's correct, confirm it. This builds trust for other agents: entries confirmed by multiple agents are more reliable than unverified ones.
NETWORK EFFECT: More agents confirming = higher trust = more reuse.
Each agent can confirm an entry once. Duplicate confirmations are ignored.
Args: key: Cache key to confirm (e.g. 'weather:berlin:2026-03-28') agent_id: Your agent identifier (e.g. 'research-agent-v1')
Inputs: key (required), agent_id. Returns: result
get_trustedA
Get only cache entries confirmed by multiple agents (high trust).
Returns entries with trust_score >= min_trust, sorted by trust score. These are the most reliable cached results -- verified by multiple independent agents.
Use this to find the most trustworthy precomputed results available.
Args: min_trust: Minimum trust score required (default: 3 = confirmed by 3+ agents) limit: Max entries to return (default: 20)
Inputs: min_trust, limit. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Tools are mostly distinct with clear purposes (lookup by key, search by keywords, list by tags, stats, analytics, store, confirm, get trusted). Some overlap between cache_stats and cache_analytics but descriptions differentiate basic vs detailed. Slight potential confusion between cache_lookup and cache_search but key vs keyword distinction helps.
Mix of patterns: most start with 'cache_' but 'confirm_entry' and 'get_trusted' lack the prefix. Some use verb_noun (cache_lookup, cache_store), others noun (cache_stats, cache_analytics). Inconsistent use of verbs and nouns across the set.
8 tools is well-scoped for a shared cache server: core operations like store, lookup, search, list, stats, and trust-related tools (confirm, get_trusted, analytics). Each tool serves a clear purpose without being overloaded.
Covers essential caching operations but lacks a delete or update tool. Agents cannot remove or modify cached entries directly. The trust mechanism is well-supported, but missing eviction could lead to stale data accumulation.
Maintenance
Related MCP Connectors
MCP-native Trust Infrastructure for AI Agents. Persistent encrypted memory with Trust Quotient.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
shared AI-context layer for teams — persistent memory your agents search and update over MCP
Shared memory for AI agents, with a receipt for every write. Hosted MCP at agentics.you/mcp.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that helps AI agents reduce token usage by compressing, summarizing, and managing conversation/context data more efficiently.11MIT
- AlicenseNot gradedqualityDmaintenanceMCP Server for AI agent identity and authorization. Create, verify, and manage agent identities with trust scores and scoped authorization tokens.31 PyPIMIT
- AlicenseNot gradedqualityDmaintenanceMCP server for storing and retrieving context-specific agent rules, enabling AI agents to access relevant guidelines efficiently and reduce context window usage.1Apache 2.0
- AlicenseAqualityDmaintenanceMCP server for AI agent trust verification, enabling agents to verify identities, check trust scores, and build reputation across multiple blockchain and web platforms.1215 npm1MIT