@philau2512/fast-context-mcp 1.5.3 → 1.5.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025
3
+ Copyright (c) 2025–2026 philau2512 and contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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
- Maintained fork: [philau2512/fast-context-mcp](https://github.com/philau2512/fast-context-mcp)
6
- Upstream lineage: SammySnake / awei84 contributions (bootstrap hotspot, Devin auth, etc.)
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: from GitHub (recommended for this fork)
54
+ ### Option A: npm (after publish)
50
55
 
51
56
  ```bash
52
- # run latest from this repo (no global install)
53
- npx -y github:philau2512/fast-context-mcp
57
+ npx -y @philau2512/fast-context-mcp
58
+ # or
59
+ npm install -g @philau2512/fast-context-mcp
54
60
  ```
55
61
 
56
- ### Option B: clone from source
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
- git clone https://github.com/philau2512/fast-context-mcp.git
60
- cd fast-context-mcp
61
- npm install
67
+ npx -y github:philau2512/fast-context-mcp
62
68
  ```
63
69
 
64
- ### Option C: npm (after you publish)
70
+ ### Option C: clone from source
65
71
 
66
72
  ```bash
67
- npx -y fast-context-mcp
68
- # or: npm install -g fast-context-mcp
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", "github:philau2512/fast-context-mcp"],
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", "github:philau2512/fast-context-mcp"],
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
- > If `WINDSURF_API_KEY` is omitted, the server auto-discovers it from your local Windsurf / Devin installation.
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 Key extraction (SQLite)
270
- │ └── protobuf.mjs # Protobuf encoder/decoder + Connect-RPC frames
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's local SQLite DB |
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",
3
+ "version": "1.5.5",
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
- * 为源码仓库创建本地 bin 自链接。
3
+ * Create a local bin self-link for this source repo.
4
4
  *
5
- * npm/npx 在当前目录的 package 名称与请求包名相同时,会优先使用当前包。
6
- * 这种情况下不会像安装依赖那样自动生成 node_modules/.bin/fast-context-mcp,
7
- * 导致在本仓库根目录执行 `npx fast-context-mcp@x` 时出现 command not found。
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,11 +91,23 @@ export function buildFastContextSearchTool({
91
91
  const runSearchWithContent = deps.searchWithContent || searchWithContent;
92
92
  const validatePath = deps.validateProjectPath || validateProjectPath;
93
93
  const description =
94
- "AI-driven semantic code search using Windsurf's Devstral model. " +
95
- "Searches a codebase with natural language and returns relevant file paths with line ranges, " +
96
- "plus suggested grep keywords for follow-up searches.\n" +
97
- "For best semantic search quality, write the query primarily in English; add local-language business terms only when needed.\n" +
98
- "Use tree_depth/max_turns/max_results for task-level tuning; use exclude_paths to reduce payload or noise.\n" +
94
+ "Primary tool for semantic codebase search, context discovery, and verifying logic existence. " +
95
+ "Locates relevant files, exact line ranges, and code regions from natural language or domain concepts in a single step, " +
96
+ "without needing manual grep trials or knowing exact filenames.\n\n" +
97
+ "MANDATORY REQUIREMENT:\n" +
98
+ "- 'project_path' is strictly REQUIRED. You MUST provide the absolute path to the project root directory when calling this tool.\n\n" +
99
+ "RECOMMENDED FOR:\n" +
100
+ "- Verifying feature/data existence: Checking whether a business rule, model, seed data, configuration, or API already exists (e.g. 'check if warrior coefficient seed data exists', 'has rate limiting been added').\n" +
101
+ "- Finding conceptual business logic: Locating where behavior lives across the codebase without guessing file names.\n" +
102
+ "- Tracing multi-file flows: Getting high-relevance entry points, line ranges, and suggested grep keywords before reading code.\n\n" +
103
+ "DO NOT USE WHEN (Avoid Overuse):\n" +
104
+ "- Target file is already known, opened, or specified by the user (use view_file / read_file directly).\n" +
105
+ "- Exact symbol search: Searching for an exact, known function/class/variable name (use grep instead).\n" +
106
+ "- Directory exploration: Simply listing files in a directory (use list_dir/glob instead).\n" +
107
+ "- Single-file localized edits or lint fixes.\n\n" +
108
+ "QUERY TIPS:\n" +
109
+ "- For best semantic search quality, write the query primarily in English; keep local-language domain terms when needed (e.g. 'seed data for sale he so chien binh').\n" +
110
+ "- Use tree_depth/max_turns/max_results for task-level tuning; use exclude_paths to reduce payload or noise.\n" +
99
111
  (config.includeSnippetsExplicitlySet
100
112
  ? `- include_code_snippets: Server-configured default is ${config.includeSnippets}. Do NOT override unless explicitly asked by the user.\n`
101
113
  : "- include_code_snippets: Default false (lightweight mode, ~2-5KB output). " +
@@ -104,11 +116,15 @@ export function buildFastContextSearchTool({
104
116
 
105
117
  const schema = {
106
118
  query: z.string().describe(
107
- 'Natural language search query. English is recommended for best semantic matching; add local-language business terms when useful (e.g. "where is user login authentication and JWT validation handled 登录鉴权", "database connection pool")'
119
+ 'Natural language search query describing the feature, logic, architecture, or behavior to locate. ' +
120
+ 'English is recommended for best semantic matching; describe what the code does rather than guessing exact variable names ' +
121
+ '(e.g. "where is user login authentication and JWT validation handled", "database connection pool retry logic"). ' +
122
+ 'Add local-language business terms only when needed.'
108
123
  ),
109
124
  project_path: projectPathSchema.describe(
110
- "Absolute path to project root directory (required). " +
111
- "Example: /Users/username/projects/myproject or C:/Users/username/projects/myproject"
125
+ "MANDATORY: Absolute path to project root directory (required). " +
126
+ "You MUST supply this parameter explicitly on every call (e.g. /Users/username/projects/myproject or C:/Users/username/projects/myproject). " +
127
+ "Never leave empty or omit."
112
128
  ),
113
129
  tree_depth: z
114
130
  .number()