Skip to main content
Glama
contextstream

ContextStream MCP Server

context

Retrieves relevant context for AI responses by analyzing user messages and returning token-efficient, minified information to replace full chat history in prompts.

Instructions

CALL THIS BEFORE EVERY AI RESPONSE to get relevant context.

This is the KEY tool for token-efficient AI interactions. It:

  1. Analyzes the user's message to understand what context is needed

  2. Retrieves only relevant context in a minified, token-efficient format

  3. Replaces the need to include full chat history in prompts

Format options:

  • 'minified': Ultra-compact D:decision|P:preference|M:memory (default, ~200 tokens)

  • 'readable': Line-separated with labels

  • 'structured': JSON-like grouped format

Type codes: W=Workspace, P=Project, D=Decision, M=Memory, I=Insight, T=Task, L=Lesson

Context Pack:

  • mode='pack' adds code context + distillation (higher credit cost)

Example usage:

  1. User asks "how should I implement auth?"

  2. AI calls context(user_message="how should I implement auth?")

  3. Gets: "W:Maker|P:contextstream|D:Use JWT for auth|D:No session cookies|M:Auth API at /auth/..."

  4. AI responds with relevant context already loaded

This saves ~80% tokens compared to including full chat history.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_messageYesThe user message to analyze and get context for
workspace_idNoWorkspace ID (UUID).
project_idNoProject ID (UUID).
max_tokensNoMaximum tokens for context (default: 800)
formatNoContext format (default: minified)
modeNoContext pack mode (default: pack when enabled)
distillNoUse distillation for context pack (default: true)
session_tokensNoCumulative session token count for context pressure calculation
context_thresholdNoCustom context window threshold (defaults to 70k)
save_exchangeNoSave this exchange to the transcript for later search (background task)
session_idNoSession ID for transcript association (required if save_exchange is true)
client_nameNoClient name for transcript metadata (e.g., 'claude', 'cursor')
assistant_messageNoPrevious assistant response to save along with user message (for complete exchange capture)

Latest Blog Posts

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/contextstream/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server