# ContextStream MCP Server
[](https://www.npmjs.com/package/@contextstream/mcp-server)
[](https://github.com/contextstream/mcp-server)
## π§ Your AI's Permanent Brain β Across Every Tool, Every Conversation
**Tired of re-explaining your codebase to AI every single time?**
ContextStream gives your AI persistent memory that follows you everywhere. Decisions remembered. Context preserved. No more repeating yourself.
**Website:** [contextstream.io](https://contextstream.io) | **Docs:** [contextstream.io/docs/mcp](https://contextstream.io/docs/mcp)
---
## β¨ Why ContextStream?
### The Problem
- Close a chat with Cursor β Open a new one β AI forgot everything
- Switch from Claude to Windsurf β Start explaining from scratch
- New team member joins β Days of onboarding conversations
- "Why did we build it this way?" β No one remembers
### The Solution
ContextStream is a **universal memory layer** for AI coding tools. It works with **Cursor, Claude Code, Windsurf, VS Code**, and any MCP-compatible client.
```
You: "Initialize session and remember we use PostgreSQL with TypeScript strict mode"
...later, in a NEW conversation...
You: "What are my preferences for this project?"
AI: "You prefer TypeScript with strict mode, and you're using PostgreSQL."
```
**It remembers. Across sessions. Across tools. Forever.**
---
## π 2-Minute Setup
### 1. Get your API key (30 seconds)
Sign up at [contextstream.io](https://contextstream.io) β Settings β API Keys β Create one.
### 2. Add to your MCP config (60 seconds)
**Cursor / Claude Code / Windsurf / VS Code:**
```json
{
"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:** Add to `~/.codex/config.toml`:
```toml
[mcpServers.contextstream]
command = "npx"
args = ["-y", "@contextstream/mcp-server"]
[mcpServers.contextstream.env]
CONTEXTSTREAM_API_URL = "https://api.contextstream.io"
CONTEXTSTREAM_API_KEY = "your_api_key"
```
### 3. Try it out (30 seconds)
Start a chat and say:
> "Initialize session and remember that I prefer TypeScript with strict mode"
Then start a **brand new conversation** and ask:
> "What are my preferences?"
β¨ **It remembers.**
---
## π₯ Beyond Memory β That's Just the Beginning
ContextStream isn't just memory storage. It understands your code.
### Impact Analysis
```
"What breaks if I change the UserService class?"
```
See all dependencies and side effects before refactoring.
### Decision History
```
"Why did we choose PostgreSQL over MongoDB?"
```
Recall past decisions with full context and reasoning.
### Semantic Code Search
```
"Find where we handle rate limiting"
```
Search by meaning, not just keywords. Find code by intent.
### Knowledge Graph
```
"Show dependencies for the auth module"
```
Visualize connections between code, decisions, and docs.
---
## π 60+ MCP Tools at Your Fingertips
### π Code Search & Context
| Tool | Description |
|------|-------------|
| `search_semantic` | Find code by meaning, not just keywords |
| `search_hybrid` | Combines semantic + keyword for best results |
| `search_pattern` | Regex-based code search |
| `ai_context` | Automatically gather relevant code, docs, and memory |
### π§ Memory & Knowledge
| Tool | Description |
|------|-------------|
| `session_remember` | Quick natural language memory ("Remember I prefer TypeScript") |
| `session_recall` | Quick recall ("What were the auth decisions?") |
| `memory_create_event` | Store decisions, insights, and context |
| `memory_search` | Find relevant past context |
| `memory_decisions` | Get decision summaries |
### π Code Intelligence
| Tool | Description |
|------|-------------|
| `graph_dependencies` | Understand what depends on what |
| `graph_call_path` | Trace execution flows |
| `graph_impact` | Understand change impact |
| `graph_circular_dependencies` | Find problematic cycles |
| `graph_unused_code` | Identify dead code |
### π€ AI Integration
| Tool | Description |
|------|-------------|
| `ai_context` | Build LLM-ready context from your codebase |
| `ai_enhanced_context` | Deep analysis with memory integration |
| `ai_plan` | AI-powered development planning |
| `ai_tasks` | Break down work into actionable tasks |
### π Session Management
| Tool | Description |
|------|-------------|
| `session_init` | Initialize conversation with auto-context |
| `context_smart` | Get relevant context for any message |
| `session_capture` | Store context to memory |
| `session_compress` | Compress chat history to memory |
[See all 60+ tools β](https://contextstream.io/docs/mcp)
---
## β¨ Auto-Context (v0.3.0+)
Context loads **automatically** on the first tool call. No manual setup required.
```
βββββββββββββββββββββββββββββββββββββββββββ
π§ AUTO-CONTEXT LOADED (ContextStream)
βββββββββββββββββββββββββββββββββββββββββββ
π Workspace: my-project
π Project: backend-api
π Recent Decisions:
β’ Use PostgreSQL for persistence
β’ JWT for authentication
π§ Recent Context:
β’ [decision] API design patterns
β’ [preference] TypeScript strict mode
βββββββββββββββββββββββββββββββββββββββββββ
```
Works with **all MCP clients** β no client-side changes required.
---
## π‘οΈ Privacy & Security
- **Encrypted at rest** β All data encrypted with AES-256
- **No training on your data** β We never use your code to train AI
- **You control access** β Workspace permissions & API keys
- **Self-host option** β Enterprise can self-host for full control
---
## π Why Not Built-in Memory?
| Built-in memory | ContextStream |
|-----------------|---------------|
| β Vendor lock-in β switch tools, lose everything | β **Universal** β Cursor, Claude, Windsurf, any MCP tool |
| β Expires or resets over time | β **Persistent forever** β never lose context (paid plans) |
| β No semantic search | β **Semantic search** β find anything across all history |
| β Personal only β teammates start from zero | β **Team memory** β shared context, instant onboarding |
| β No API access | β **60+ MCP tools** β full API and automation |
| β Memory isolated from code | β **Knowledge graph** β decisions linked to code |
| β Clunky to use | β **Natural language** β "remember X", "what did we decide about Y?" |
---
## π Full Tool Reference
<details>
<summary><strong>Authentication</strong></summary>
| Tool | Description |
|------|-------------|
| `auth_me` | Get current user profile |
</details>
<details>
<summary><strong>Workspaces</strong></summary>
| Tool | Description |
|------|-------------|
| `workspaces_list` | List accessible workspaces |
| `workspaces_get` | Get workspace details |
| `workspaces_create` | Create a new workspace |
| `workspaces_overview` | Get workspace summary |
| `workspaces_analytics` | Get usage analytics |
| `workspaces_content` | List workspace content |
</details>
<details>
<summary><strong>Projects</strong></summary>
| Tool | Description |
|------|-------------|
| `projects_list` | List projects (by workspace) |
| `projects_get` | Get project details |
| `projects_create` | Create a new project |
| `projects_overview` | Get project summary |
| `projects_statistics` | Get code statistics |
| `projects_files` | List indexed files |
| `projects_index` | Trigger re-indexing |
| `projects_index_status` | Check indexing status |
</details>
<details>
<summary><strong>Search</strong></summary>
| Tool | Description |
|------|-------------|
| `search_semantic` | Semantic vector search |
| `search_hybrid` | Combined semantic + keyword |
| `search_keyword` | Traditional keyword search |
| `search_pattern` | Regex pattern search |
| `search_suggestions` | Get search suggestions |
</details>
<details>
<summary><strong>Memory</strong></summary>
| Tool | Description |
|------|-------------|
| `memory_create_event` | Store a memory event |
| `memory_get_event` | Retrieve an event |
| `memory_update_event` | Update an event |
| `memory_delete_event` | Remove an event |
| `memory_list_events` | List events in workspace |
| `memory_bulk_ingest` | Bulk import events |
| `memory_distill_event` | Extract key insights |
| `memory_create_node` | Create knowledge node |
| `memory_get_node` | Get knowledge node |
| `memory_update_node` | Update knowledge node |
| `memory_delete_node` | Remove knowledge node |
| `memory_supersede_node` | Replace with new version |
| `memory_list_nodes` | List knowledge nodes |
| `memory_search` | Search memory |
| `memory_decisions` | Get decision summaries |
| `memory_timeline` | Get chronological timeline |
| `memory_summary` | Get condensed summary |
</details>
<details>
<summary><strong>Graph Analysis</strong></summary>
| Tool | Description |
|------|-------------|
| `graph_related` | Find related knowledge nodes |
| `graph_path` | Find path between nodes |
| `graph_decisions` | Decision history in graph |
| `graph_dependencies` | Query code dependencies |
| `graph_call_path` | Trace call paths |
| `graph_impact` | Analyze change impact |
| `graph_circular_dependencies` | Find circular deps |
| `graph_unused_code` | Find dead code |
| `graph_contradictions` | Find conflicting info |
</details>
<details>
<summary><strong>AI</strong></summary>
| Tool | Description |
|------|-------------|
| `ai_context` | Build LLM context |
| `ai_enhanced_context` | Deep context with memory |
| `ai_embeddings` | Generate embeddings |
| `ai_plan` | Generate dev plan |
| `ai_tasks` | Generate tasks |
</details>
<details>
<summary><strong>Session & Auto-Context</strong></summary>
| Tool | Description |
|------|-------------|
| `session_init` | Initialize conversation |
| `session_get_user_context` | Get user preferences |
| `session_capture` | Store context to memory |
| `session_smart_search` | Search with context enrichment |
| `session_remember` | Quick natural language memory |
| `session_recall` | Quick natural language recall |
| `context_smart` | Get relevant context for message |
| `session_compress` | Compress chat history to memory |
| `session_summary` | Get compact workspace summary |
| `session_delta` | Get changes since timestamp |
</details>
---
## π Pre-built Prompts
| Prompt | Description |
|--------|-------------|
| `explore-codebase` | Get a codebase overview |
| `capture-decision` | Document an ADR |
| `review-context` | Build code review context |
| `investigate-bug` | Debug investigation helper |
| `explore-knowledge` | Navigate knowledge graph |
| `onboard-to-project` | Generate onboarding guide |
| `analyze-refactoring` | Find refactoring opportunities |
| `build-context` | Build comprehensive LLM context |
---
## βοΈ Environment Variables
| Variable | Required | Description |
|----------|----------|-------------|
| `CONTEXTSTREAM_API_URL` | Yes | API base URL (`https://api.contextstream.io`) |
| `CONTEXTSTREAM_API_KEY` | Yes | Your API key from contextstream.io |
---
## π Links
- **Website:** [contextstream.io](https://contextstream.io)
- **Documentation:** [contextstream.io/docs](https://contextstream.io/docs)
- **MCP Setup Guide:** [contextstream.io/docs/mcp](https://contextstream.io/docs/mcp)
- **npm:** [@contextstream/mcp-server](https://www.npmjs.com/package/@contextstream/mcp-server)
- **GitHub:** [contextstream/mcp-server](https://github.com/contextstream/mcp-server)
---
## π€ Contributing
We welcome contributions! Here's how you can help:
1. **Report bugs** β Open an issue at [GitHub Issues](https://github.com/contextstream/mcp-server/issues)
2. **Request features** β Share your ideas in the issues
3. **Submit PRs** β Fork the repo and submit pull requests
### Development
```bash
# Clone the repo
git clone https://github.com/contextstream/mcp-server.git
cd mcp-server
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build for production
npm run build
# Type check
npm run typecheck
```
---
## π License
MIT