@coderule/mcp 1.6.4 → 1.7.0
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/mcp-cli.cjs +62 -13
- package/dist/mcp-cli.cjs.map +1 -1
- package/dist/mcp-cli.js +62 -13
- package/dist/mcp-cli.js.map +1 -1
- package/package.json +1 -1
package/dist/mcp-cli.js
CHANGED
|
@@ -1928,9 +1928,21 @@ function createMcpServer({
|
|
|
1928
1928
|
server.registerTool(
|
|
1929
1929
|
"check",
|
|
1930
1930
|
{
|
|
1931
|
-
title: "
|
|
1932
|
-
description:
|
|
1933
|
-
|
|
1931
|
+
title: "Coderule Indexing Status",
|
|
1932
|
+
description: `Check the current state of the code indexer. Returns repository info, file states (clean/dirty/hashing/missing), queue metrics, latest snapshot details, and service health.
|
|
1933
|
+
|
|
1934
|
+
Use this tool to:
|
|
1935
|
+
- Debug why queries are failing or returning no results
|
|
1936
|
+
- Verify the indexer is ready before querying
|
|
1937
|
+
- Check which repository is currently indexed
|
|
1938
|
+
- Monitor indexing progress`,
|
|
1939
|
+
inputSchema: {},
|
|
1940
|
+
annotations: {
|
|
1941
|
+
readOnlyHint: true,
|
|
1942
|
+
destructiveHint: false,
|
|
1943
|
+
idempotentHint: true,
|
|
1944
|
+
openWorldHint: false
|
|
1945
|
+
}
|
|
1934
1946
|
},
|
|
1935
1947
|
async () => {
|
|
1936
1948
|
const status = await collectIndexingStatus(runtime, runner);
|
|
@@ -1940,16 +1952,51 @@ function createMcpServer({
|
|
|
1940
1952
|
};
|
|
1941
1953
|
}
|
|
1942
1954
|
);
|
|
1943
|
-
const queryInputSchema = {
|
|
1944
|
-
query: z.string().min(1, "Query text is required"),
|
|
1945
|
-
budgetTokens: z.number().int().positive().optional().describe("Token budget for retrieval (default 3000)")
|
|
1946
|
-
};
|
|
1947
1955
|
server.registerTool(
|
|
1948
1956
|
"query",
|
|
1949
1957
|
{
|
|
1950
|
-
title: "
|
|
1951
|
-
description:
|
|
1952
|
-
|
|
1958
|
+
title: "Semantic Code Retrieval",
|
|
1959
|
+
description: `Graph-based RAG for semantic code search across the indexed codebase.
|
|
1960
|
+
|
|
1961
|
+
\u{1F6A8} CRITICAL: Use this tool FIRST before any code modification, bug fix, feature addition, or architecture exploration.
|
|
1962
|
+
|
|
1963
|
+
QUERY STRATEGY:
|
|
1964
|
+
Use keyword-rich technical terms, NOT natural language questions.
|
|
1965
|
+
|
|
1966
|
+
\u2705 GOOD: "JWT authentication middleware token validation security handler FastAPI"
|
|
1967
|
+
\u2705 GOOD: "file indexing worker celery queue job AST parser embedding chunker"
|
|
1968
|
+
\u2705 GOOD: "database schema SQLAlchemy model migration table column relationship"
|
|
1969
|
+
|
|
1970
|
+
\u274C BAD: "How does authentication work?"
|
|
1971
|
+
\u274C BAD: "Show me the login code"
|
|
1972
|
+
|
|
1973
|
+
RETRIEVAL MECHANISM:
|
|
1974
|
+
- Seeds: Semantic similarity via embeddings (~6 initial matches)
|
|
1975
|
+
- Flood: Graph propagation through AST relationships (imports, calls, inheritance)
|
|
1976
|
+
- Neighbors: Adjacent code chunks for context
|
|
1977
|
+
- Calls: Function call relationships
|
|
1978
|
+
|
|
1979
|
+
Returns 30-50 code segments with file paths, line numbers, and relevance scores.
|
|
1980
|
+
|
|
1981
|
+
DEFAULT BUDGET: 10,000 tokens (sufficient for most tasks)
|
|
1982
|
+
|
|
1983
|
+
WHEN TO USE:
|
|
1984
|
+
- Before modifying ANY existing code
|
|
1985
|
+
- Understanding system architecture
|
|
1986
|
+
- Finding related implementations
|
|
1987
|
+
- Locating tests or examples
|
|
1988
|
+
- Bug investigation
|
|
1989
|
+
- Feature implementation planning`,
|
|
1990
|
+
inputSchema: {
|
|
1991
|
+
query: z.string().min(1, "Query text is required"),
|
|
1992
|
+
budgetTokens: z.number().int().positive().optional().describe("Token budget for retrieval (default 10000)")
|
|
1993
|
+
},
|
|
1994
|
+
annotations: {
|
|
1995
|
+
readOnlyHint: true,
|
|
1996
|
+
destructiveHint: false,
|
|
1997
|
+
idempotentHint: true,
|
|
1998
|
+
openWorldHint: false
|
|
1999
|
+
}
|
|
1953
2000
|
},
|
|
1954
2001
|
async ({
|
|
1955
2002
|
query,
|
|
@@ -1961,7 +2008,8 @@ function createMcpServer({
|
|
|
1961
2008
|
const statusText = formatStatus(
|
|
1962
2009
|
await collectIndexingStatus(runtime, runner)
|
|
1963
2010
|
);
|
|
1964
|
-
const text = `
|
|
2011
|
+
const text = `Indexer not ready. Current status:
|
|
2012
|
+
|
|
1965
2013
|
${statusText}`;
|
|
1966
2014
|
return { content: [{ type: "text", text }] };
|
|
1967
2015
|
}
|
|
@@ -1973,11 +2021,12 @@ ${statusText}`;
|
|
|
1973
2021
|
const statusText = formatStatus(
|
|
1974
2022
|
await collectIndexingStatus(runtime, runner)
|
|
1975
2023
|
);
|
|
1976
|
-
const text = `
|
|
2024
|
+
const text = `Snapshot not ready on server. Current status:
|
|
2025
|
+
|
|
1977
2026
|
${statusText}`;
|
|
1978
2027
|
return { content: [{ type: "text", text }] };
|
|
1979
2028
|
}
|
|
1980
|
-
const effectiveBudget = Math.max(100, budgetTokens ??
|
|
2029
|
+
const effectiveBudget = Math.max(100, budgetTokens ?? 1e4);
|
|
1981
2030
|
try {
|
|
1982
2031
|
const result = await runtime.clients.retrieval.query(
|
|
1983
2032
|
readyHash,
|