@harivatsa/sirius-mcp-proxy 0.1.0 → 0.1.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/README.md CHANGED
@@ -10,6 +10,11 @@ npm install -g @harivatsa/sirius-mcp-proxy
10
10
 
11
11
  Point Claude at `sirius-mcp-proxy` after configuring the Sirius index URL, repo-agent URL, and token environment variables described in the root README.
12
12
 
13
+ Use `index_repo` from Claude/MCP to register a local repo path with the always-on repo-agent and start
14
+ indexing. Use `list_local_repos` to inspect repos known to the local agent. After that,
15
+ `semantic_code_search`, `hybrid_search`, `symbol_search`, `get_call_chain`, `impact_analysis`,
16
+ `ripgrep_search`, `sync_repo`, and `sync_status` operate through the repo-agent and index server.
17
+
13
18
  Snippet enrichment is bounded by `SIRIUS_MCP_ENRICH_CONCURRENCY`, which defaults to `16` and caps at `50`, matching the MCP tool `top_k` limit. Normal `top_k <= 16` searches fetch snippets in one wave; larger windows avoid unbounded local file-range fan-out.
14
19
 
15
20
  `semantic_code_search`, `hybrid_search`, `symbol_search`, `get_call_chain`, and `impact_analysis` compare indexed file hashes with local snippet hashes when `include_code=true`. With `auto_sync_stale=true`, stale snippets trigger one local repo-agent sync and then rerun the lookup.
package/dist/index.js CHANGED
@@ -6,9 +6,9 @@ import { enrichGraphNodes, enrichSearchResults, enrichSymbols } from "./enrich.j
6
6
  import { agentGet, agentPost, indexDelete, indexGet, indexPost } from "./http.js";
7
7
  import { impactAnalysisWithOptionalStaleSync } from "./impact.js";
8
8
  import { hasStaleSnippet, searchWithOptionalStaleSync } from "./search.js";
9
- import { localFilePathSchema, publicRepoIdSchema } from "./validation.js";
9
+ import { localFilePathSchema, localRepoPathSchema, publicRepoIdSchema } from "./validation.js";
10
10
  // General rule: package-installed CLIs need a no-session self-check path for install validation.
11
- const MCP_PROXY_VERSION = "0.1.0";
11
+ const MCP_PROXY_VERSION = "0.1.1";
12
12
  // General rule: expanded call graphs can include many nodes, while source snippets dominate MCP payload size.
13
13
  const DEFAULT_CALL_CHAIN_CODE_NODE_LIMIT = 50;
14
14
  // General rule: graph snippet enrichment should stay bounded by the largest accepted call-chain graph window.
@@ -24,6 +24,38 @@ const server = new McpServer({
24
24
  name: "sirius-mcp",
25
25
  version: MCP_PROXY_VERSION
26
26
  });
27
+ server.registerTool("index_repo", {
28
+ title: "Index Repo",
29
+ description: "Register a local repository with the repo agent and start indexing it on the Sirius server.",
30
+ inputSchema: {
31
+ repo_path: localRepoPathSchema,
32
+ repo_id: publicRepoIdSchema.optional(),
33
+ share_mode: z.enum(["personal", "group"]).default("personal"),
34
+ remote: z.string().min(1).default("origin"),
35
+ shared_ref: z.string().optional(),
36
+ sync: z.boolean().default(true),
37
+ full: z.boolean().default(false)
38
+ }
39
+ }, async ({ repo_path, repo_id, share_mode, remote, shared_ref, sync, full }) => {
40
+ const response = await agentPost("/repos/register", {
41
+ repo_path,
42
+ repo_id,
43
+ share_mode,
44
+ remote,
45
+ shared_ref,
46
+ sync,
47
+ full
48
+ });
49
+ return asJson(response);
50
+ });
51
+ server.registerTool("list_local_repos", {
52
+ title: "List Local Repos",
53
+ description: "List repositories registered with the local Sirius repo agent.",
54
+ inputSchema: {}
55
+ }, async () => {
56
+ const response = await agentGet("/repos");
57
+ return asJson(response);
58
+ });
27
59
  server.registerTool("semantic_code_search", {
28
60
  title: "Semantic Code Search",
29
61
  description: "Find relevant code by meaning using the Sirius index, optionally returning local snippets.",
@@ -3,10 +3,13 @@ import { z } from "zod";
3
3
  const PUBLIC_REPO_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
4
4
  // General rule: local file reads must use normalized repo-relative slash paths.
5
5
  const WINDOWS_DRIVE_PATH_PATTERN = /^[A-Za-z]:/;
6
+ const WINDOWS_ABSOLUTE_PATH_PATTERN = /^[A-Za-z]:[\\/]/;
6
7
  export const PUBLIC_REPO_ID_RULE = "use 1-128 ASCII letters, digits, dots, underscores, or hyphens, starting with a letter or digit";
7
8
  export const LOCAL_FILE_PATH_RULE = "file_path must be a relative path inside the repo";
9
+ export const LOCAL_REPO_PATH_RULE = "repo_path must be an absolute local filesystem path";
8
10
  export const publicRepoIdSchema = z.string().regex(PUBLIC_REPO_ID_PATTERN, PUBLIC_REPO_ID_RULE);
9
11
  export const localFilePathSchema = z.string().refine(isSafeLocalFilePath, LOCAL_FILE_PATH_RULE);
12
+ export const localRepoPathSchema = z.string().min(1).refine(isAbsoluteLocalPath, LOCAL_REPO_PATH_RULE);
10
13
  export function isSafeLocalFilePath(filePath) {
11
14
  if (!filePath ||
12
15
  filePath.includes("\0") ||
@@ -17,3 +20,6 @@ export function isSafeLocalFilePath(filePath) {
17
20
  }
18
21
  return filePath.split("/").every((segment) => segment.length > 0 && segment !== "." && segment !== "..");
19
22
  }
23
+ export function isAbsoluteLocalPath(filePath) {
24
+ return filePath.startsWith("/") || WINDOWS_ABSOLUTE_PATH_PATTERN.test(filePath);
25
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harivatsa/sirius-mcp-proxy",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "MCP proxy that joins Sirius index metadata with local source snippets.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",