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