New:Microsoft Teams Notifications Are Now Available in Socket.Learn more β†’
Get Started

@contextstream/mcp-server

Package Overview
Dependencies
Maintainers
1
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contextstream/mcp-server

MCP server exposing ContextStream public API - code context, memory, search, and AI tools for developers

Source
npmnpm
Version
0.3.18
Version published
Weekly downloads
1.3K
-12.25%
Maintainers
1
Weekly downloads
Β 
Created
Source

ContextStream MCP Server

npm version GitHub MCP Compatible

Persistent memory + semantic search + dependency/impact analysis for Cursor, Claude Code, Windsurf, VS Code, Codex CLI, and any MCP client.

🧠 Your AI Finally Remembers

The universal memory layer for AI coding tools.

One integration. Every AI editor. Persistent memory that never forgets.

Get Started Β· Documentation Β· npm Package

⭐ If this saves you time, please star the repo β€” it helps others find it!

ContextStream Demo - AI that remembers across sessions

Your AI remembers decisions, preferences, and context β€” across sessions and tools.

The Real Cost of AI Amnesia

Every developer using AI tools has felt this frustration:

Monday morning. You've spent 3 hours with Claude explaining your authentication architecture, the edge cases, why you chose JWT over sessions, the rate limiting strategy. The AI finally gets it. You ship great code together.

Monday afternoon. New chat window. The AI has no idea what JWT is in your context. It suggests sessions. You explain everything again.

Tuesday. You switch to Cursor for a quick refactor. Start from zero. "We use TypeScript with strict mode." "Our API follows REST conventions." "The user service is in /src/services." Again.

A week later. "Why did we build it this way?" Nobody remembers. The decision rationale is buried in a closed Slack thread. The AI certainly doesn't know.

A month later. New team member joins. Days of onboarding conversations. Explaining the same architectural decisions. Documenting tribal knowledge that should already exist.

This isn't a minor inconvenience. It's death by a thousand cuts.

Every re-explanation is lost productivity. Every forgotten decision is technical debt. Every context switch is cognitive load. Every new teammate is weeks of redundant knowledge transfer.

Your AI is brilliant for 30 minutes at a timeβ€”then it's a goldfish.

What If Your AI Actually Learned?

ContextStream gives your AI a permanent brain.

You: "Initialize session. Remember: we use PostgreSQL, TypeScript strict mode,
     and JWT for auth. Rate limits are 100 req/min per user."

...3 weeks later, different tool, new conversation...

You: "What database do we use?"
AI: "You're using PostgreSQL. You also prefer TypeScript with strict mode
     and JWT authentication with 100 req/min rate limiting per user."

It remembers. Across sessions. Across tools. Forever.

Not just factsβ€”decisions, context, and reasoning:

You: "Why did we choose PostgreSQL over MongoDB?"
AI: "Based on your captured decision from March 15th: 'Chose PostgreSQL for
     ACID compliance and complex joins in the reporting module. MongoDB
     considered but rejected due to transaction requirements.'"

πŸš€ 2-Minute Setup

1. Get Your API Key

Sign up at contextstream.io β†’ Settings β†’ API Keys β†’ Create

2. Add to Your MCP Config

Claude Code / Cursor / Windsurf / VS Code:

{
  "mcpServers": {
    "contextstream": {
      "command": "npx",
      "args": ["-y", "@contextstream/mcp-server"],
      "env": {
        "CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
        "CONTEXTSTREAM_API_KEY": "your_api_key"
      }
    }
  }
}

Codex CLI (~/.codex/config.toml):

[mcp_servers.contextstream]
command = "npx"
args = ["-y", "@contextstream/mcp-server"]

[mcp_servers.contextstream.env]
CONTEXTSTREAM_API_URL = "https://api.contextstream.io"
CONTEXTSTREAM_API_KEY = "your_api_key"

Codex expects snake_case mcp_servers keys. After editing, fully restart Codex.

For workspace-pooled rate limiting (Team/Enterprise), the MCP server sends X-Workspace-Id based on the active repo/session (or explicit workspace_id in tool calls). You can optionally set CONTEXTSTREAM_WORKSPACE_ID as a fallback default, but it’s not required and isn’t a good fit if you frequently switch workspaces.

Adding rules files ensures your AI automatically uses ContextStream for memory on every conversation.

⚠️ Critical: Tool Naming Convention

AI ToolTool Name FormatExample
Claude Codemcp__<server>__<tool>mcp__contextstream__session_init
All Others (Codex, Cursor, Windsurf, Cline, etc.)<tool> (raw)session_init

For Claude Code β€” Create CLAUDE.md in your project root:

## ContextStream Integration

| Message | What to Call |
|---------|--------------|
| **1st message** | `mcp__contextstream__session_init(folder_path="...", context_hint="<user's message>")` |
| **2nd+ messages** | `mcp__contextstream__context_smart(user_message="<user's message>")` |
| **After tasks** | `mcp__contextstream__session_capture(...)` |

**NO EXCEPTIONS.** Call these tools before responding.

For Codex CLI β€” Create AGENTS.md in ~/.codex/ (global) or project root:

## ContextStream Integration

| Message | What to Call |
|---------|--------------|
| **1st message** | `session_init(folder_path="...", context_hint="<user's message>")` |
| **2nd+ messages** | `context_smart(user_message="<user's message>")` |
| **After tasks** | `session_capture(...)` |

**NO EXCEPTIONS.** Call these tools before responding.

For other editors β€” See full templates in the docs.

3. Experience Memory

You: "Initialize session and remember I prefer functional React components"

Open a new conversation (even in a different tool):

You: "What's my React preference?"
AI: "You prefer functional React components."

✨ That's it. Your AI remembers now.

4. (Optional) Connect GitHub + Slack for richer context

