@philau2512/fast-context-mcp 1.5.3 → 1.5.4
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 +1 -1
- package/README.md +67 -23
- package/package.json +4 -1
- package/scripts/link-local-bin.mjs +5 -5
- package/src/server.mjs +12 -4
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
AI-driven semantic code search as an MCP tool — powered by Windsurf's reverse-engineered SWE-grep protocol.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
**Repository:** [github.com/philau2512/devin-fast-context-mcp](https://github.com/philau2512/devin-fast-context-mcp)
|
|
6
|
+
**npm package:** `@philau2512/devin-fast-context-mcp`
|
|
7
|
+
**CLI binary:** `fast-context-mcp`
|
|
8
|
+
|
|
9
|
+
Thank to: https://github.com/awei84/fast-context-mcp and https://github.com/SammySnake-d/fast-context-mcp
|
|
10
|
+
|
|
11
|
+
Based on the open-source Fast Context MCP lineage (SammySnake / awei84 and contributors), with continued maintenance here.
|
|
7
12
|
|
|
8
13
|
Any MCP-compatible client (Claude Code, Claude Desktop, Cursor, etc.) can use this to search codebases with natural language queries. All tools are bundled via npm — **no system-level dependencies** needed (ripgrep via `@vscode/ripgrep`, tree via Node.js `fs`). Works on macOS, Windows, and Linux.
|
|
9
14
|
|
|
@@ -46,26 +51,28 @@ No need to install ripgrep — it's bundled via `@vscode/ripgrep`.
|
|
|
46
51
|
|
|
47
52
|
## Installation
|
|
48
53
|
|
|
49
|
-
### Option A:
|
|
54
|
+
### Option A: npm (after publish)
|
|
50
55
|
|
|
51
56
|
```bash
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
npx -y @philau2512/fast-context-mcp
|
|
58
|
+
# or
|
|
59
|
+
npm install -g @philau2512/fast-context-mcp
|
|
54
60
|
```
|
|
55
61
|
|
|
56
|
-
|
|
62
|
+
> Package name is **scoped** (`@philau2512/...`) so it does not conflict with the community `fast-context-mcp` package on npm.
|
|
63
|
+
|
|
64
|
+
### Option B: from GitHub (no npm publish required)
|
|
57
65
|
|
|
58
66
|
```bash
|
|
59
|
-
|
|
60
|
-
cd fast-context-mcp
|
|
61
|
-
npm install
|
|
67
|
+
npx -y github:philau2512/fast-context-mcp
|
|
62
68
|
```
|
|
63
69
|
|
|
64
|
-
### Option C:
|
|
70
|
+
### Option C: clone from source
|
|
65
71
|
|
|
66
72
|
```bash
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
git clone https://github.com/philau2512/fast-context-mcp.git
|
|
74
|
+
cd fast-context-mcp
|
|
75
|
+
npm install
|
|
69
76
|
```
|
|
70
77
|
|
|
71
78
|
## Setup
|
|
@@ -92,6 +99,25 @@ On WSL/Linux, if a Windows-extracted key returns **403**, run `devin login` insi
|
|
|
92
99
|
|
|
93
100
|
Add to Cursor MCP settings (`mcp.json`):
|
|
94
101
|
|
|
102
|
+
`WINDSURF_API_KEY` is **optional** if Devin / Windsurf is installed and logged in on this machine (auto-extract from local SQLite). Set it only when auto-discovery fails or you want a fixed key.
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"mcpServers": {
|
|
107
|
+
"fast-context": {
|
|
108
|
+
"command": "npx",
|
|
109
|
+
"args": ["-y", "@philau2512/fast-context-mcp"],
|
|
110
|
+
"env": {
|
|
111
|
+
"WINDSURF_API_KEY": "sk-ws-01-xxxxx",
|
|
112
|
+
"FC_HIDE_EXTRACT_WINDSURF_KEY_TOOL": "1"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Before npm publish, use GitHub:
|
|
120
|
+
|
|
95
121
|
```json
|
|
96
122
|
{
|
|
97
123
|
"mcpServers": {
|
|
@@ -99,6 +125,7 @@ Add to Cursor MCP settings (`mcp.json`):
|
|
|
99
125
|
"command": "npx",
|
|
100
126
|
"args": ["-y", "github:philau2512/fast-context-mcp"],
|
|
101
127
|
"env": {
|
|
128
|
+
"WINDSURF_API_KEY": "sk-ws-01-xxxxx",
|
|
102
129
|
"FC_HIDE_EXTRACT_WINDSURF_KEY_TOOL": "1"
|
|
103
130
|
}
|
|
104
131
|
}
|
|
@@ -115,6 +142,7 @@ From a local clone (dev):
|
|
|
115
142
|
"command": "node",
|
|
116
143
|
"args": ["C:/path/to/fast-context-mcp/src/server.mjs"],
|
|
117
144
|
"env": {
|
|
145
|
+
"WINDSURF_API_KEY": "sk-ws-01-xxxxx",
|
|
118
146
|
"FC_HIDE_EXTRACT_WINDSURF_KEY_TOOL": "1"
|
|
119
147
|
}
|
|
120
148
|
}
|
|
@@ -124,15 +152,16 @@ From a local clone (dev):
|
|
|
124
152
|
|
|
125
153
|
#### Claude Code
|
|
126
154
|
|
|
127
|
-
Add to `~/.claude.json` under `mcpServers
|
|
155
|
+
Add to `~/.claude.json` under `mcpServers` (same env rules as Cursor):
|
|
128
156
|
|
|
129
157
|
```json
|
|
130
158
|
{
|
|
131
159
|
"fast-context": {
|
|
132
160
|
"command": "npx",
|
|
133
|
-
"args": ["-y", "
|
|
161
|
+
"args": ["-y", "@philau2512/fast-context-mcp"],
|
|
134
162
|
"env": {
|
|
135
|
-
"WINDSURF_API_KEY": "sk-ws-01-xxxxx"
|
|
163
|
+
"WINDSURF_API_KEY": "sk-ws-01-xxxxx",
|
|
164
|
+
"FC_HIDE_EXTRACT_WINDSURF_KEY_TOOL": "1"
|
|
136
165
|
}
|
|
137
166
|
}
|
|
138
167
|
}
|
|
@@ -146,7 +175,8 @@ Or if installed from source:
|
|
|
146
175
|
"command": "node",
|
|
147
176
|
"args": ["/absolute/path/to/fast-context-mcp/src/server.mjs"],
|
|
148
177
|
"env": {
|
|
149
|
-
"WINDSURF_API_KEY": "sk-ws-01-xxxxx"
|
|
178
|
+
"WINDSURF_API_KEY": "sk-ws-01-xxxxx",
|
|
179
|
+
"FC_HIDE_EXTRACT_WINDSURF_KEY_TOOL": "1"
|
|
150
180
|
}
|
|
151
181
|
}
|
|
152
182
|
}
|
|
@@ -160,15 +190,16 @@ Add to `claude_desktop_config.json` under `mcpServers`:
|
|
|
160
190
|
{
|
|
161
191
|
"fast-context": {
|
|
162
192
|
"command": "npx",
|
|
163
|
-
"args": ["-y", "
|
|
193
|
+
"args": ["-y", "@philau2512/fast-context-mcp"],
|
|
164
194
|
"env": {
|
|
165
|
-
"WINDSURF_API_KEY": "sk-ws-01-xxxxx"
|
|
195
|
+
"WINDSURF_API_KEY": "sk-ws-01-xxxxx",
|
|
196
|
+
"FC_HIDE_EXTRACT_WINDSURF_KEY_TOOL": "1"
|
|
166
197
|
}
|
|
167
198
|
}
|
|
168
199
|
}
|
|
169
200
|
```
|
|
170
201
|
|
|
171
|
-
>
|
|
202
|
+
> You can omit `WINDSURF_API_KEY` entirely when local Windsurf / Devin login works. You can omit `FC_HIDE_EXTRACT_WINDSURF_KEY_TOOL` if you want the `extract_windsurf_key` tool visible.
|
|
172
203
|
|
|
173
204
|
## Environment Variables
|
|
174
205
|
|
|
@@ -261,13 +292,19 @@ Set `FC_HIDE_EXTRACT_WINDSURF_KEY_TOOL=1` at MCP server startup to hide this too
|
|
|
261
292
|
|
|
262
293
|
```
|
|
263
294
|
fast-context-mcp/
|
|
264
|
-
├── package.json
|
|
295
|
+
├── package.json # @philau2512/fast-context-mcp
|
|
265
296
|
├── src/
|
|
266
297
|
│ ├── server.mjs # MCP server entry point
|
|
267
298
|
│ ├── core.mjs # Auth, message building, streaming, search loop
|
|
299
|
+
│ ├── directory-scorer.mjs
|
|
268
300
|
│ ├── executor.mjs # Tool executor: rg, readfile, tree, ls, glob
|
|
269
|
-
│ ├── extract-key.mjs # Windsurf API
|
|
270
|
-
│
|
|
301
|
+
│ ├── extract-key.mjs # Windsurf / Devin API key extraction
|
|
302
|
+
│ ├── project-path.mjs
|
|
303
|
+
│ ├── protobuf.mjs # Protobuf encoder/decoder + Connect-RPC frames
|
|
304
|
+
│ └── tree.mjs
|
|
305
|
+
├── scripts/
|
|
306
|
+
│ └── link-local-bin.mjs
|
|
307
|
+
├── tests/
|
|
271
308
|
├── README.md
|
|
272
309
|
└── LICENSE
|
|
273
310
|
```
|
|
@@ -298,9 +335,16 @@ fast-context-mcp/
|
|
|
298
335
|
|---------|---------|
|
|
299
336
|
| `@modelcontextprotocol/sdk` | MCP server framework |
|
|
300
337
|
| `@vscode/ripgrep` | Bundled ripgrep binary (cross-platform) |
|
|
301
|
-
| `sql.js` | Read Windsurf
|
|
338
|
+
| `sql.js` | Read Windsurf / Devin local SQLite DB |
|
|
339
|
+
| `scule` | String utilities |
|
|
302
340
|
| `zod` | Schema validation (MCP SDK requirement) |
|
|
303
341
|
|
|
342
|
+
## Publishing
|
|
343
|
+
|
|
344
|
+
- **GitHub:** push to https://github.com/philau2512/fast-context-mcp
|
|
345
|
+
- **npm:** `npm publish --access public` (package `@philau2512/fast-context-mcp`; requires OTP/2FA)
|
|
346
|
+
- Bare name `fast-context-mcp` on npm is owned by another maintainer — do not publish under that name.
|
|
347
|
+
|
|
304
348
|
## License
|
|
305
349
|
|
|
306
350
|
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@philau2512/fast-context-mcp",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"description": "AI-driven semantic code search MCP server (Node.js) — Windsurf/Devin protocol",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/server.mjs",
|
|
@@ -49,5 +49,8 @@
|
|
|
49
49
|
"sql.js": "^1.14.0",
|
|
50
50
|
"zod": "^3.23.0"
|
|
51
51
|
},
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
},
|
|
52
55
|
"license": "MIT"
|
|
53
56
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Create a local bin self-link for this source repo.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* When the package name matches what npx resolves, npm may not create
|
|
6
|
+
* node_modules/.bin/fast-context-mcp automatically. That breaks local
|
|
7
|
+
* `npx @philau2512/fast-context-mcp` / bin resolution from the repo root.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { chmodSync, existsSync, mkdirSync, readFileSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
|
@@ -47,4 +47,4 @@ if (process.platform === "win32") {
|
|
|
47
47
|
writeFileSync(linkPath, `#!/bin/sh\nexec node "${relativeTarget}" "$@"\n`, "utf8");
|
|
48
48
|
}
|
|
49
49
|
chmodSync(linkPath, 0o755);
|
|
50
|
-
}
|
|
50
|
+
}
|
package/src/server.mjs
CHANGED
|
@@ -91,9 +91,14 @@ export function buildFastContextSearchTool({
|
|
|
91
91
|
const runSearchWithContent = deps.searchWithContent || searchWithContent;
|
|
92
92
|
const validatePath = deps.validateProjectPath || validateProjectPath;
|
|
93
93
|
const description =
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
94
|
+
"Fast semantic codebase search and context discovery. " +
|
|
95
|
+
"Locates relevant files, exact line ranges, and code regions from natural language descriptions in a single step, " +
|
|
96
|
+
"without needing manual grep trials or knowing exact filenames.\n\n" +
|
|
97
|
+
"Recommended for:\n" +
|
|
98
|
+
"- Finding feature implementations, business logic, and API flows (e.g. 'where is payment webhook handled', 'auth token refresh flow').\n" +
|
|
99
|
+
"- Exploring unfamiliar codebases or locating where conceptual logic lives.\n" +
|
|
100
|
+
"- Getting high-relevance entry points, line ranges, and suggested grep keywords before reading code.\n\n" +
|
|
101
|
+
"Use exact-match grep instead only when searching for a known, specific symbol name or literal string.\n\n" +
|
|
97
102
|
"For best semantic search quality, write the query primarily in English; add local-language business terms only when needed.\n" +
|
|
98
103
|
"Use tree_depth/max_turns/max_results for task-level tuning; use exclude_paths to reduce payload or noise.\n" +
|
|
99
104
|
(config.includeSnippetsExplicitlySet
|
|
@@ -104,7 +109,10 @@ export function buildFastContextSearchTool({
|
|
|
104
109
|
|
|
105
110
|
const schema = {
|
|
106
111
|
query: z.string().describe(
|
|
107
|
-
'Natural language search query
|
|
112
|
+
'Natural language search query describing the feature, logic, architecture, or behavior to locate. ' +
|
|
113
|
+
'English is recommended for best semantic matching; describe what the code does rather than guessing exact variable names ' +
|
|
114
|
+
'(e.g. "where is user login authentication and JWT validation handled", "database connection pool retry logic"). ' +
|
|
115
|
+
'Add local-language business terms only when needed.'
|
|
108
116
|
),
|
|
109
117
|
project_path: projectPathSchema.describe(
|
|
110
118
|
"Absolute path to project root directory (required). " +
|