@sensegrep/mcp 0.1.7 → 0.1.10
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/dist/server.d.ts +2 -186
- package/dist/server.js +189 -191
- package/dist/server.js.map +1 -1
- package/package.json +29 -23
package/dist/server.d.ts
CHANGED
|
@@ -1,186 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare function loadCore(): Promise<any>;
|
|
4
|
-
declare function loadTool(): Promise<{
|
|
5
|
-
core: any;
|
|
6
|
-
tool: any;
|
|
7
|
-
}>;
|
|
8
|
-
type JsonRpcRequest = {
|
|
9
|
-
jsonrpc: "2.0";
|
|
10
|
-
id?: number | string | null;
|
|
11
|
-
method: string;
|
|
12
|
-
params?: any;
|
|
13
|
-
};
|
|
14
|
-
type JsonRpcResponse = {
|
|
15
|
-
jsonrpc: "2.0";
|
|
16
|
-
id: number | string | null;
|
|
17
|
-
result?: any;
|
|
18
|
-
error?: {
|
|
19
|
-
code: number;
|
|
20
|
-
message: string;
|
|
21
|
-
data?: any;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
type IndexResult = {
|
|
25
|
-
mode?: string;
|
|
26
|
-
files?: number;
|
|
27
|
-
chunks?: number;
|
|
28
|
-
skipped?: number;
|
|
29
|
-
removed?: number;
|
|
30
|
-
duration?: number;
|
|
31
|
-
};
|
|
32
|
-
declare function isIncremental(result: IndexResult): result is IndexResult & {
|
|
33
|
-
mode: "incremental";
|
|
34
|
-
};
|
|
35
|
-
declare const toolSchemas: ({
|
|
36
|
-
name: string;
|
|
37
|
-
description: string;
|
|
38
|
-
inputSchema: {
|
|
39
|
-
type: string;
|
|
40
|
-
properties: {
|
|
41
|
-
query: {
|
|
42
|
-
type: string;
|
|
43
|
-
};
|
|
44
|
-
pattern: {
|
|
45
|
-
type: string;
|
|
46
|
-
};
|
|
47
|
-
limit: {
|
|
48
|
-
type: string;
|
|
49
|
-
};
|
|
50
|
-
include: {
|
|
51
|
-
type: string;
|
|
52
|
-
};
|
|
53
|
-
symbolType: {
|
|
54
|
-
type: string;
|
|
55
|
-
enum: string[];
|
|
56
|
-
};
|
|
57
|
-
isExported: {
|
|
58
|
-
type: string;
|
|
59
|
-
};
|
|
60
|
-
minComplexity: {
|
|
61
|
-
type: string;
|
|
62
|
-
};
|
|
63
|
-
maxComplexity: {
|
|
64
|
-
type: string;
|
|
65
|
-
};
|
|
66
|
-
hasDocumentation: {
|
|
67
|
-
type: string;
|
|
68
|
-
};
|
|
69
|
-
language: {
|
|
70
|
-
type: string;
|
|
71
|
-
enum: string[];
|
|
72
|
-
};
|
|
73
|
-
parentScope: {
|
|
74
|
-
type: string;
|
|
75
|
-
};
|
|
76
|
-
rerank: {
|
|
77
|
-
type: string;
|
|
78
|
-
};
|
|
79
|
-
embedModel: {
|
|
80
|
-
type: string;
|
|
81
|
-
};
|
|
82
|
-
embedDim: {
|
|
83
|
-
type: string;
|
|
84
|
-
};
|
|
85
|
-
rerankModel: {
|
|
86
|
-
type: string;
|
|
87
|
-
};
|
|
88
|
-
device: {
|
|
89
|
-
type: string;
|
|
90
|
-
};
|
|
91
|
-
provider: {
|
|
92
|
-
type: string;
|
|
93
|
-
};
|
|
94
|
-
rootDir: {
|
|
95
|
-
type: string;
|
|
96
|
-
};
|
|
97
|
-
full?: undefined;
|
|
98
|
-
};
|
|
99
|
-
required: string[];
|
|
100
|
-
additionalProperties: boolean;
|
|
101
|
-
};
|
|
102
|
-
} | {
|
|
103
|
-
name: string;
|
|
104
|
-
description: string;
|
|
105
|
-
inputSchema: {
|
|
106
|
-
type: string;
|
|
107
|
-
properties: {
|
|
108
|
-
rootDir: {
|
|
109
|
-
type: string;
|
|
110
|
-
};
|
|
111
|
-
full: {
|
|
112
|
-
type: string;
|
|
113
|
-
};
|
|
114
|
-
embedModel: {
|
|
115
|
-
type: string;
|
|
116
|
-
};
|
|
117
|
-
embedDim: {
|
|
118
|
-
type: string;
|
|
119
|
-
};
|
|
120
|
-
rerankModel: {
|
|
121
|
-
type: string;
|
|
122
|
-
};
|
|
123
|
-
device: {
|
|
124
|
-
type: string;
|
|
125
|
-
};
|
|
126
|
-
provider: {
|
|
127
|
-
type: string;
|
|
128
|
-
};
|
|
129
|
-
query?: undefined;
|
|
130
|
-
pattern?: undefined;
|
|
131
|
-
limit?: undefined;
|
|
132
|
-
include?: undefined;
|
|
133
|
-
symbolType?: undefined;
|
|
134
|
-
isExported?: undefined;
|
|
135
|
-
minComplexity?: undefined;
|
|
136
|
-
maxComplexity?: undefined;
|
|
137
|
-
hasDocumentation?: undefined;
|
|
138
|
-
language?: undefined;
|
|
139
|
-
parentScope?: undefined;
|
|
140
|
-
rerank?: undefined;
|
|
141
|
-
};
|
|
142
|
-
additionalProperties: boolean;
|
|
143
|
-
required?: undefined;
|
|
144
|
-
};
|
|
145
|
-
} | {
|
|
146
|
-
name: string;
|
|
147
|
-
description: string;
|
|
148
|
-
inputSchema: {
|
|
149
|
-
type: string;
|
|
150
|
-
properties: {
|
|
151
|
-
rootDir: {
|
|
152
|
-
type: string;
|
|
153
|
-
};
|
|
154
|
-
query?: undefined;
|
|
155
|
-
pattern?: undefined;
|
|
156
|
-
limit?: undefined;
|
|
157
|
-
include?: undefined;
|
|
158
|
-
symbolType?: undefined;
|
|
159
|
-
isExported?: undefined;
|
|
160
|
-
minComplexity?: undefined;
|
|
161
|
-
maxComplexity?: undefined;
|
|
162
|
-
hasDocumentation?: undefined;
|
|
163
|
-
language?: undefined;
|
|
164
|
-
parentScope?: undefined;
|
|
165
|
-
rerank?: undefined;
|
|
166
|
-
embedModel?: undefined;
|
|
167
|
-
embedDim?: undefined;
|
|
168
|
-
rerankModel?: undefined;
|
|
169
|
-
device?: undefined;
|
|
170
|
-
provider?: undefined;
|
|
171
|
-
full?: undefined;
|
|
172
|
-
};
|
|
173
|
-
additionalProperties: boolean;
|
|
174
|
-
required?: undefined;
|
|
175
|
-
};
|
|
176
|
-
})[];
|
|
177
|
-
declare function send(response: JsonRpcResponse): void;
|
|
178
|
-
declare function resultText(text: string, meta?: Record<string, unknown>): {
|
|
179
|
-
content: {
|
|
180
|
-
type: string;
|
|
181
|
-
text: string;
|
|
182
|
-
}[];
|
|
183
|
-
meta: Record<string, unknown> | undefined;
|
|
184
|
-
};
|
|
185
|
-
declare function handleRequest(req: JsonRpcRequest): Promise<void>;
|
|
186
|
-
declare let buffer: Buffer<ArrayBuffer>;
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export {};
|
package/dist/server.js
CHANGED
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
3
7
|
let corePromise = null;
|
|
4
8
|
let toolPromise = null;
|
|
9
|
+
const WATCH_INTERVAL_MS = 60_000;
|
|
10
|
+
let watchHandle = null;
|
|
11
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
5
12
|
async function loadCore() {
|
|
6
|
-
if (!corePromise)
|
|
7
|
-
corePromise = import("@sensegrep/core")
|
|
13
|
+
if (!corePromise) {
|
|
14
|
+
corePromise = import("@sensegrep/core").catch(async (error) => {
|
|
15
|
+
const fallbackUrl = pathToFileURL(path.join(__dirname, "..", "..", "core", "dist", "index.js")).href;
|
|
16
|
+
try {
|
|
17
|
+
return await import(fallbackUrl);
|
|
18
|
+
}
|
|
19
|
+
catch (fallbackError) {
|
|
20
|
+
const message = fallbackError instanceof Error
|
|
21
|
+
? fallbackError.message
|
|
22
|
+
: String(fallbackError);
|
|
23
|
+
const err = new Error(`Failed to load @sensegrep/core. Fallback also failed: ${message}`);
|
|
24
|
+
err.cause = error;
|
|
25
|
+
throw err;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
8
29
|
return corePromise;
|
|
9
30
|
}
|
|
10
31
|
async function loadTool() {
|
|
@@ -17,37 +38,91 @@ async function loadTool() {
|
|
|
17
38
|
function isIncremental(result) {
|
|
18
39
|
return result.mode === "incremental";
|
|
19
40
|
}
|
|
20
|
-
|
|
41
|
+
function formatIndexResult(result) {
|
|
42
|
+
const duration = ((result.duration ?? 0) / 1000).toFixed(1);
|
|
43
|
+
if (isIncremental(result)) {
|
|
44
|
+
return `Indexed ${result.files ?? 0} files (${result.chunks ?? 0} chunks), skipped ${result.skipped ?? 0}, removed ${result.removed ?? 0} in ${duration}s`;
|
|
45
|
+
}
|
|
46
|
+
return `Indexed ${result.files ?? 0} files (${result.chunks ?? 0} chunks) in ${duration}s`;
|
|
47
|
+
}
|
|
48
|
+
function watchEnabled() {
|
|
49
|
+
const raw = process.env.SENSEGREP_WATCH;
|
|
50
|
+
if (!raw)
|
|
51
|
+
return true;
|
|
52
|
+
return !["0", "false", "off", "no"].includes(raw.toLowerCase());
|
|
53
|
+
}
|
|
54
|
+
async function startWatch() {
|
|
55
|
+
if (!watchEnabled())
|
|
56
|
+
return;
|
|
57
|
+
if (watchHandle)
|
|
58
|
+
return;
|
|
59
|
+
const { IndexWatcher } = await loadCore();
|
|
60
|
+
// Use SENSEGREP_ROOT if set, otherwise let watcher auto-detect from most recent index
|
|
61
|
+
const rootDir = process.env.SENSEGREP_ROOT;
|
|
62
|
+
try {
|
|
63
|
+
watchHandle = await IndexWatcher.start({
|
|
64
|
+
rootDir: rootDir, // Will auto-detect if undefined
|
|
65
|
+
intervalMs: WATCH_INTERVAL_MS,
|
|
66
|
+
onIndex: (result) => {
|
|
67
|
+
const message = formatIndexResult(result);
|
|
68
|
+
if (message)
|
|
69
|
+
console.error(`[sensegrep] ${message}`);
|
|
70
|
+
},
|
|
71
|
+
onError: (error) => {
|
|
72
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
73
|
+
console.error(`[sensegrep] watch error: ${message}`);
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
console.error(`[sensegrep] watching (reindex at most once per minute)`);
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
80
|
+
console.error(`[sensegrep] failed to start watcher: ${message}`);
|
|
81
|
+
// Don't throw - allow MCP to continue without watcher
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
async function stopWatch() {
|
|
85
|
+
if (watchHandle) {
|
|
86
|
+
await watchHandle.stop();
|
|
87
|
+
watchHandle = null;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const tools = [
|
|
21
91
|
{
|
|
22
92
|
name: "sensegrep.search",
|
|
23
|
-
description: "Semantic + structural code search with optional regex filters.",
|
|
93
|
+
description: "Semantic + structural code search with optional regex filters. Automatically uses the embedding model from the index.",
|
|
24
94
|
inputSchema: {
|
|
25
95
|
type: "object",
|
|
26
96
|
properties: {
|
|
27
|
-
query: { type: "string" },
|
|
28
|
-
pattern: { type: "string" },
|
|
29
|
-
limit: { type: "number" },
|
|
30
|
-
include: { type: "string" },
|
|
97
|
+
query: { type: "string", description: "Search query" },
|
|
98
|
+
pattern: { type: "string", description: "Regex pattern filter" },
|
|
99
|
+
limit: { type: "number", description: "Max results (default: 20)" },
|
|
100
|
+
include: { type: "string", description: "File glob filter (e.g., 'src/**/*.ts')" },
|
|
101
|
+
symbol: { type: "string", description: "Filter by symbol name" },
|
|
102
|
+
name: { type: "string", description: "Alias for symbol name" },
|
|
31
103
|
symbolType: {
|
|
32
104
|
type: "string",
|
|
33
105
|
enum: ["function", "class", "method", "interface", "type", "variable", "namespace", "enum"],
|
|
106
|
+
description: "Filter by symbol type",
|
|
107
|
+
},
|
|
108
|
+
isExported: { type: "boolean", description: "Only exported symbols" },
|
|
109
|
+
minComplexity: { type: "number", description: "Minimum cyclomatic complexity" },
|
|
110
|
+
maxComplexity: { type: "number", description: "Maximum cyclomatic complexity" },
|
|
111
|
+
minScore: { type: "number", description: "Minimum relevance score 0-1" },
|
|
112
|
+
maxPerFile: { type: "number", description: "Max results per file (default: 1)" },
|
|
113
|
+
maxPerSymbol: { type: "number", description: "Max results per symbol (default: 1)" },
|
|
114
|
+
hasDocumentation: { type: "boolean", description: "Require documentation" },
|
|
115
|
+
language: {
|
|
116
|
+
type: "string",
|
|
117
|
+
enum: ["typescript", "javascript", "tsx", "jsx"],
|
|
118
|
+
description: "Filter by language",
|
|
34
119
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
language: { type: "string", enum: ["typescript", "javascript", "tsx", "jsx"] },
|
|
40
|
-
parentScope: { type: "string" },
|
|
41
|
-
rerank: { type: "boolean" },
|
|
42
|
-
embedModel: { type: "string" },
|
|
43
|
-
embedDim: { type: "number" },
|
|
44
|
-
rerankModel: { type: "string" },
|
|
45
|
-
device: { type: "string" },
|
|
46
|
-
provider: { type: "string" },
|
|
47
|
-
rootDir: { type: "string" },
|
|
120
|
+
parentScope: { type: "string", description: "Parent scope/class name" },
|
|
121
|
+
imports: { type: "string", description: "Filter by imported module name (e.g., 'react')" },
|
|
122
|
+
rerank: { type: "boolean", description: "Enable cross-encoder reranking" },
|
|
123
|
+
rootDir: { type: "string", description: "Root directory (default: cwd)" },
|
|
48
124
|
},
|
|
49
125
|
required: ["query"],
|
|
50
|
-
additionalProperties: false,
|
|
51
126
|
},
|
|
52
127
|
},
|
|
53
128
|
{
|
|
@@ -56,15 +131,13 @@ const toolSchemas = [
|
|
|
56
131
|
inputSchema: {
|
|
57
132
|
type: "object",
|
|
58
133
|
properties: {
|
|
59
|
-
rootDir: { type: "string" },
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
provider: { type: "string" },
|
|
134
|
+
rootDir: { type: "string", description: "Root directory to index" },
|
|
135
|
+
mode: {
|
|
136
|
+
type: "string",
|
|
137
|
+
enum: ["incremental", "full"],
|
|
138
|
+
description: "Index mode (default: incremental)",
|
|
139
|
+
},
|
|
66
140
|
},
|
|
67
|
-
additionalProperties: false,
|
|
68
141
|
},
|
|
69
142
|
},
|
|
70
143
|
{
|
|
@@ -73,176 +146,101 @@ const toolSchemas = [
|
|
|
73
146
|
inputSchema: {
|
|
74
147
|
type: "object",
|
|
75
148
|
properties: {
|
|
76
|
-
rootDir: { type: "string" },
|
|
149
|
+
rootDir: { type: "string", description: "Root directory" },
|
|
77
150
|
},
|
|
78
|
-
additionalProperties: false,
|
|
79
151
|
},
|
|
80
152
|
},
|
|
81
153
|
];
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
async
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
result: { tools: toolSchemas },
|
|
112
|
-
});
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
if (req.method === "tools/call") {
|
|
116
|
-
const params = req.params || {};
|
|
117
|
-
const name = params.name;
|
|
118
|
-
const args = params.arguments || {};
|
|
119
|
-
const rootDir = args.rootDir || process.env.SENSEGREP_ROOT || process.cwd();
|
|
120
|
-
const provider = args.provider === "local" || args.provider === "gemini" ? args.provider : undefined;
|
|
121
|
-
const embedOverrides = {
|
|
122
|
-
...(args.embedModel ? { embedModel: String(args.embedModel) } : {}),
|
|
123
|
-
...(args.embedDim ? { embedDim: Number(args.embedDim) } : {}),
|
|
124
|
-
...(args.rerankModel ? { rerankModel: String(args.rerankModel) } : {}),
|
|
125
|
-
...(args.device ? { device: String(args.device) } : {}),
|
|
126
|
-
...(provider ? { provider } : {}),
|
|
127
|
-
};
|
|
128
|
-
try {
|
|
129
|
-
if (name === "sensegrep.search") {
|
|
130
|
-
const { core, tool } = await loadTool();
|
|
131
|
-
const { rootDir: _root, ...toolArgs } = args;
|
|
132
|
-
const { Instance, Embeddings } = core;
|
|
133
|
-
const withOverrides = Object.keys(embedOverrides).length
|
|
134
|
-
? (fn) => Embeddings.withConfig(embedOverrides, fn)
|
|
135
|
-
: (fn) => fn();
|
|
136
|
-
const res = await withOverrides(() => Instance.provide({
|
|
137
|
-
directory: rootDir,
|
|
138
|
-
fn: () => tool.execute(toolArgs, {
|
|
139
|
-
sessionID: "mcp",
|
|
140
|
-
messageID: "mcp",
|
|
141
|
-
agent: "sensegrep-mcp",
|
|
142
|
-
abort: new AbortController().signal,
|
|
143
|
-
metadata(_input) { },
|
|
144
|
-
}),
|
|
145
|
-
}));
|
|
146
|
-
send({
|
|
147
|
-
jsonrpc: "2.0",
|
|
148
|
-
id,
|
|
149
|
-
result: resultText(res.output, { title: res.title, metadata: res.metadata }),
|
|
150
|
-
});
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
if (name === "sensegrep.index") {
|
|
154
|
-
const full = args.full === true;
|
|
155
|
-
const { core } = await loadTool();
|
|
156
|
-
const { Indexer, Instance, Embeddings } = core;
|
|
157
|
-
const withOverrides = Object.keys(embedOverrides).length
|
|
158
|
-
? (fn) => Embeddings.withConfig(embedOverrides, fn)
|
|
159
|
-
: (fn) => fn();
|
|
160
|
-
const result = (await withOverrides(() => Instance.provide({
|
|
161
|
-
directory: rootDir,
|
|
162
|
-
fn: () => (full ? Indexer.indexProject() : Indexer.indexProjectIncremental()),
|
|
163
|
-
})));
|
|
164
|
-
send({
|
|
165
|
-
jsonrpc: "2.0",
|
|
166
|
-
id,
|
|
167
|
-
result: resultText((() => {
|
|
168
|
-
const files = result.files ?? 0;
|
|
169
|
-
const chunks = result.chunks ?? 0;
|
|
170
|
-
const skipped = result.skipped ?? 0;
|
|
171
|
-
const removed = result.removed ?? 0;
|
|
172
|
-
const durationMs = result.duration ?? 0;
|
|
173
|
-
const duration = (durationMs / 1000).toFixed(1);
|
|
174
|
-
return isIncremental(result)
|
|
175
|
-
? `Indexed ${files} files (${chunks} chunks), skipped ${skipped}, removed ${removed} in ${duration}s`
|
|
176
|
-
: `Indexed ${files} files (${chunks} chunks) in ${duration}s`;
|
|
177
|
-
})()),
|
|
178
|
-
});
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
if (name === "sensegrep.stats") {
|
|
182
|
-
const { core } = await loadTool();
|
|
183
|
-
const { Indexer, Instance } = core;
|
|
184
|
-
const stats = await Instance.provide({
|
|
185
|
-
directory: rootDir,
|
|
186
|
-
fn: () => Indexer.getStats(),
|
|
187
|
-
});
|
|
188
|
-
send({
|
|
189
|
-
jsonrpc: "2.0",
|
|
190
|
-
id,
|
|
191
|
-
result: resultText(JSON.stringify(stats, null, 2)),
|
|
192
|
-
});
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
send({
|
|
196
|
-
jsonrpc: "2.0",
|
|
197
|
-
id,
|
|
198
|
-
error: { code: -32601, message: `Method not found: ${name}` },
|
|
154
|
+
const server = new Server({
|
|
155
|
+
name: "sensegrep",
|
|
156
|
+
version: "0.1.6",
|
|
157
|
+
}, {
|
|
158
|
+
capabilities: {
|
|
159
|
+
tools: {},
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
163
|
+
return { tools };
|
|
164
|
+
});
|
|
165
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
166
|
+
const { name, arguments: args } = request.params;
|
|
167
|
+
const rootDir = args.rootDir || process.env.SENSEGREP_ROOT || process.cwd();
|
|
168
|
+
try {
|
|
169
|
+
if (name === "sensegrep.search") {
|
|
170
|
+
const { core, tool } = await loadTool();
|
|
171
|
+
const { rootDir: _root, ...toolArgs } = args;
|
|
172
|
+
const { Instance } = core;
|
|
173
|
+
// Search tool now reads embeddings config from index automatically
|
|
174
|
+
const res = await Instance.provide({
|
|
175
|
+
directory: rootDir,
|
|
176
|
+
fn: () => tool.execute(toolArgs, {
|
|
177
|
+
sessionID: "mcp",
|
|
178
|
+
messageID: "mcp",
|
|
179
|
+
agent: "sensegrep-mcp",
|
|
180
|
+
abort: new AbortController().signal,
|
|
181
|
+
metadata(_input) { },
|
|
182
|
+
}),
|
|
199
183
|
});
|
|
200
|
-
return
|
|
184
|
+
return {
|
|
185
|
+
content: [{ type: "text", text: res.output }],
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
if (name === "sensegrep.index") {
|
|
189
|
+
const { core } = await loadTool();
|
|
190
|
+
const { Indexer, Instance } = core;
|
|
191
|
+
const mode = String(args.mode ?? "incremental").toLowerCase();
|
|
192
|
+
const full = mode === "full";
|
|
193
|
+
const result = (await Instance.provide({
|
|
194
|
+
directory: rootDir,
|
|
195
|
+
fn: () => (full ? Indexer.indexProject() : Indexer.indexProjectIncremental()),
|
|
196
|
+
}));
|
|
197
|
+
const files = result.files ?? 0;
|
|
198
|
+
const chunks = result.chunks ?? 0;
|
|
199
|
+
const skipped = result.skipped ?? 0;
|
|
200
|
+
const removed = result.removed ?? 0;
|
|
201
|
+
const durationMs = result.duration ?? 0;
|
|
202
|
+
const duration = (durationMs / 1000).toFixed(1);
|
|
203
|
+
const text = isIncremental(result)
|
|
204
|
+
? `Indexed ${files} files (${chunks} chunks), skipped ${skipped}, removed ${removed} in ${duration}s`
|
|
205
|
+
: `Indexed ${files} files (${chunks} chunks) in ${duration}s`;
|
|
206
|
+
return {
|
|
207
|
+
content: [{ type: "text", text }],
|
|
208
|
+
};
|
|
201
209
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
210
|
+
if (name === "sensegrep.stats") {
|
|
211
|
+
const { core } = await loadTool();
|
|
212
|
+
const { Indexer, Instance } = core;
|
|
213
|
+
const stats = await Instance.provide({
|
|
214
|
+
directory: rootDir,
|
|
215
|
+
fn: () => Indexer.getStats(),
|
|
207
216
|
});
|
|
208
|
-
return
|
|
217
|
+
return {
|
|
218
|
+
content: [{ type: "text", text: JSON.stringify(stats, null, 2) }],
|
|
219
|
+
};
|
|
209
220
|
}
|
|
221
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
210
222
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
});
|
|
223
|
+
catch (error) {
|
|
224
|
+
return {
|
|
225
|
+
content: [{ type: "text", text: `Error: ${error?.message || "Internal error"}` }],
|
|
226
|
+
isError: true,
|
|
227
|
+
};
|
|
217
228
|
}
|
|
229
|
+
});
|
|
230
|
+
async function main() {
|
|
231
|
+
const transport = new StdioServerTransport();
|
|
232
|
+
await server.connect(transport);
|
|
233
|
+
void startWatch();
|
|
234
|
+
// Setup cleanup handlers
|
|
235
|
+
const cleanup = async () => {
|
|
236
|
+
await stopWatch();
|
|
237
|
+
process.exit(0);
|
|
238
|
+
};
|
|
239
|
+
process.on("SIGINT", cleanup);
|
|
240
|
+
process.on("SIGTERM", cleanup);
|
|
218
241
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
while (true) {
|
|
223
|
-
const headerEnd = buffer.indexOf("\r\n\r\n");
|
|
224
|
-
if (headerEnd === -1)
|
|
225
|
-
break;
|
|
226
|
-
const header = buffer.slice(0, headerEnd).toString("utf8");
|
|
227
|
-
const match = header.match(/Content-Length:\s*(\d+)/i);
|
|
228
|
-
if (!match) {
|
|
229
|
-
buffer = buffer.slice(headerEnd + 4);
|
|
230
|
-
continue;
|
|
231
|
-
}
|
|
232
|
-
const length = Number(match[1]);
|
|
233
|
-
const bodyStart = headerEnd + 4;
|
|
234
|
-
const bodyEnd = bodyStart + length;
|
|
235
|
-
if (buffer.length < bodyEnd)
|
|
236
|
-
break;
|
|
237
|
-
const body = buffer.slice(bodyStart, bodyEnd).toString("utf8");
|
|
238
|
-
buffer = buffer.slice(bodyEnd);
|
|
239
|
-
try {
|
|
240
|
-
const req = JSON.parse(body);
|
|
241
|
-
void handleRequest(req);
|
|
242
|
-
}
|
|
243
|
-
catch {
|
|
244
|
-
// ignore malformed JSON
|
|
245
|
-
}
|
|
246
|
-
}
|
|
242
|
+
main().catch((error) => {
|
|
243
|
+
console.error("Server error:", error);
|
|
244
|
+
process.exit(1);
|
|
247
245
|
});
|
|
248
246
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAExD,IAAI,WAAW,GAAwB,IAAI,CAAC;AAC5C,IAAI,WAAW,GAAwB,IAAI,CAAC;AAC5C,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACjC,IAAI,WAAW,GAAyC,IAAI,CAAC;AAC7D,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE/D,KAAK,UAAU,QAAQ;IACrB,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,WAAW,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE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AK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,EAAE,CAAC;YACjF,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,KAAK,UAAU,EAAE,CAAC;IAElB,yBAAyB;IACzB,MAAM,OAAO,GAAG,KAAK,IAAI,EAAE;QACzB,MAAM,SAAS,EAAE,CAAC;QAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC;IAEF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACjC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@sensegrep/mcp",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"type": "module",
|
|
1
|
+
{
|
|
2
|
+
"name": "@sensegrep/mcp",
|
|
3
|
+
"version": "0.1.10",
|
|
4
|
+
"type": "module",
|
|
5
5
|
"main": "./dist/server.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"sensegrep-mcp": "
|
|
7
|
+
"sensegrep-mcp": "dist/server.js"
|
|
8
8
|
},
|
|
9
|
-
"types": "./dist/server.d.ts",
|
|
10
|
-
"files": [
|
|
11
|
-
"dist"
|
|
12
|
-
],
|
|
9
|
+
"types": "./dist/server.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
13
|
"scripts": {
|
|
14
|
-
"build": "tsc -p tsconfig.json"
|
|
15
|
-
|
|
16
|
-
"engines": {
|
|
17
|
-
"node": ">=18"
|
|
14
|
+
"build": "tsc -p tsconfig.json",
|
|
15
|
+
"prepublishOnly": "node ../../build.js"
|
|
18
16
|
},
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=18"
|
|
19
|
+
},
|
|
19
20
|
"dependencies": {
|
|
20
|
-
"@
|
|
21
|
+
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
22
|
+
"@sensegrep/core": "^0.1.10",
|
|
23
|
+
"zod": "^4.2.1"
|
|
21
24
|
},
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"type": "git",
|
|
25
|
-
"url": "https://github.com/Stahldavid/sensegrep.git"
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
26
27
|
},
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
}
|
|
28
|
+
"license": "Apache-2.0",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/Stahldavid/sensegrep.git"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/Stahldavid/sensegrep",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/Stahldavid/sensegrep/issues"
|
|
36
|
+
}
|
|
37
|
+
}
|