@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.js CHANGED
@@ -1928,9 +1928,15 @@ function createMcpServer({
1928
1928
  server.registerTool(
1929
1929
  "check",
1930
1930
  {
1931
- title: "Indexer status",
1932
- description: "Inspect the current indexing state, snapshot, and queue metrics",
1933
- inputSchema: {}
1931
+ title: "Coderule Indexing Status",
1932
+ 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.",
1933
+ inputSchema: {},
1934
+ annotations: {
1935
+ readOnlyHint: true,
1936
+ destructiveHint: false,
1937
+ idempotentHint: true,
1938
+ openWorldHint: false
1939
+ }
1934
1940
  },
1935
1941
  async () => {
1936
1942
  const status = await collectIndexingStatus(runtime, runner);
@@ -1940,16 +1946,47 @@ function createMcpServer({
1940
1946
  };
1941
1947
  }
1942
1948
  );
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
1949
  server.registerTool(
1948
1950
  "query",
1949
1951
  {
1950
- title: "Snapshot retrieval query",
1951
- description: "Execute a retrieval query against the most recent indexed snapshot",
1952
- inputSchema: queryInputSchema
1952
+ title: "Semantic Code Retrieval",
1953
+ 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.",
1954
+ inputSchema: {
1955
+ query: z.string().min(1, "Query text is required").describe(`Keyword-rich query using technical terms (NOT natural language questions).
1956
+
1957
+ STRATEGY: Use space-separated technical keywords that describe what you're looking for.
1958
+
1959
+ \u2705 GOOD EXAMPLES:
1960
+ - "JWT authentication middleware token validation security handler FastAPI"
1961
+ - "file indexing worker celery queue job AST parser embedding chunker"
1962
+ - "database schema SQLAlchemy model migration table column relationship"
1963
+ - "error handling exception try catch logging traceback"
1964
+
1965
+ \u274C BAD EXAMPLES:
1966
+ - "How does authentication work?" (natural language question)
1967
+ - "Show me the login code" (conversational)
1968
+ - "auth" (too vague, needs more context)
1969
+
1970
+ RETRIEVAL MECHANISM:
1971
+ Combines multiple strategies: Seeds (semantic similarity), Flood (AST graph propagation through imports/calls/inheritance), Neighbors (adjacent chunks), and Calls (function relationships).
1972
+
1973
+ WHEN TO USE THIS TOOL:
1974
+ - Before modifying ANY existing code
1975
+ - Understanding system architecture
1976
+ - Finding related implementations or patterns
1977
+ - Locating tests or usage examples
1978
+ - Bug investigation
1979
+ - Feature implementation planning`),
1980
+ budgetTokens: z.number().int().positive().optional().describe(
1981
+ "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."
1982
+ )
1983
+ },
1984
+ annotations: {
1985
+ readOnlyHint: true,
1986
+ destructiveHint: false,
1987
+ idempotentHint: true,
1988
+ openWorldHint: false
1989
+ }
1953
1990
  },
1954
1991
  async ({
1955
1992
  query,
@@ -1961,7 +1998,8 @@ function createMcpServer({
1961
1998
  const statusText = formatStatus(
1962
1999
  await collectIndexingStatus(runtime, runner)
1963
2000
  );
1964
- const text = `We are not ready....
2001
+ const text = `Indexer not ready. Current status:
2002
+
1965
2003
  ${statusText}`;
1966
2004
  return { content: [{ type: "text", text }] };
1967
2005
  }
@@ -1973,11 +2011,12 @@ ${statusText}`;
1973
2011
  const statusText = formatStatus(
1974
2012
  await collectIndexingStatus(runtime, runner)
1975
2013
  );
1976
- const text = `We are not ready....
2014
+ const text = `Snapshot not ready on server. Current status:
2015
+
1977
2016
  ${statusText}`;
1978
2017
  return { content: [{ type: "text", text }] };
1979
2018
  }
1980
- const effectiveBudget = Math.max(100, budgetTokens ?? 3e3);
2019
+ const effectiveBudget = Math.max(100, budgetTokens ?? 1e4);
1981
2020
  try {
1982
2021
  const result = await runtime.clients.retrieval.query(
1983
2022
  readyHash,