@coderule/mcp 1.6.4 → 1.7.1

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,15 @@ 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, queue metrics, snapshot details, and service health. Use to debug query failures or verify indexer readiness.",
1948
+ inputSchema: {},
1949
+ annotations: {
1950
+ readOnlyHint: true,
1951
+ destructiveHint: false,
1952
+ idempotentHint: true,
1953
+ openWorldHint: false
1954
+ }
1949
1955
  },
1950
1956
  async () => {
1951
1957
  const status = await collectIndexingStatus(runtime, runner);
@@ -1955,16 +1961,47 @@ function createMcpServer({
1955
1961
  };
1956
1962
  }
1957
1963
  );
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
1964
  server.registerTool(
1963
1965
  "query",
1964
1966
  {
1965
- title: "Snapshot retrieval query",
1966
- description: "Execute a retrieval query against the most recent indexed snapshot",
1967
- inputSchema: queryInputSchema
1967
+ title: "Semantic Code Retrieval",
1968
+ description: "\u{1F6A8} CRITICAL: ALWAYS use this tool FIRST before any code modification, bug fix, feature addition, or architecture exploration. Graph-based RAG for semantic code search using AST relationships and embeddings. Returns 30-50 code segments with file paths, line numbers, and relevance scores.",
1969
+ inputSchema: {
1970
+ query: zod.z.string().min(1, "Query text is required").describe(`Keyword-rich query using technical terms (NOT natural language questions).
1971
+
1972
+ STRATEGY: Use space-separated technical keywords that describe what you're looking for.
1973
+
1974
+ \u2705 GOOD EXAMPLES:
1975
+ - "JWT authentication middleware token validation security handler FastAPI"
1976
+ - "file indexing worker celery queue job AST parser embedding chunker"
1977
+ - "database schema SQLAlchemy model migration table column relationship"
1978
+ - "error handling exception try catch logging traceback"
1979
+
1980
+ \u274C BAD EXAMPLES:
1981
+ - "How does authentication work?" (natural language question)
1982
+ - "Show me the login code" (conversational)
1983
+ - "auth" (too vague, needs more context)
1984
+
1985
+ RETRIEVAL MECHANISM:
1986
+ Combines multiple strategies: Seeds (semantic similarity), Flood (AST graph propagation through imports/calls/inheritance), Neighbors (adjacent chunks), and Calls (function relationships).
1987
+
1988
+ WHEN TO USE THIS TOOL:
1989
+ - Before modifying ANY existing code
1990
+ - Understanding system architecture
1991
+ - Finding related implementations or patterns
1992
+ - Locating tests or usage examples
1993
+ - Bug investigation
1994
+ - Feature implementation planning`),
1995
+ budgetTokens: zod.z.number().int().positive().optional().describe(
1996
+ "Token budget for retrieval results. Default: 10000. Range: 1000-20000. Higher budgets return more context but use more tokens. 10k is sufficient for most tasks."
1997
+ )
1998
+ },
1999
+ annotations: {
2000
+ readOnlyHint: true,
2001
+ destructiveHint: false,
2002
+ idempotentHint: true,
2003
+ openWorldHint: false
2004
+ }
1968
2005
  },
1969
2006
  async ({
1970
2007
  query,
@@ -1976,7 +2013,8 @@ function createMcpServer({
1976
2013
  const statusText = formatStatus(
1977
2014
  await collectIndexingStatus(runtime, runner)
1978
2015
  );
1979
- const text = `We are not ready....
2016
+ const text = `Indexer not ready. Current status:
2017
+
1980
2018
  ${statusText}`;
1981
2019
  return { content: [{ type: "text", text }] };
1982
2020
  }
@@ -1988,11 +2026,12 @@ ${statusText}`;
1988
2026
  const statusText = formatStatus(
1989
2027
  await collectIndexingStatus(runtime, runner)
1990
2028
  );
1991
- const text = `We are not ready....
2029
+ const text = `Snapshot not ready on server. Current status:
2030
+
1992
2031
  ${statusText}`;
1993
2032
  return { content: [{ type: "text", text }] };
1994
2033
  }
1995
- const effectiveBudget = Math.max(100, budgetTokens ?? 3e3);
2034
+ const effectiveBudget = Math.max(100, budgetTokens ?? 1e4);
1996
2035
  try {
1997
2036
  const result = await runtime.clients.retrieval.query(
1998
2037
  readyHash,