MCP gives your AI memory. Integrations make that memory richer by pulling in PRs, issues, and team conversations.

After you connect, try prompts like:

"Search our Slack messages for the decision about rate limiting."
"What did we decide in GitHub issues about the auth flow?"

Beyond Memory: Intelligence That Compounds

Memory is just the foundation. ContextStream understands your codebase at a deeper level.

πŸ”΄ Lessons Learned β€” Never Repeat Mistakes

When your AI makes a mistakeβ€”wrong approach, broken build, production issueβ€”capture it as a lesson:

You: "Capture lesson: Always run tests before pushing to main"

These lessons surface automatically in future sessions. Before the AI takes a similar action, it sees the warning. Your AI learns from mistakes just like you do.

TriggerExample
User correction"No, we use PostgreSQL not MySQL"
Production issue"That deploy broke the API"
Workflow mistake"You forgot to run the linter"

Lessons are categorized by severity (critical, high, medium, low) and automatically retrieved when relevant context is detected.

πŸ“Š Impact Analysis

You: "What breaks if I change the UserService class?"

See all dependencies and side effects before you refactor. No more surprise breakages.

You: "Find where we handle authentication errors"

Search by meaning, not keywords. Find code by what it does, not what it's named.

🧬 Knowledge Graph

Decisions, code, and documentationβ€”all connected. Ask "why" and get answers with full context.

πŸ€– Auto-Context Loading

Context loads automatically on first interaction. No manual setup:

═══════════════════════════════════════════
🧠 AUTO-CONTEXT LOADED (ContextStream)
═══════════════════════════════════════════
πŸ“ Workspace: acme-corp
πŸ“‚ Project: backend-api

πŸ“‹ Recent Decisions:
   β€’ Use PostgreSQL for persistence
   β€’ JWT for authentication

⚠️ Active Lessons:
   β€’ Always run tests before pushing

🧠 Recent Context:
   β€’ [decision] API rate limiting strategy
   β€’ [preference] TypeScript strict mode
═══════════════════════════════════════════

71 MCP Tools

Session & Memory

ToolWhat It Does
session_initInitialize with auto-context loading
context_smartGet relevant context for any message
session_rememberNatural language: "Remember X"
session_recallNatural language: "What did we decide about X?"
session_captureStore decisions, insights, preferences
session_capture_lessonCapture mistakes to prevent repeating them
session_get_lessonsRetrieve relevant lessons

Code Intelligence

ToolWhat It Does
search_semanticFind code by meaning
search_hybridSemantic + keyword combined
graph_dependenciesSee what depends on what
graph_impactUnderstand change impact
graph_call_pathTrace execution flows
graph_unused_codeFind dead code

AI Integration

ToolWhat It Does
ai_contextBuild LLM-ready context
ai_context_budgetContext within token limits
ai_planGenerate development plans
ai_tasksBreak work into tasks

View all 71 tools β†’

Why Not Built-in Memory?

Built-in "Memory"ContextStream
πŸ”’ Locked to one vendor🌐 Universal β€” works with Cursor, Claude, Windsurf, any MCP client
⏱️ Expires or resets♾️ Persistent β€” never lose context
πŸ“ Basic key-value🧠 Semantic β€” understands meaning and relationships
πŸ‘€ Personal onlyπŸ‘₯ Team-ready β€” shared workspace, instant onboarding
❌ No lessonsβœ… Learns from mistakes β€” captures and surfaces lessons
❌ No code understandingπŸ” Deep analysis β€” dependencies, impact, knowledge graph
🀷 Hope it remembers🎯 Deterministic β€” you control what's stored

Privacy & Security

  • πŸ” Encrypted at rest β€” AES-256 encryption for all stored data
  • 🚫 Never trains on your data β€” Your code is yours. Period.
  • πŸŽ›οΈ You control access β€” Workspace permissions, API key management
  • πŸ—‘οΈ Delete anytime β€” Full data deletion on request

Works Everywhere

ContextStream uses the Model Context Protocolβ€”the emerging standard for AI tool integrations.

Supported today:

  • Claude Code
  • Cursor
  • Windsurf
  • VS Code (with MCP extension)
  • Codex CLI
  • Cline
  • Kilo Code
  • Roo Code
  • Any MCP-compatible client

One integration. Every tool. Same memory.

Quick Reference

Environment Variables

VariableRequiredDescription
CONTEXTSTREAM_API_URLYeshttps://api.contextstream.io
CONTEXTSTREAM_API_KEYYesYour API key

Essential Commands

# Install globally
npm install -g @contextstream/mcp-server

# Or run via npx (recommended for MCP configs)
npx @contextstream/mcp-server

First Session Checklist

  • βœ… Add MCP config to your editor
  • βœ… Start a conversation: "Initialize session for [project-name]"
  • βœ… Tell it your preferences: "Remember we use TypeScript strict mode"
  • βœ… Make a decision: "Capture decision: Using PostgreSQL for the user database"
  • βœ… Open a new conversation and ask: "What are my preferences?"
ResourceURL
Websitecontextstream.io
Documentationcontextstream.io/docs
MCP Setup Guidecontextstream.io/docs/mcp
npm Package@contextstream/mcp-server
GitHubcontextstream/mcp-server

Contributing

We welcome contributions:

  • Report bugs β€” Open an issue
  • Request features β€” Share ideas in GitHub Issues
  • Submit PRs β€” Fork, branch, and submit

Development

git clone https://github.com/contextstream/mcp-server.git
cd mcp-server
npm install
npm run dev      # Development mode
npm run build    # Production build
npm run typecheck

License

MIT

Stop re-explaining. Start building.

Get Started β†’

Keywords

mcp

FAQs

Package last updated on 15 Dec 2025

Related posts