@contextstream/mcp-server 0.3.67 → 0.3.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +390 -390
- package/dist/index.js +105 -5
- package/package.json +57 -57
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 ContextStream
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 ContextStream
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,390 +1,390 @@
|
|
|
1
|
-
# ContextStream MCP Server
|
|
2
|
-
|
|
3
|
-
Persistent memory, semantic search, and code intelligence for any MCP-compatible AI tool.
|
|
4
|
-
|
|
5
|
-
ContextStream is a shared "brain" for your AI workflows. It stores decisions, preferences, and lessons, and lets your AI tools search and analyze your codebase with consistent context across sessions.
|
|
6
|
-
|
|
7
|
-
## Just Ask
|
|
8
|
-
|
|
9
|
-
**You don't need to memorize tool names.** Just describe what you want and your AI uses the right ContextStream tools automatically:
|
|
10
|
-
|
|
11
|
-
| You say... | ContextStream does... |
|
|
12
|
-
|------------|----------------------|
|
|
13
|
-
| "session summary" | Gets a summary of your workspace context |
|
|
14
|
-
| "what did we decide about auth?" | Recalls past decisions about authentication |
|
|
15
|
-
| "remember we're using PostgreSQL" | Saves this to memory for future sessions |
|
|
16
|
-
| "search for payment code" | Searches your codebase semantically |
|
|
17
|
-
| "what depends on UserService?" | Analyzes code dependencies |
|
|
18
|
-
|
|
19
|
-
No special syntax. No commands to learn. Just ask.
|
|
20
|
-
|
|
21
|
-
> **Tip:** For best results, add the [recommended editor rules](https://contextstream.io/docs/quickstart) so your AI consistently calls `session_init` / `context_smart` automatically.
|
|
22
|
-
|
|
23
|
-

|
|
24
|
-
|
|
25
|
-
## Features
|
|
26
|
-
|
|
27
|
-
- Session-aware context loading (`session_init`, `context_smart`)
|
|
28
|
-
- Memory capture and recall (decisions, preferences, tasks, bugs, lessons)
|
|
29
|
-
- Code search (semantic, hybrid, keyword, pattern)
|
|
30
|
-
- Knowledge graph and code analysis (dependencies, impact, call paths, circular deps, unused code)
|
|
31
|
-
- Graph ingestion for full graph builds (`graph_ingest`)
|
|
32
|
-
- Local repo ingestion for indexing (`projects_ingest_local`)
|
|
33
|
-
- Auto-context: on the first tool call in a new session, the server can auto-initialize context
|
|
34
|
-
|
|
35
|
-
## Graph tiers
|
|
36
|
-
|
|
37
|
-
- **Pro (Graph-Lite):** module-level import graph, dependencies, and 1-hop impact
|
|
38
|
-
- **Elite/Team (Full Graph):** module + call + dataflow + type layers, plus `graph_ingest`
|
|
39
|
-
|
|
40
|
-
## Requirements
|
|
41
|
-
|
|
42
|
-
- Node.js 18+
|
|
43
|
-
- A ContextStream account and either an API key or a JWT
|
|
44
|
-
|
|
45
|
-
## Quickstart
|
|
46
|
-
|
|
47
|
-
### Setup wizard (recommended)
|
|
48
|
-
|
|
49
|
-
This interactive wizard sets up authentication, installs editor rules, and writes MCP config files for the tools you select.
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
npx -y @contextstream/mcp-server setup
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Notes:
|
|
56
|
-
- Uses browser/device login by default and creates an API key for you.
|
|
57
|
-
- Prompts for **toolset selection**: `light` (~30 tools), `standard` (default, ~50 tools), or `complete` (~86 tools including workspaces, projects, search, memory, graph, AI, and integrations).
|
|
58
|
-
- To avoid re-auth prompts on subsequent runs, the wizard saves that API key to `~/.contextstream/credentials.json` (and also writes it into the MCP config files it generates). Delete that file to force a fresh login.
|
|
59
|
-
- Codex CLI MCP config is global-only (`~/.codex/config.toml`), so the wizard will always write Codex config globally when selected.
|
|
60
|
-
- Some tools still require UI/CLI-based MCP setup (the wizard will tell you when it can't write a config).
|
|
61
|
-
- Preview changes without writing files: `npx -y @contextstream/mcp-server setup --dry-run`
|
|
62
|
-
|
|
63
|
-
### Run the server
|
|
64
|
-
|
|
65
|
-
Run directly (recommended for MCP configs):
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
npx -y @contextstream/mcp-server
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Or install globally:
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
npm install -g @contextstream/mcp-server
|
|
75
|
-
contextstream-mcp
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### Keeping updated
|
|
79
|
-
|
|
80
|
-
To get the latest features and bug fixes, update periodically:
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
npm update -g @contextstream/mcp-server
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
The MCP server will warn you when a newer version is available. After updating, restart your AI tool to use the new version.
|
|
87
|
-
|
|
88
|
-
## Configure your MCP client
|
|
89
|
-
|
|
90
|
-
### Manual setup
|
|
91
|
-
|
|
92
|
-
If you ran the [setup wizard](#setup-wizard-recommended), you can usually skip this section.
|
|
93
|
-
|
|
94
|
-
If you prefer to configure things by hand (or your tool can't be auto-configured), add the ContextStream MCP server to your client using one of the examples below.
|
|
95
|
-
|
|
96
|
-
**Toolset**: By default, the server exposes the `standard` toolset (~50 tools). Use `CONTEXTSTREAM_TOOLSET=light` to reduce tool count (~30 tools), or `CONTEXTSTREAM_TOOLSET=complete` to expose all ~86 tools (workspaces, projects, search, memory, graph, AI, integrations). See the [full tool catalog](https://contextstream.io/docs/mcp/tools).
|
|
97
|
-
|
|
98
|
-
### Cursor / Windsurf / Claude Desktop (JSON)
|
|
99
|
-
|
|
100
|
-
These clients use the `mcpServers` JSON schema:
|
|
101
|
-
|
|
102
|
-
- Cursor: `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project)
|
|
103
|
-
- Windsurf: `~/.codeium/windsurf/mcp_config.json`
|
|
104
|
-
- Claude Desktop:
|
|
105
|
-
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
106
|
-
- Windows: `%APPDATA%\\Claude\\claude_desktop_config.json`
|
|
107
|
-
|
|
108
|
-
Many other MCP JSON clients also use this same `mcpServers` shape (including Claude Code project scope via `.mcp.json`).
|
|
109
|
-
|
|
110
|
-
**Standard toolset (default, ~50 tools):**
|
|
111
|
-
|
|
112
|
-
```json
|
|
113
|
-
{
|
|
114
|
-
"mcpServers": {
|
|
115
|
-
"contextstream": {
|
|
116
|
-
"command": "npx",
|
|
117
|
-
"args": ["-y", "@contextstream/mcp-server"],
|
|
118
|
-
"env": {
|
|
119
|
-
"CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
|
|
120
|
-
"CONTEXTSTREAM_API_KEY": "your_api_key"
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
**Complete toolset (~86 tools):**
|
|
128
|
-
|
|
129
|
-
```json
|
|
130
|
-
{
|
|
131
|
-
"mcpServers": {
|
|
132
|
-
"contextstream": {
|
|
133
|
-
"command": "npx",
|
|
134
|
-
"args": ["-y", "@contextstream/mcp-server"],
|
|
135
|
-
"env": {
|
|
136
|
-
"CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
|
|
137
|
-
"CONTEXTSTREAM_API_KEY": "your_api_key",
|
|
138
|
-
"CONTEXTSTREAM_TOOLSET": "complete"
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### VS Code (`.vscode/mcp.json`)
|
|
146
|
-
|
|
147
|
-
VS Code uses a different schema with a top-level `servers` map:
|
|
148
|
-
|
|
149
|
-
**Core toolset (default):**
|
|
150
|
-
|
|
151
|
-
```json
|
|
152
|
-
{
|
|
153
|
-
"servers": {
|
|
154
|
-
"contextstream": {
|
|
155
|
-
"type": "stdio",
|
|
156
|
-
"command": "npx",
|
|
157
|
-
"args": ["-y", "@contextstream/mcp-server"],
|
|
158
|
-
"env": {
|
|
159
|
-
"CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
|
|
160
|
-
"CONTEXTSTREAM_API_KEY": "your_api_key"
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
**Complete toolset (~86 tools):**
|
|
168
|
-
|
|
169
|
-
```json
|
|
170
|
-
{
|
|
171
|
-
"servers": {
|
|
172
|
-
"contextstream": {
|
|
173
|
-
"type": "stdio",
|
|
174
|
-
"command": "npx",
|
|
175
|
-
"args": ["-y", "@contextstream/mcp-server"],
|
|
176
|
-
"env": {
|
|
177
|
-
"CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
|
|
178
|
-
"CONTEXTSTREAM_API_KEY": "your_api_key",
|
|
179
|
-
"CONTEXTSTREAM_TOOLSET": "complete"
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
Strong recommendation: VS Code supports `inputs` so you don’t have to hardcode secrets in a committed file:
|
|
187
|
-
|
|
188
|
-
```json
|
|
189
|
-
{
|
|
190
|
-
"servers": {
|
|
191
|
-
"contextstream": {
|
|
192
|
-
"type": "stdio",
|
|
193
|
-
"command": "npx",
|
|
194
|
-
"args": ["-y", "@contextstream/mcp-server"],
|
|
195
|
-
"env": {
|
|
196
|
-
"CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
|
|
197
|
-
"CONTEXTSTREAM_API_KEY": "${input:contextstreamApiKey}"
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
"inputs": [
|
|
202
|
-
{
|
|
203
|
-
"id": "contextstreamApiKey",
|
|
204
|
-
"type": "promptString",
|
|
205
|
-
"description": "ContextStream API Key",
|
|
206
|
-
"password": true
|
|
207
|
-
}
|
|
208
|
-
]
|
|
209
|
-
}
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
### Claude Code (CLI)
|
|
213
|
-
|
|
214
|
-
User scope (all projects):
|
|
215
|
-
|
|
216
|
-
**Standard toolset (default):**
|
|
217
|
-
|
|
218
|
-
```bash
|
|
219
|
-
claude mcp add --transport stdio contextstream --scope user \
|
|
220
|
-
--env CONTEXTSTREAM_API_URL=https://api.contextstream.io \
|
|
221
|
-
--env CONTEXTSTREAM_API_KEY=YOUR_KEY \
|
|
222
|
-
-- npx -y @contextstream/mcp-server
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
**Complete toolset (~86 tools):**
|
|
226
|
-
|
|
227
|
-
```bash
|
|
228
|
-
claude mcp add --transport stdio contextstream --scope user \
|
|
229
|
-
--env CONTEXTSTREAM_API_URL=https://api.contextstream.io \
|
|
230
|
-
--env CONTEXTSTREAM_API_KEY=YOUR_KEY \
|
|
231
|
-
--env CONTEXTSTREAM_TOOLSET=complete \
|
|
232
|
-
-- npx -y @contextstream/mcp-server
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
Note: Claude Code may warn about large tool contexts when using `complete`. The default is `standard` (~50 tools). Use `light` for fewer tools.
|
|
236
|
-
|
|
237
|
-
Windows caveat (native Windows, not WSL): if `npx` isn't found, use `cmd /c npx -y @contextstream/mcp-server` after `--`.
|
|
238
|
-
|
|
239
|
-
**Alternative (JSON form):**
|
|
240
|
-
|
|
241
|
-
Standard:
|
|
242
|
-
```bash
|
|
243
|
-
claude mcp add-json contextstream \
|
|
244
|
-
'{"type":"stdio","command":"npx","args":["-y","@contextstream/mcp-server"],"env":{"CONTEXTSTREAM_API_URL":"https://api.contextstream.io","CONTEXTSTREAM_API_KEY":"your_api_key"}}'
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
Complete:
|
|
248
|
-
```bash
|
|
249
|
-
claude mcp add-json contextstream \
|
|
250
|
-
'{"type":"stdio","command":"npx","args":["-y","@contextstream/mcp-server"],"env":{"CONTEXTSTREAM_API_URL":"https://api.contextstream.io","CONTEXTSTREAM_API_KEY":"your_api_key","CONTEXTSTREAM_TOOLSET":"complete"}}'
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
### Codex CLI (`~/.codex/config.toml`)
|
|
254
|
-
|
|
255
|
-
**Standard toolset (default):**
|
|
256
|
-
|
|
257
|
-
```toml
|
|
258
|
-
[mcp_servers.contextstream]
|
|
259
|
-
command = "npx"
|
|
260
|
-
args = ["-y", "@contextstream/mcp-server"]
|
|
261
|
-
|
|
262
|
-
[mcp_servers.contextstream.env]
|
|
263
|
-
CONTEXTSTREAM_API_URL = "https://api.contextstream.io"
|
|
264
|
-
CONTEXTSTREAM_API_KEY = "your_api_key"
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
**Complete toolset (~86 tools):**
|
|
268
|
-
|
|
269
|
-
```toml
|
|
270
|
-
[mcp_servers.contextstream]
|
|
271
|
-
command = "npx"
|
|
272
|
-
args = ["-y", "@contextstream/mcp-server"]
|
|
273
|
-
|
|
274
|
-
[mcp_servers.contextstream.env]
|
|
275
|
-
CONTEXTSTREAM_API_URL = "https://api.contextstream.io"
|
|
276
|
-
CONTEXTSTREAM_API_KEY = "your_api_key"
|
|
277
|
-
CONTEXTSTREAM_TOOLSET = "complete"
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
After editing, restart your MCP client so it reloads the server configuration.
|
|
281
|
-
|
|
282
|
-
## Authentication
|
|
283
|
-
|
|
284
|
-
You can authenticate using either:
|
|
285
|
-
|
|
286
|
-
- `CONTEXTSTREAM_API_KEY` (recommended for local/dev)
|
|
287
|
-
- `CONTEXTSTREAM_JWT` (useful for hosted or user-session flows)
|
|
288
|
-
|
|
289
|
-
## Environment variables
|
|
290
|
-
|
|
291
|
-
| Variable | Required | Description |
|
|
292
|
-
|----------|----------|-------------|
|
|
293
|
-
| `CONTEXTSTREAM_API_URL` | Yes | Base API URL (e.g. `https://api.contextstream.io`) |
|
|
294
|
-
| `CONTEXTSTREAM_API_KEY` | Yes* | API key (*required unless `CONTEXTSTREAM_JWT` is set) |
|
|
295
|
-
| `CONTEXTSTREAM_JWT` | Yes* | JWT (*required unless `CONTEXTSTREAM_API_KEY` is set) |
|
|
296
|
-
| `CONTEXTSTREAM_WORKSPACE_ID` | No | Default workspace ID fallback |
|
|
297
|
-
| `CONTEXTSTREAM_PROJECT_ID` | No | Default project ID fallback |
|
|
298
|
-
| `CONTEXTSTREAM_USER_AGENT` | No | Custom user agent string |
|
|
299
|
-
| `CONTEXTSTREAM_TOOLSET` | No | Tool bundle to expose: `light` (~30 tools), `standard` (default, ~50 tools), or `complete` (~86 tools). Claude Code/Desktop may warn about large tool contexts with `complete`. |
|
|
300
|
-
| `CONTEXTSTREAM_TOOL_ALLOWLIST` | No | Comma-separated tool names to expose (overrides toolset) |
|
|
301
|
-
| `CONTEXTSTREAM_PRO_TOOLS` | No | Comma-separated tool names treated as PRO (default: `ai_context,ai_enhanced_context,ai_context_budget,ai_embeddings,ai_plan,ai_tasks`) |
|
|
302
|
-
| `CONTEXTSTREAM_UPGRADE_URL` | No | Upgrade link shown when Free users call PRO tools (default: `https://contextstream.io/pricing`) |
|
|
303
|
-
|
|
304
|
-
### Server-side environment variables (API)
|
|
305
|
-
|
|
306
|
-
The following environment variables are configured on the ContextStream API server (not in your MCP client config):
|
|
307
|
-
|
|
308
|
-
| Variable | Required | Description |
|
|
309
|
-
|----------|----------|-------------|
|
|
310
|
-
| `QA_FILE_WRITE_ROOT` | No | Server-side root directory for `write_to_disk` file writes. When set, the API allows the `projects_ingest_local` tool to write ingested files to disk for testing/QA purposes. Files are written under `<QA_FILE_WRITE_ROOT>/<project_id>/<relative_path>`. If not set, `write_to_disk` requests are rejected. |
|
|
311
|
-
|
|
312
|
-
#### File write parameters for `projects_ingest_local`
|
|
313
|
-
|
|
314
|
-
The `projects_ingest_local` tool accepts two optional parameters for QA/testing scenarios:
|
|
315
|
-
|
|
316
|
-
| Parameter | Type | Default | Description |
|
|
317
|
-
|-----------|------|---------|-------------|
|
|
318
|
-
| `write_to_disk` | boolean | `false` | When `true`, writes ingested files to disk on the API server under `QA_FILE_WRITE_ROOT` before indexing. Requires the API to have `QA_FILE_WRITE_ROOT` configured. |
|
|
319
|
-
| `overwrite` | boolean | `false` | When `true` (and `write_to_disk` is enabled), allows overwriting existing files. Otherwise, existing files are skipped. |
|
|
320
|
-
|
|
321
|
-
**Example usage:**
|
|
322
|
-
```json
|
|
323
|
-
{
|
|
324
|
-
"path": "/path/to/local/project",
|
|
325
|
-
"write_to_disk": true,
|
|
326
|
-
"overwrite": false
|
|
327
|
-
}
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
**Note:** The `write_to_disk` feature is intended for testing, QA, and development scenarios where you need to materialize files on a test server. In production, `QA_FILE_WRITE_ROOT` should typically be unset to disable file writes.
|
|
331
|
-
|
|
332
|
-
## Usage patterns
|
|
333
|
-
|
|
334
|
-
### Recommended flow for AI tools
|
|
335
|
-
|
|
336
|
-
1. Start of a conversation: call `session_init(folder_path="...", context_hint="<first user message>")`
|
|
337
|
-
2. Before subsequent responses: call `context_smart(user_message="<current user message>")`
|
|
338
|
-
3. After important outcomes: call `session_capture(...)` or `session_capture_lesson(...)`
|
|
339
|
-
|
|
340
|
-
### Omit workspace/project IDs (recommended)
|
|
341
|
-
|
|
342
|
-
Most tools accept omitted `workspace_id` / `project_id` and will use the current session defaults.
|
|
343
|
-
|
|
344
|
-
- If you see “workspace_id is required”, call `session_init` first (or pass the ID explicitly).
|
|
345
|
-
- If you regularly work in the same repo, use `workspace_associate` once so the server can auto-select the right workspace for that folder.
|
|
346
|
-
|
|
347
|
-
### First-time setup (no workspaces yet)
|
|
348
|
-
|
|
349
|
-
If your account has no workspaces, ContextStream will prompt your AI assistant to ask you for a workspace name.
|
|
350
|
-
|
|
351
|
-
- Provide a workspace name (e.g., your company/team/product)
|
|
352
|
-
- The current folder is created as a project inside that workspace
|
|
353
|
-
- Recommended: call `workspace_bootstrap(workspace_name="...", folder_path="...")`
|
|
354
|
-
|
|
355
|
-
## Free vs PRO tools
|
|
356
|
-
|
|
357
|
-
Tools are labeled as `(Free)` or `(PRO)` in the MCP tool list.
|
|
358
|
-
|
|
359
|
-
- Default PRO tools: `ai_context`, `ai_enhanced_context`, `ai_context_budget`, `ai_embeddings`, `ai_plan`, `ai_tasks`
|
|
360
|
-
- If a Free-plan user calls a PRO tool, the server returns an upgrade message with a link.
|
|
361
|
-
- Override the PRO list via `CONTEXTSTREAM_PRO_TOOLS` and the upgrade link via `CONTEXTSTREAM_UPGRADE_URL`.
|
|
362
|
-
|
|
363
|
-
## Troubleshooting
|
|
364
|
-
|
|
365
|
-
- Tools not appearing: restart the client after editing MCP config; confirm Node 18+ is available to the client runtime.
|
|
366
|
-
- Unauthorized errors: verify `CONTEXTSTREAM_API_URL` and `CONTEXTSTREAM_API_KEY` (or `CONTEXTSTREAM_JWT`).
|
|
367
|
-
- Wrong workspace/project: use `workspace_associate` to map the current repo folder to the correct workspace.
|
|
368
|
-
|
|
369
|
-
## Development
|
|
370
|
-
|
|
371
|
-
```bash
|
|
372
|
-
git clone https://github.com/contextstream/mcp-server.git
|
|
373
|
-
cd mcp-server
|
|
374
|
-
npm install
|
|
375
|
-
npm run dev
|
|
376
|
-
npm run typecheck
|
|
377
|
-
npm run build
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
## Links
|
|
381
|
-
|
|
382
|
-
- Website: https://contextstream.io
|
|
383
|
-
- Docs: https://contextstream.io/docs/mcp
|
|
384
|
-
- Pricing: https://contextstream.io/pricing
|
|
385
|
-
- npm: https://www.npmjs.com/package/@contextstream/mcp-server
|
|
386
|
-
- GitHub: https://github.com/contextstream/mcp-server
|
|
387
|
-
|
|
388
|
-
## License
|
|
389
|
-
|
|
390
|
-
MIT
|
|
1
|
+
# ContextStream MCP Server
|
|
2
|
+
|
|
3
|
+
Persistent memory, semantic search, and code intelligence for any MCP-compatible AI tool.
|
|
4
|
+
|
|
5
|
+
ContextStream is a shared "brain" for your AI workflows. It stores decisions, preferences, and lessons, and lets your AI tools search and analyze your codebase with consistent context across sessions.
|
|
6
|
+
|
|
7
|
+
## Just Ask
|
|
8
|
+
|
|
9
|
+
**You don't need to memorize tool names.** Just describe what you want and your AI uses the right ContextStream tools automatically:
|
|
10
|
+
|
|
11
|
+
| You say... | ContextStream does... |
|
|
12
|
+
|------------|----------------------|
|
|
13
|
+
| "session summary" | Gets a summary of your workspace context |
|
|
14
|
+
| "what did we decide about auth?" | Recalls past decisions about authentication |
|
|
15
|
+
| "remember we're using PostgreSQL" | Saves this to memory for future sessions |
|
|
16
|
+
| "search for payment code" | Searches your codebase semantically |
|
|
17
|
+
| "what depends on UserService?" | Analyzes code dependencies |
|
|
18
|
+
|
|
19
|
+
No special syntax. No commands to learn. Just ask.
|
|
20
|
+
|
|
21
|
+
> **Tip:** For best results, add the [recommended editor rules](https://contextstream.io/docs/quickstart) so your AI consistently calls `session_init` / `context_smart` automatically.
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- Session-aware context loading (`session_init`, `context_smart`)
|
|
28
|
+
- Memory capture and recall (decisions, preferences, tasks, bugs, lessons)
|
|
29
|
+
- Code search (semantic, hybrid, keyword, pattern)
|
|
30
|
+
- Knowledge graph and code analysis (dependencies, impact, call paths, circular deps, unused code)
|
|
31
|
+
- Graph ingestion for full graph builds (`graph_ingest`)
|
|
32
|
+
- Local repo ingestion for indexing (`projects_ingest_local`)
|
|
33
|
+
- Auto-context: on the first tool call in a new session, the server can auto-initialize context
|
|
34
|
+
|
|
35
|
+
## Graph tiers
|
|
36
|
+
|
|
37
|
+
- **Pro (Graph-Lite):** module-level import graph, dependencies, and 1-hop impact
|
|
38
|
+
- **Elite/Team (Full Graph):** module + call + dataflow + type layers, plus `graph_ingest`
|
|
39
|
+
|
|
40
|
+
## Requirements
|
|
41
|
+
|
|
42
|
+
- Node.js 18+
|
|
43
|
+
- A ContextStream account and either an API key or a JWT
|
|
44
|
+
|
|
45
|
+
## Quickstart
|
|
46
|
+
|
|
47
|
+
### Setup wizard (recommended)
|
|
48
|
+
|
|
49
|
+
This interactive wizard sets up authentication, installs editor rules, and writes MCP config files for the tools you select.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx -y @contextstream/mcp-server setup
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Notes:
|
|
56
|
+
- Uses browser/device login by default and creates an API key for you.
|
|
57
|
+
- Prompts for **toolset selection**: `light` (~30 tools), `standard` (default, ~50 tools), or `complete` (~86 tools including workspaces, projects, search, memory, graph, AI, and integrations).
|
|
58
|
+
- To avoid re-auth prompts on subsequent runs, the wizard saves that API key to `~/.contextstream/credentials.json` (and also writes it into the MCP config files it generates). Delete that file to force a fresh login.
|
|
59
|
+
- Codex CLI MCP config is global-only (`~/.codex/config.toml`), so the wizard will always write Codex config globally when selected.
|
|
60
|
+
- Some tools still require UI/CLI-based MCP setup (the wizard will tell you when it can't write a config).
|
|
61
|
+
- Preview changes without writing files: `npx -y @contextstream/mcp-server setup --dry-run`
|
|
62
|
+
|
|
63
|
+
### Run the server
|
|
64
|
+
|
|
65
|
+
Run directly (recommended for MCP configs):
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npx -y @contextstream/mcp-server
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Or install globally:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm install -g @contextstream/mcp-server
|
|
75
|
+
contextstream-mcp
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Keeping updated
|
|
79
|
+
|
|
80
|
+
To get the latest features and bug fixes, update periodically:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
npm update -g @contextstream/mcp-server
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The MCP server will warn you when a newer version is available. After updating, restart your AI tool to use the new version.
|
|
87
|
+
|
|
88
|
+
## Configure your MCP client
|
|
89
|
+
|
|
90
|
+
### Manual setup
|
|
91
|
+
|
|
92
|
+
If you ran the [setup wizard](#setup-wizard-recommended), you can usually skip this section.
|
|
93
|
+
|
|
94
|
+
If you prefer to configure things by hand (or your tool can't be auto-configured), add the ContextStream MCP server to your client using one of the examples below.
|
|
95
|
+
|
|
96
|
+
**Toolset**: By default, the server exposes the `standard` toolset (~50 tools). Use `CONTEXTSTREAM_TOOLSET=light` to reduce tool count (~30 tools), or `CONTEXTSTREAM_TOOLSET=complete` to expose all ~86 tools (workspaces, projects, search, memory, graph, AI, integrations). See the [full tool catalog](https://contextstream.io/docs/mcp/tools).
|
|
97
|
+
|
|
98
|
+
### Cursor / Windsurf / Claude Desktop (JSON)
|
|
99
|
+
|
|
100
|
+
These clients use the `mcpServers` JSON schema:
|
|
101
|
+
|
|
102
|
+
- Cursor: `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project)
|
|
103
|
+
- Windsurf: `~/.codeium/windsurf/mcp_config.json`
|
|
104
|
+
- Claude Desktop:
|
|
105
|
+
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
106
|
+
- Windows: `%APPDATA%\\Claude\\claude_desktop_config.json`
|
|
107
|
+
|
|
108
|
+
Many other MCP JSON clients also use this same `mcpServers` shape (including Claude Code project scope via `.mcp.json`).
|
|
109
|
+
|
|
110
|
+
**Standard toolset (default, ~50 tools):**
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"mcpServers": {
|
|
115
|
+
"contextstream": {
|
|
116
|
+
"command": "npx",
|
|
117
|
+
"args": ["-y", "@contextstream/mcp-server"],
|
|
118
|
+
"env": {
|
|
119
|
+
"CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
|
|
120
|
+
"CONTEXTSTREAM_API_KEY": "your_api_key"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Complete toolset (~86 tools):**
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"mcpServers": {
|
|
132
|
+
"contextstream": {
|
|
133
|
+
"command": "npx",
|
|
134
|
+
"args": ["-y", "@contextstream/mcp-server"],
|
|
135
|
+
"env": {
|
|
136
|
+
"CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
|
|
137
|
+
"CONTEXTSTREAM_API_KEY": "your_api_key",
|
|
138
|
+
"CONTEXTSTREAM_TOOLSET": "complete"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### VS Code (`.vscode/mcp.json`)
|
|
146
|
+
|
|
147
|
+
VS Code uses a different schema with a top-level `servers` map:
|
|
148
|
+
|
|
149
|
+
**Core toolset (default):**
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"servers": {
|
|
154
|
+
"contextstream": {
|
|
155
|
+
"type": "stdio",
|
|
156
|
+
"command": "npx",
|
|
157
|
+
"args": ["-y", "@contextstream/mcp-server"],
|
|
158
|
+
"env": {
|
|
159
|
+
"CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
|
|
160
|
+
"CONTEXTSTREAM_API_KEY": "your_api_key"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Complete toolset (~86 tools):**
|
|
168
|
+
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"servers": {
|
|
172
|
+
"contextstream": {
|
|
173
|
+
"type": "stdio",
|
|
174
|
+
"command": "npx",
|
|
175
|
+
"args": ["-y", "@contextstream/mcp-server"],
|
|
176
|
+
"env": {
|
|
177
|
+
"CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
|
|
178
|
+
"CONTEXTSTREAM_API_KEY": "your_api_key",
|
|
179
|
+
"CONTEXTSTREAM_TOOLSET": "complete"
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Strong recommendation: VS Code supports `inputs` so you don’t have to hardcode secrets in a committed file:
|
|
187
|
+
|
|
188
|
+
```json
|
|
189
|
+
{
|
|
190
|
+
"servers": {
|
|
191
|
+
"contextstream": {
|
|
192
|
+
"type": "stdio",
|
|
193
|
+
"command": "npx",
|
|
194
|
+
"args": ["-y", "@contextstream/mcp-server"],
|
|
195
|
+
"env": {
|
|
196
|
+
"CONTEXTSTREAM_API_URL": "https://api.contextstream.io",
|
|
197
|
+
"CONTEXTSTREAM_API_KEY": "${input:contextstreamApiKey}"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"inputs": [
|
|
202
|
+
{
|
|
203
|
+
"id": "contextstreamApiKey",
|
|
204
|
+
"type": "promptString",
|
|
205
|
+
"description": "ContextStream API Key",
|
|
206
|
+
"password": true
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Claude Code (CLI)
|
|
213
|
+
|
|
214
|
+
User scope (all projects):
|
|
215
|
+
|
|
216
|
+
**Standard toolset (default):**
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
claude mcp add --transport stdio contextstream --scope user \
|
|
220
|
+
--env CONTEXTSTREAM_API_URL=https://api.contextstream.io \
|
|
221
|
+
--env CONTEXTSTREAM_API_KEY=YOUR_KEY \
|
|
222
|
+
-- npx -y @contextstream/mcp-server
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
**Complete toolset (~86 tools):**
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
claude mcp add --transport stdio contextstream --scope user \
|
|
229
|
+
--env CONTEXTSTREAM_API_URL=https://api.contextstream.io \
|
|
230
|
+
--env CONTEXTSTREAM_API_KEY=YOUR_KEY \
|
|
231
|
+
--env CONTEXTSTREAM_TOOLSET=complete \
|
|
232
|
+
-- npx -y @contextstream/mcp-server
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Note: Claude Code may warn about large tool contexts when using `complete`. The default is `standard` (~50 tools). Use `light` for fewer tools.
|
|
236
|
+
|
|
237
|
+
Windows caveat (native Windows, not WSL): if `npx` isn't found, use `cmd /c npx -y @contextstream/mcp-server` after `--`.
|
|
238
|
+
|
|
239
|
+
**Alternative (JSON form):**
|
|
240
|
+
|
|
241
|
+
Standard:
|
|
242
|
+
```bash
|
|
243
|
+
claude mcp add-json contextstream \
|
|
244
|
+
'{"type":"stdio","command":"npx","args":["-y","@contextstream/mcp-server"],"env":{"CONTEXTSTREAM_API_URL":"https://api.contextstream.io","CONTEXTSTREAM_API_KEY":"your_api_key"}}'
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Complete:
|
|
248
|
+
```bash
|
|
249
|
+
claude mcp add-json contextstream \
|
|
250
|
+
'{"type":"stdio","command":"npx","args":["-y","@contextstream/mcp-server"],"env":{"CONTEXTSTREAM_API_URL":"https://api.contextstream.io","CONTEXTSTREAM_API_KEY":"your_api_key","CONTEXTSTREAM_TOOLSET":"complete"}}'
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Codex CLI (`~/.codex/config.toml`)
|
|
254
|
+
|
|
255
|
+
**Standard toolset (default):**
|
|
256
|
+
|
|
257
|
+
```toml
|
|
258
|
+
[mcp_servers.contextstream]
|
|
259
|
+
command = "npx"
|
|
260
|
+
args = ["-y", "@contextstream/mcp-server"]
|
|
261
|
+
|
|
262
|
+
[mcp_servers.contextstream.env]
|
|
263
|
+
CONTEXTSTREAM_API_URL = "https://api.contextstream.io"
|
|
264
|
+
CONTEXTSTREAM_API_KEY = "your_api_key"
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
**Complete toolset (~86 tools):**
|
|
268
|
+
|
|
269
|
+
```toml
|
|
270
|
+
[mcp_servers.contextstream]
|
|
271
|
+
command = "npx"
|
|
272
|
+
args = ["-y", "@contextstream/mcp-server"]
|
|
273
|
+
|
|
274
|
+
[mcp_servers.contextstream.env]
|
|
275
|
+
CONTEXTSTREAM_API_URL = "https://api.contextstream.io"
|
|
276
|
+
CONTEXTSTREAM_API_KEY = "your_api_key"
|
|
277
|
+
CONTEXTSTREAM_TOOLSET = "complete"
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
After editing, restart your MCP client so it reloads the server configuration.
|
|
281
|
+
|
|
282
|
+
## Authentication
|
|
283
|
+
|
|
284
|
+
You can authenticate using either:
|
|
285
|
+
|
|
286
|
+
- `CONTEXTSTREAM_API_KEY` (recommended for local/dev)
|
|
287
|
+
- `CONTEXTSTREAM_JWT` (useful for hosted or user-session flows)
|
|
288
|
+
|
|
289
|
+
## Environment variables
|
|
290
|
+
|
|
291
|
+
| Variable | Required | Description |
|
|
292
|
+
|----------|----------|-------------|
|
|
293
|
+
| `CONTEXTSTREAM_API_URL` | Yes | Base API URL (e.g. `https://api.contextstream.io`) |
|
|
294
|
+
| `CONTEXTSTREAM_API_KEY` | Yes* | API key (*required unless `CONTEXTSTREAM_JWT` is set) |
|
|
295
|
+
| `CONTEXTSTREAM_JWT` | Yes* | JWT (*required unless `CONTEXTSTREAM_API_KEY` is set) |
|
|
296
|
+
| `CONTEXTSTREAM_WORKSPACE_ID` | No | Default workspace ID fallback |
|
|
297
|
+
| `CONTEXTSTREAM_PROJECT_ID` | No | Default project ID fallback |
|
|
298
|
+
| `CONTEXTSTREAM_USER_AGENT` | No | Custom user agent string |
|
|
299
|
+
| `CONTEXTSTREAM_TOOLSET` | No | Tool bundle to expose: `light` (~30 tools), `standard` (default, ~50 tools), or `complete` (~86 tools). Claude Code/Desktop may warn about large tool contexts with `complete`. |
|
|
300
|
+
| `CONTEXTSTREAM_TOOL_ALLOWLIST` | No | Comma-separated tool names to expose (overrides toolset) |
|
|
301
|
+
| `CONTEXTSTREAM_PRO_TOOLS` | No | Comma-separated tool names treated as PRO (default: `ai_context,ai_enhanced_context,ai_context_budget,ai_embeddings,ai_plan,ai_tasks`) |
|
|
302
|
+
| `CONTEXTSTREAM_UPGRADE_URL` | No | Upgrade link shown when Free users call PRO tools (default: `https://contextstream.io/pricing`) |
|
|
303
|
+
|
|
304
|
+
### Server-side environment variables (API)
|
|
305
|
+
|
|
306
|
+
The following environment variables are configured on the ContextStream API server (not in your MCP client config):
|
|
307
|
+
|
|
308
|
+
| Variable | Required | Description |
|
|
309
|
+
|----------|----------|-------------|
|
|
310
|
+
| `QA_FILE_WRITE_ROOT` | No | Server-side root directory for `write_to_disk` file writes. When set, the API allows the `projects_ingest_local` tool to write ingested files to disk for testing/QA purposes. Files are written under `<QA_FILE_WRITE_ROOT>/<project_id>/<relative_path>`. If not set, `write_to_disk` requests are rejected. |
|
|
311
|
+
|
|
312
|
+
#### File write parameters for `projects_ingest_local`
|
|
313
|
+
|
|
314
|
+
The `projects_ingest_local` tool accepts two optional parameters for QA/testing scenarios:
|
|
315
|
+
|
|
316
|
+
| Parameter | Type | Default | Description |
|
|
317
|
+
|-----------|------|---------|-------------|
|
|
318
|
+
| `write_to_disk` | boolean | `false` | When `true`, writes ingested files to disk on the API server under `QA_FILE_WRITE_ROOT` before indexing. Requires the API to have `QA_FILE_WRITE_ROOT` configured. |
|
|
319
|
+
| `overwrite` | boolean | `false` | When `true` (and `write_to_disk` is enabled), allows overwriting existing files. Otherwise, existing files are skipped. |
|
|
320
|
+
|
|
321
|
+
**Example usage:**
|
|
322
|
+
```json
|
|
323
|
+
{
|
|
324
|
+
"path": "/path/to/local/project",
|
|
325
|
+
"write_to_disk": true,
|
|
326
|
+
"overwrite": false
|
|
327
|
+
}
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
**Note:** The `write_to_disk` feature is intended for testing, QA, and development scenarios where you need to materialize files on a test server. In production, `QA_FILE_WRITE_ROOT` should typically be unset to disable file writes.
|
|
331
|
+
|
|
332
|
+
## Usage patterns
|
|
333
|
+
|
|
334
|
+
### Recommended flow for AI tools
|
|
335
|
+
|
|
336
|
+
1. Start of a conversation: call `session_init(folder_path="...", context_hint="<first user message>")`
|
|
337
|
+
2. Before subsequent responses: call `context_smart(user_message="<current user message>")`
|
|
338
|
+
3. After important outcomes: call `session_capture(...)` or `session_capture_lesson(...)`
|
|
339
|
+
|
|
340
|
+
### Omit workspace/project IDs (recommended)
|
|
341
|
+
|
|
342
|
+
Most tools accept omitted `workspace_id` / `project_id` and will use the current session defaults.
|
|
343
|
+
|
|
344
|
+
- If you see “workspace_id is required”, call `session_init` first (or pass the ID explicitly).
|
|
345
|
+
- If you regularly work in the same repo, use `workspace_associate` once so the server can auto-select the right workspace for that folder.
|
|
346
|
+
|
|
347
|
+
### First-time setup (no workspaces yet)
|
|
348
|
+
|
|
349
|
+
If your account has no workspaces, ContextStream will prompt your AI assistant to ask you for a workspace name.
|
|
350
|
+
|
|
351
|
+
- Provide a workspace name (e.g., your company/team/product)
|
|
352
|
+
- The current folder is created as a project inside that workspace
|
|
353
|
+
- Recommended: call `workspace_bootstrap(workspace_name="...", folder_path="...")`
|
|
354
|
+
|
|
355
|
+
## Free vs PRO tools
|
|
356
|
+
|
|
357
|
+
Tools are labeled as `(Free)` or `(PRO)` in the MCP tool list.
|
|
358
|
+
|
|
359
|
+
- Default PRO tools: `ai_context`, `ai_enhanced_context`, `ai_context_budget`, `ai_embeddings`, `ai_plan`, `ai_tasks`
|
|
360
|
+
- If a Free-plan user calls a PRO tool, the server returns an upgrade message with a link.
|
|
361
|
+
- Override the PRO list via `CONTEXTSTREAM_PRO_TOOLS` and the upgrade link via `CONTEXTSTREAM_UPGRADE_URL`.
|
|
362
|
+
|
|
363
|
+
## Troubleshooting
|
|
364
|
+
|
|
365
|
+
- Tools not appearing: restart the client after editing MCP config; confirm Node 18+ is available to the client runtime.
|
|
366
|
+
- Unauthorized errors: verify `CONTEXTSTREAM_API_URL` and `CONTEXTSTREAM_API_KEY` (or `CONTEXTSTREAM_JWT`).
|
|
367
|
+
- Wrong workspace/project: use `workspace_associate` to map the current repo folder to the correct workspace.
|
|
368
|
+
|
|
369
|
+
## Development
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
git clone https://github.com/contextstream/mcp-server.git
|
|
373
|
+
cd mcp-server
|
|
374
|
+
npm install
|
|
375
|
+
npm run dev
|
|
376
|
+
npm run typecheck
|
|
377
|
+
npm run build
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
## Links
|
|
381
|
+
|
|
382
|
+
- Website: https://contextstream.io
|
|
383
|
+
- Docs: https://contextstream.io/docs/mcp
|
|
384
|
+
- Pricing: https://contextstream.io/pricing
|
|
385
|
+
- npm: https://www.npmjs.com/package/@contextstream/mcp-server
|
|
386
|
+
- GitHub: https://github.com/contextstream/mcp-server
|
|
387
|
+
|
|
388
|
+
## License
|
|
389
|
+
|
|
390
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
'#!/usr/bin/env node'
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __export = (target, all) => {
|
|
4
4
|
for (var name in all)
|
|
@@ -6018,6 +6018,8 @@ var ContextStreamClient = class {
|
|
|
6018
6018
|
event_type: apiEventType,
|
|
6019
6019
|
title: params.title,
|
|
6020
6020
|
content: params.content,
|
|
6021
|
+
provenance: params.provenance,
|
|
6022
|
+
code_refs: params.code_refs,
|
|
6021
6023
|
metadata: {
|
|
6022
6024
|
original_type: params.event_type,
|
|
6023
6025
|
session_id: params.session_id,
|
|
@@ -6028,6 +6030,14 @@ var ContextStreamClient = class {
|
|
|
6028
6030
|
}
|
|
6029
6031
|
});
|
|
6030
6032
|
}
|
|
6033
|
+
submitContextFeedback(body) {
|
|
6034
|
+
return request(this.config, "/context/smart/feedback", { body: this.withDefaults(body) });
|
|
6035
|
+
}
|
|
6036
|
+
decisionTrace(body) {
|
|
6037
|
+
return request(this.config, "/memory/search/decisions/trace", {
|
|
6038
|
+
body: this.withDefaults(body)
|
|
6039
|
+
});
|
|
6040
|
+
}
|
|
6031
6041
|
/**
|
|
6032
6042
|
* Remember something using the session/remember endpoint.
|
|
6033
6043
|
* This is a simpler interface than captureContext and supports await_indexing.
|
|
@@ -7282,6 +7292,7 @@ var CONTEXTSTREAM_TOOL_NAMES = [
|
|
|
7282
7292
|
// Session/Context (standard)
|
|
7283
7293
|
"session_init",
|
|
7284
7294
|
"context_smart",
|
|
7295
|
+
"context_feedback",
|
|
7285
7296
|
"session_summary",
|
|
7286
7297
|
"session_capture",
|
|
7287
7298
|
"session_capture_lesson",
|
|
@@ -7331,6 +7342,7 @@ var CONTEXTSTREAM_TOOL_NAMES = [
|
|
|
7331
7342
|
"memory_list_nodes",
|
|
7332
7343
|
"memory_search",
|
|
7333
7344
|
"memory_decisions",
|
|
7345
|
+
"decision_trace",
|
|
7334
7346
|
"memory_get_event",
|
|
7335
7347
|
"memory_update_event",
|
|
7336
7348
|
"memory_delete_event",
|
|
@@ -7498,7 +7510,7 @@ To expose all tools below, set \`CONTEXTSTREAM_TOOLSET=complete\` in your MCP co
|
|
|
7498
7510
|
**Available tool categories (when \`CONTEXTSTREAM_TOOLSET=complete\`):**
|
|
7499
7511
|
|
|
7500
7512
|
**Session/Context** (included in standard):
|
|
7501
|
-
\`session_init\`, \`context_smart\`, \`session_summary\`, \`session_capture\`, \`session_capture_lesson\`, \`session_get_lessons\`, \`session_recall\`, \`session_remember\`, \`session_get_user_context\`, \`session_smart_search\`, \`session_compress\`, \`session_delta\`, \`generate_editor_rules\`, \`workspace_associate\`, \`workspace_bootstrap\`
|
|
7513
|
+
\`session_init\`, \`context_smart\`, \`context_feedback\`, \`session_summary\`, \`session_capture\`, \`session_capture_lesson\`, \`session_get_lessons\`, \`session_recall\`, \`session_remember\`, \`session_get_user_context\`, \`session_smart_search\`, \`session_compress\`, \`session_delta\`, \`generate_editor_rules\`, \`workspace_associate\`, \`workspace_bootstrap\`
|
|
7502
7514
|
|
|
7503
7515
|
**Workspaces**:
|
|
7504
7516
|
\`workspaces_list\`, \`workspaces_create\`, \`workspaces_update\`, \`workspaces_delete\`, \`workspaces_get\`, \`workspaces_overview\`, \`workspaces_analytics\`, \`workspaces_content\`
|
|
@@ -7510,7 +7522,7 @@ To expose all tools below, set \`CONTEXTSTREAM_TOOLSET=complete\` in your MCP co
|
|
|
7510
7522
|
\`search_semantic\`, \`search_hybrid\`, \`search_keyword\`, \`search_pattern\`, \`search_suggestions\`
|
|
7511
7523
|
|
|
7512
7524
|
**Memory**:
|
|
7513
|
-
\`memory_create_event\`, \`memory_bulk_ingest\`, \`memory_list_events\`, \`memory_create_node\`, \`memory_list_nodes\`, \`memory_search\`, \`memory_decisions\`, \`memory_get_event\`, \`memory_update_event\`, \`memory_delete_event\`, \`memory_distill_event\`, \`memory_get_node\`, \`memory_update_node\`, \`memory_delete_node\`, \`memory_supersede_node\`, \`memory_timeline\`, \`memory_summary\`
|
|
7525
|
+
\`memory_create_event\`, \`memory_bulk_ingest\`, \`memory_list_events\`, \`memory_create_node\`, \`memory_list_nodes\`, \`memory_search\`, \`memory_decisions\`, \`decision_trace\`, \`memory_get_event\`, \`memory_update_event\`, \`memory_delete_event\`, \`memory_distill_event\`, \`memory_get_node\`, \`memory_update_node\`, \`memory_delete_node\`, \`memory_supersede_node\`, \`memory_timeline\`, \`memory_summary\`
|
|
7514
7526
|
|
|
7515
7527
|
**Graph** (code analysis):
|
|
7516
7528
|
\`graph_related\`, \`graph_path\`, \`graph_decisions\`, \`graph_dependencies\`, \`graph_call_path\`, \`graph_impact\`, \`graph_circular_dependencies\`, \`graph_unused_code\`, \`graph_ingest\`, \`graph_contradictions\`
|
|
@@ -7862,6 +7874,7 @@ var WRITE_VERBS = /* @__PURE__ */ new Set([
|
|
|
7862
7874
|
"add",
|
|
7863
7875
|
"remove",
|
|
7864
7876
|
"revoke",
|
|
7877
|
+
"feedback",
|
|
7865
7878
|
"upload",
|
|
7866
7879
|
"compress",
|
|
7867
7880
|
"init"
|
|
@@ -7885,6 +7898,7 @@ var READ_ONLY_OVERRIDES = /* @__PURE__ */ new Set([
|
|
|
7885
7898
|
"workspaces_get",
|
|
7886
7899
|
"memory_search",
|
|
7887
7900
|
"memory_decisions",
|
|
7901
|
+
"decision_trace",
|
|
7888
7902
|
"memory_get_event",
|
|
7889
7903
|
"memory_list_events",
|
|
7890
7904
|
"memory_list_nodes",
|
|
@@ -8028,6 +8042,7 @@ var LIGHT_TOOLSET = /* @__PURE__ */ new Set([
|
|
|
8028
8042
|
"session_init",
|
|
8029
8043
|
"session_tools",
|
|
8030
8044
|
"context_smart",
|
|
8045
|
+
"context_feedback",
|
|
8031
8046
|
"session_summary",
|
|
8032
8047
|
"session_capture",
|
|
8033
8048
|
"session_capture_lesson",
|
|
@@ -8104,6 +8119,7 @@ var STANDARD_TOOLSET = /* @__PURE__ */ new Set([
|
|
|
8104
8119
|
// Memory events (9)
|
|
8105
8120
|
"memory_search",
|
|
8106
8121
|
"memory_decisions",
|
|
8122
|
+
"decision_trace",
|
|
8107
8123
|
"memory_create_event",
|
|
8108
8124
|
"memory_list_events",
|
|
8109
8125
|
"memory_get_event",
|
|
@@ -8807,7 +8823,22 @@ Access: Free`,
|
|
|
8807
8823
|
event_type: external_exports.string(),
|
|
8808
8824
|
title: external_exports.string(),
|
|
8809
8825
|
content: external_exports.string(),
|
|
8810
|
-
metadata: external_exports.record(external_exports.any()).optional()
|
|
8826
|
+
metadata: external_exports.record(external_exports.any()).optional(),
|
|
8827
|
+
provenance: external_exports.object({
|
|
8828
|
+
repo: external_exports.string().optional(),
|
|
8829
|
+
branch: external_exports.string().optional(),
|
|
8830
|
+
commit_sha: external_exports.string().optional(),
|
|
8831
|
+
pr_url: external_exports.string().url().optional(),
|
|
8832
|
+
issue_url: external_exports.string().url().optional(),
|
|
8833
|
+
slack_thread_url: external_exports.string().url().optional()
|
|
8834
|
+
}).optional(),
|
|
8835
|
+
code_refs: external_exports.array(
|
|
8836
|
+
external_exports.object({
|
|
8837
|
+
file_path: external_exports.string(),
|
|
8838
|
+
symbol_id: external_exports.string().optional(),
|
|
8839
|
+
symbol_name: external_exports.string().optional()
|
|
8840
|
+
})
|
|
8841
|
+
).optional()
|
|
8811
8842
|
})
|
|
8812
8843
|
},
|
|
8813
8844
|
async (input) => {
|
|
@@ -8921,6 +8952,24 @@ Access: Free`,
|
|
|
8921
8952
|
return { content: [{ type: "text", text: formatContent(result) }], structuredContent: toStructured(result) };
|
|
8922
8953
|
}
|
|
8923
8954
|
);
|
|
8955
|
+
registerTool(
|
|
8956
|
+
"decision_trace",
|
|
8957
|
+
{
|
|
8958
|
+
title: "Decision trace",
|
|
8959
|
+
description: "Trace decisions to provenance, code references, and impact",
|
|
8960
|
+
inputSchema: external_exports.object({
|
|
8961
|
+
query: external_exports.string(),
|
|
8962
|
+
workspace_id: external_exports.string().uuid().optional(),
|
|
8963
|
+
project_id: external_exports.string().uuid().optional(),
|
|
8964
|
+
limit: external_exports.number().optional(),
|
|
8965
|
+
include_impact: external_exports.boolean().optional().describe("Include impact analysis when graph data is available")
|
|
8966
|
+
})
|
|
8967
|
+
},
|
|
8968
|
+
async (input) => {
|
|
8969
|
+
const result = await client.decisionTrace(input);
|
|
8970
|
+
return { content: [{ type: "text", text: formatContent(result) }], structuredContent: toStructured(result) };
|
|
8971
|
+
}
|
|
8972
|
+
);
|
|
8924
8973
|
registerTool(
|
|
8925
8974
|
"graph_related",
|
|
8926
8975
|
{
|
|
@@ -9942,7 +9991,22 @@ Use this to persist decisions, insights, preferences, or important information.`
|
|
|
9942
9991
|
title: external_exports.string().describe("Brief title for the captured context"),
|
|
9943
9992
|
content: external_exports.string().describe("Full content/details to capture"),
|
|
9944
9993
|
tags: external_exports.array(external_exports.string()).optional().describe("Tags for categorization"),
|
|
9945
|
-
importance: external_exports.enum(["low", "medium", "high", "critical"]).optional().describe("Importance level")
|
|
9994
|
+
importance: external_exports.enum(["low", "medium", "high", "critical"]).optional().describe("Importance level"),
|
|
9995
|
+
provenance: external_exports.object({
|
|
9996
|
+
repo: external_exports.string().optional(),
|
|
9997
|
+
branch: external_exports.string().optional(),
|
|
9998
|
+
commit_sha: external_exports.string().optional(),
|
|
9999
|
+
pr_url: external_exports.string().url().optional(),
|
|
10000
|
+
issue_url: external_exports.string().url().optional(),
|
|
10001
|
+
slack_thread_url: external_exports.string().url().optional()
|
|
10002
|
+
}).optional(),
|
|
10003
|
+
code_refs: external_exports.array(
|
|
10004
|
+
external_exports.object({
|
|
10005
|
+
file_path: external_exports.string(),
|
|
10006
|
+
symbol_id: external_exports.string().optional(),
|
|
10007
|
+
symbol_name: external_exports.string().optional()
|
|
10008
|
+
})
|
|
10009
|
+
).optional()
|
|
9946
10010
|
})
|
|
9947
10011
|
},
|
|
9948
10012
|
async (input) => {
|
|
@@ -10604,6 +10668,42 @@ This saves ~80% tokens compared to including full chat history.`,
|
|
|
10604
10668
|
};
|
|
10605
10669
|
}
|
|
10606
10670
|
);
|
|
10671
|
+
registerTool(
|
|
10672
|
+
"context_feedback",
|
|
10673
|
+
{
|
|
10674
|
+
title: "Submit smart context feedback",
|
|
10675
|
+
description: "Send relevance feedback (relevant/irrelevant/pin) for context_smart items.",
|
|
10676
|
+
inputSchema: external_exports.object({
|
|
10677
|
+
workspace_id: external_exports.string().uuid().optional(),
|
|
10678
|
+
project_id: external_exports.string().uuid().optional(),
|
|
10679
|
+
item_id: external_exports.string().describe("Item ID returned by context_smart"),
|
|
10680
|
+
item_type: external_exports.enum(["memory_event", "knowledge_node", "code_chunk"]),
|
|
10681
|
+
feedback_type: external_exports.enum(["relevant", "irrelevant", "pin"]),
|
|
10682
|
+
query_text: external_exports.string().optional(),
|
|
10683
|
+
metadata: external_exports.record(external_exports.any()).optional()
|
|
10684
|
+
})
|
|
10685
|
+
},
|
|
10686
|
+
async (input) => {
|
|
10687
|
+
let workspaceId = input.workspace_id;
|
|
10688
|
+
let projectId = input.project_id;
|
|
10689
|
+
if (!workspaceId && sessionManager) {
|
|
10690
|
+
const ctx = sessionManager.getContext();
|
|
10691
|
+
if (ctx) {
|
|
10692
|
+
workspaceId = ctx.workspace_id;
|
|
10693
|
+
projectId = projectId || ctx.project_id;
|
|
10694
|
+
}
|
|
10695
|
+
}
|
|
10696
|
+
const result = await client.submitContextFeedback({
|
|
10697
|
+
...input,
|
|
10698
|
+
workspace_id: workspaceId,
|
|
10699
|
+
project_id: projectId
|
|
10700
|
+
});
|
|
10701
|
+
return {
|
|
10702
|
+
content: [{ type: "text", text: formatContent(result) }],
|
|
10703
|
+
structuredContent: toStructured(result)
|
|
10704
|
+
};
|
|
10705
|
+
}
|
|
10706
|
+
);
|
|
10607
10707
|
registerTool(
|
|
10608
10708
|
"slack_stats",
|
|
10609
10709
|
{
|
package/package.json
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@contextstream/mcp-server",
|
|
3
|
-
"mcpName": "io.github.contextstreamio/mcp-server",
|
|
4
|
-
"version": "0.3.
|
|
5
|
-
"description": "MCP server exposing ContextStream public API - code context, memory, search, and AI tools for developers",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"main": "dist/index.js",
|
|
9
|
-
"files": [
|
|
10
|
-
"dist",
|
|
11
|
-
"README.md"
|
|
12
|
-
],
|
|
13
|
-
"bin": {
|
|
14
|
-
"contextstream-mcp": "dist/index.js"
|
|
15
|
-
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"dev": "tsx src/index.ts",
|
|
18
|
-
"build": "esbuild src/index.ts --bundle --platform=node --target=node18 --outfile=dist/index.js --format=esm --external:@modelcontextprotocol/sdk && echo '#!/usr/bin/env node' | cat - dist/index.js > dist/index.tmp && mv dist/index.tmp dist/index.js && esbuild src/test-server.ts --bundle --platform=node --target=node18 --outfile=dist/test-server.js --format=esm --external:@modelcontextprotocol/sdk",
|
|
19
|
-
"start": "node dist/index.js",
|
|
20
|
-
"test-server": "tsx src/test-server.ts",
|
|
21
|
-
"test-server:start": "node dist/test-server.js",
|
|
22
|
-
"typecheck": "tsc --noEmit"
|
|
23
|
-
},
|
|
24
|
-
"dependencies": {
|
|
25
|
-
"@modelcontextprotocol/sdk": "^1.22.0",
|
|
26
|
-
"zod": "^3.23.8"
|
|
27
|
-
},
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"@types/node": "^20.10.0",
|
|
30
|
-
"esbuild": "^0.27.0",
|
|
31
|
-
"tsx": "^4.15.4",
|
|
32
|
-
"typescript": "^5.6.3"
|
|
33
|
-
},
|
|
34
|
-
"engines": {
|
|
35
|
-
"node": ">=18"
|
|
36
|
-
},
|
|
37
|
-
"keywords": [
|
|
38
|
-
"mcp",
|
|
39
|
-
"model-context-protocol",
|
|
40
|
-
"contextstream",
|
|
41
|
-
"ai",
|
|
42
|
-
"code-context",
|
|
43
|
-
"memory",
|
|
44
|
-
"knowledge-graph"
|
|
45
|
-
],
|
|
46
|
-
"repository": {
|
|
47
|
-
"type": "git",
|
|
48
|
-
"url": "git+https://github.com/contextstream/mcp-server.git"
|
|
49
|
-
},
|
|
50
|
-
"homepage": "https://contextstream.io/docs/mcp",
|
|
51
|
-
"bugs": {
|
|
52
|
-
"url": "https://github.com/contextstream/mcp-server/issues"
|
|
53
|
-
},
|
|
54
|
-
"overrides": {
|
|
55
|
-
"qs": "6.14.1"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@contextstream/mcp-server",
|
|
3
|
+
"mcpName": "io.github.contextstreamio/mcp-server",
|
|
4
|
+
"version": "0.3.68",
|
|
5
|
+
"description": "MCP server exposing ContextStream public API - code context, memory, search, and AI tools for developers",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"bin": {
|
|
14
|
+
"contextstream-mcp": "dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"dev": "tsx src/index.ts",
|
|
18
|
+
"build": "esbuild src/index.ts --bundle --platform=node --target=node18 --outfile=dist/index.js --format=esm --external:@modelcontextprotocol/sdk && echo '#!/usr/bin/env node' | cat - dist/index.js > dist/index.tmp && mv dist/index.tmp dist/index.js && esbuild src/test-server.ts --bundle --platform=node --target=node18 --outfile=dist/test-server.js --format=esm --external:@modelcontextprotocol/sdk",
|
|
19
|
+
"start": "node dist/index.js",
|
|
20
|
+
"test-server": "tsx src/test-server.ts",
|
|
21
|
+
"test-server:start": "node dist/test-server.js",
|
|
22
|
+
"typecheck": "tsc --noEmit"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@modelcontextprotocol/sdk": "^1.22.0",
|
|
26
|
+
"zod": "^3.23.8"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/node": "^20.10.0",
|
|
30
|
+
"esbuild": "^0.27.0",
|
|
31
|
+
"tsx": "^4.15.4",
|
|
32
|
+
"typescript": "^5.6.3"
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=18"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"mcp",
|
|
39
|
+
"model-context-protocol",
|
|
40
|
+
"contextstream",
|
|
41
|
+
"ai",
|
|
42
|
+
"code-context",
|
|
43
|
+
"memory",
|
|
44
|
+
"knowledge-graph"
|
|
45
|
+
],
|
|
46
|
+
"repository": {
|
|
47
|
+
"type": "git",
|
|
48
|
+
"url": "git+https://github.com/contextstream/mcp-server.git"
|
|
49
|
+
},
|
|
50
|
+
"homepage": "https://contextstream.io/docs/mcp",
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/contextstream/mcp-server/issues"
|
|
53
|
+
},
|
|
54
|
+
"overrides": {
|
|
55
|
+
"qs": "6.14.1"
|
|
56
|
+
}
|
|
57
|
+
}
|