seer-mcp 0.1.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.
Files changed (371) hide show
  1. package/.vscode/settings.json +3 -0
  2. package/LICENSE +176 -0
  3. package/README.md +272 -0
  4. package/README_dev.md +199 -0
  5. package/dist/bundle/ci.d.ts +47 -0
  6. package/dist/bundle/ci.d.ts.map +1 -0
  7. package/dist/bundle/ci.js +113 -0
  8. package/dist/bundle/ci.js.map +1 -0
  9. package/dist/bundle/contract.d.ts +111 -0
  10. package/dist/bundle/contract.d.ts.map +1 -0
  11. package/dist/bundle/contract.js +352 -0
  12. package/dist/bundle/contract.js.map +1 -0
  13. package/dist/bundle/export.d.ts +36 -0
  14. package/dist/bundle/export.d.ts.map +1 -0
  15. package/dist/bundle/export.js +152 -0
  16. package/dist/bundle/export.js.map +1 -0
  17. package/dist/bundle/external.d.ts +66 -0
  18. package/dist/bundle/external.d.ts.map +1 -0
  19. package/dist/bundle/external.js +238 -0
  20. package/dist/bundle/external.js.map +1 -0
  21. package/dist/bundle/format.d.ts +94 -0
  22. package/dist/bundle/format.d.ts.map +1 -0
  23. package/dist/bundle/format.js +42 -0
  24. package/dist/bundle/format.js.map +1 -0
  25. package/dist/bundle/import.d.ts +49 -0
  26. package/dist/bundle/import.d.ts.map +1 -0
  27. package/dist/bundle/import.js +116 -0
  28. package/dist/bundle/import.js.map +1 -0
  29. package/dist/cli/index.d.ts +3 -0
  30. package/dist/cli/index.d.ts.map +1 -0
  31. package/dist/cli/index.js +1402 -0
  32. package/dist/cli/index.js.map +1 -0
  33. package/dist/cli/init.d.ts +48 -0
  34. package/dist/cli/init.d.ts.map +1 -0
  35. package/dist/cli/init.js +284 -0
  36. package/dist/cli/init.js.map +1 -0
  37. package/dist/db/schema.d.ts +3 -0
  38. package/dist/db/schema.d.ts.map +1 -0
  39. package/dist/db/schema.js +616 -0
  40. package/dist/db/schema.js.map +1 -0
  41. package/dist/db/store.d.ts +1011 -0
  42. package/dist/db/store.d.ts.map +1 -0
  43. package/dist/db/store.js +3888 -0
  44. package/dist/db/store.js.map +1 -0
  45. package/dist/graph/pagerank.d.ts +9 -0
  46. package/dist/graph/pagerank.d.ts.map +1 -0
  47. package/dist/graph/pagerank.js +47 -0
  48. package/dist/graph/pagerank.js.map +1 -0
  49. package/dist/indexer/architecture.d.ts +72 -0
  50. package/dist/indexer/architecture.d.ts.map +1 -0
  51. package/dist/indexer/architecture.js +112 -0
  52. package/dist/indexer/architecture.js.map +1 -0
  53. package/dist/indexer/behavior.d.ts +75 -0
  54. package/dist/indexer/behavior.d.ts.map +1 -0
  55. package/dist/indexer/behavior.js +395 -0
  56. package/dist/indexer/behavior.js.map +1 -0
  57. package/dist/indexer/boundaries.d.ts +60 -0
  58. package/dist/indexer/boundaries.d.ts.map +1 -0
  59. package/dist/indexer/boundaries.js +366 -0
  60. package/dist/indexer/boundaries.js.map +1 -0
  61. package/dist/indexer/churn.d.ts +15 -0
  62. package/dist/indexer/churn.d.ts.map +1 -0
  63. package/dist/indexer/churn.js +49 -0
  64. package/dist/indexer/churn.js.map +1 -0
  65. package/dist/indexer/classify.d.ts +9 -0
  66. package/dist/indexer/classify.d.ts.map +1 -0
  67. package/dist/indexer/classify.js +90 -0
  68. package/dist/indexer/classify.js.map +1 -0
  69. package/dist/indexer/context.d.ts +176 -0
  70. package/dist/indexer/context.d.ts.map +1 -0
  71. package/dist/indexer/context.js +193 -0
  72. package/dist/indexer/context.js.map +1 -0
  73. package/dist/indexer/continuity.d.ts +67 -0
  74. package/dist/indexer/continuity.d.ts.map +1 -0
  75. package/dist/indexer/continuity.js +288 -0
  76. package/dist/indexer/continuity.js.map +1 -0
  77. package/dist/indexer/detectchanges.d.ts +32 -0
  78. package/dist/indexer/detectchanges.d.ts.map +1 -0
  79. package/dist/indexer/detectchanges.js +74 -0
  80. package/dist/indexer/detectchanges.js.map +1 -0
  81. package/dist/indexer/discovery.d.ts +37 -0
  82. package/dist/indexer/discovery.d.ts.map +1 -0
  83. package/dist/indexer/discovery.js +136 -0
  84. package/dist/indexer/discovery.js.map +1 -0
  85. package/dist/indexer/externaldeps.d.ts +18 -0
  86. package/dist/indexer/externaldeps.d.ts.map +1 -0
  87. package/dist/indexer/externaldeps.js +288 -0
  88. package/dist/indexer/externaldeps.js.map +1 -0
  89. package/dist/indexer/freshness.d.ts +48 -0
  90. package/dist/indexer/freshness.d.ts.map +1 -0
  91. package/dist/indexer/freshness.js +128 -0
  92. package/dist/indexer/freshness.js.map +1 -0
  93. package/dist/indexer/git.d.ts +144 -0
  94. package/dist/indexer/git.d.ts.map +1 -0
  95. package/dist/indexer/git.js +444 -0
  96. package/dist/indexer/git.js.map +1 -0
  97. package/dist/indexer/index.d.ts +145 -0
  98. package/dist/indexer/index.d.ts.map +1 -0
  99. package/dist/indexer/index.js +930 -0
  100. package/dist/indexer/index.js.map +1 -0
  101. package/dist/indexer/modules.d.ts +62 -0
  102. package/dist/indexer/modules.d.ts.map +1 -0
  103. package/dist/indexer/modules.js +293 -0
  104. package/dist/indexer/modules.js.map +1 -0
  105. package/dist/indexer/preflight.d.ts +154 -0
  106. package/dist/indexer/preflight.d.ts.map +1 -0
  107. package/dist/indexer/preflight.js +399 -0
  108. package/dist/indexer/preflight.js.map +1 -0
  109. package/dist/indexer/protoScanner.d.ts +34 -0
  110. package/dist/indexer/protoScanner.d.ts.map +1 -0
  111. package/dist/indexer/protoScanner.js +133 -0
  112. package/dist/indexer/protoScanner.js.map +1 -0
  113. package/dist/indexer/risk.d.ts +115 -0
  114. package/dist/indexer/risk.d.ts.map +1 -0
  115. package/dist/indexer/risk.js +194 -0
  116. package/dist/indexer/risk.js.map +1 -0
  117. package/dist/indexer/serviceHostScanner.d.ts +25 -0
  118. package/dist/indexer/serviceHostScanner.d.ts.map +1 -0
  119. package/dist/indexer/serviceHostScanner.js +95 -0
  120. package/dist/indexer/serviceHostScanner.js.map +1 -0
  121. package/dist/indexer/serviceLinks.d.ts +105 -0
  122. package/dist/indexer/serviceLinks.d.ts.map +1 -0
  123. package/dist/indexer/serviceLinks.js +509 -0
  124. package/dist/indexer/serviceLinks.js.map +1 -0
  125. package/dist/indexer/shapehash.d.ts +98 -0
  126. package/dist/indexer/shapehash.d.ts.map +1 -0
  127. package/dist/indexer/shapehash.js +354 -0
  128. package/dist/indexer/shapehash.js.map +1 -0
  129. package/dist/indexer/skeleton.d.ts +15 -0
  130. package/dist/indexer/skeleton.d.ts.map +1 -0
  131. package/dist/indexer/skeleton.js +136 -0
  132. package/dist/indexer/skeleton.js.map +1 -0
  133. package/dist/indexer/symbolhistory.d.ts +41 -0
  134. package/dist/indexer/symbolhistory.d.ts.map +1 -0
  135. package/dist/indexer/symbolhistory.js +124 -0
  136. package/dist/indexer/symbolhistory.js.map +1 -0
  137. package/dist/indexer/watcher.d.ts +68 -0
  138. package/dist/indexer/watcher.d.ts.map +1 -0
  139. package/dist/indexer/watcher.js +179 -0
  140. package/dist/indexer/watcher.js.map +1 -0
  141. package/dist/mcp/server.d.ts +80 -0
  142. package/dist/mcp/server.d.ts.map +1 -0
  143. package/dist/mcp/server.js +1610 -0
  144. package/dist/mcp/server.js.map +1 -0
  145. package/dist/parser/index.d.ts +8 -0
  146. package/dist/parser/index.d.ts.map +1 -0
  147. package/dist/parser/index.js +33 -0
  148. package/dist/parser/index.js.map +1 -0
  149. package/dist/parser/languages/cpp.d.ts +3 -0
  150. package/dist/parser/languages/cpp.d.ts.map +1 -0
  151. package/dist/parser/languages/cpp.js +350 -0
  152. package/dist/parser/languages/cpp.js.map +1 -0
  153. package/dist/parser/languages/csharp.d.ts +3 -0
  154. package/dist/parser/languages/csharp.d.ts.map +1 -0
  155. package/dist/parser/languages/csharp.js +239 -0
  156. package/dist/parser/languages/csharp.js.map +1 -0
  157. package/dist/parser/languages/go.d.ts +3 -0
  158. package/dist/parser/languages/go.d.ts.map +1 -0
  159. package/dist/parser/languages/go.js +259 -0
  160. package/dist/parser/languages/go.js.map +1 -0
  161. package/dist/parser/languages/java.d.ts +3 -0
  162. package/dist/parser/languages/java.d.ts.map +1 -0
  163. package/dist/parser/languages/java.js +391 -0
  164. package/dist/parser/languages/java.js.map +1 -0
  165. package/dist/parser/languages/python.d.ts +3 -0
  166. package/dist/parser/languages/python.d.ts.map +1 -0
  167. package/dist/parser/languages/python.js +396 -0
  168. package/dist/parser/languages/python.js.map +1 -0
  169. package/dist/parser/languages/rust.d.ts +3 -0
  170. package/dist/parser/languages/rust.d.ts.map +1 -0
  171. package/dist/parser/languages/rust.js +159 -0
  172. package/dist/parser/languages/rust.js.map +1 -0
  173. package/dist/parser/languages/typescript.d.ts +3 -0
  174. package/dist/parser/languages/typescript.d.ts.map +1 -0
  175. package/dist/parser/languages/typescript.js +1442 -0
  176. package/dist/parser/languages/typescript.js.map +1 -0
  177. package/dist/parser/parserContext.d.ts +77 -0
  178. package/dist/parser/parserContext.d.ts.map +1 -0
  179. package/dist/parser/parserContext.js +354 -0
  180. package/dist/parser/parserContext.js.map +1 -0
  181. package/dist/parser/walker.d.ts +81 -0
  182. package/dist/parser/walker.d.ts.map +1 -0
  183. package/dist/parser/walker.js +217 -0
  184. package/dist/parser/walker.js.map +1 -0
  185. package/dist/parser/worker.d.ts +66 -0
  186. package/dist/parser/worker.d.ts.map +1 -0
  187. package/dist/parser/worker.js +129 -0
  188. package/dist/parser/worker.js.map +1 -0
  189. package/dist/parser/workerpool.d.ts +107 -0
  190. package/dist/parser/workerpool.d.ts.map +1 -0
  191. package/dist/parser/workerpool.js +383 -0
  192. package/dist/parser/workerpool.js.map +1 -0
  193. package/dist/scip/format.d.ts +87 -0
  194. package/dist/scip/format.d.ts.map +1 -0
  195. package/dist/scip/format.js +31 -0
  196. package/dist/scip/format.js.map +1 -0
  197. package/dist/scip/import.d.ts +37 -0
  198. package/dist/scip/import.d.ts.map +1 -0
  199. package/dist/scip/import.js +180 -0
  200. package/dist/scip/import.js.map +1 -0
  201. package/dist/types.d.ts +392 -0
  202. package/dist/types.d.ts.map +1 -0
  203. package/dist/types.js +4 -0
  204. package/dist/types.js.map +1 -0
  205. package/docs/architecture.md +105 -0
  206. package/docs/benchmarks/methodology.md +134 -0
  207. package/docs/benchmarks/raw-results.md +71 -0
  208. package/docs/benchmarks.md +74 -0
  209. package/docs/cli.md +148 -0
  210. package/docs/examples/behavior-tests.md +70 -0
  211. package/docs/examples/change-history.md +85 -0
  212. package/docs/examples/pre-edit-context.md +81 -0
  213. package/docs/examples/service-links.md +88 -0
  214. package/docs/examples.md +80 -0
  215. package/docs/faq.md +70 -0
  216. package/docs/internals.md +104 -0
  217. package/docs/languages.md +70 -0
  218. package/docs/limits.md +52 -0
  219. package/docs/mcp.md +199 -0
  220. package/docs/quickstart.md +119 -0
  221. package/docs/testing.md +123 -0
  222. package/docs/tools.md +115 -0
  223. package/package.json +52 -0
  224. package/research-codebase.md +578 -0
  225. package/seer-cli-docs.md +326 -0
  226. package/seer-master-guide.md +246 -0
  227. package/src/bundle/ci.ts +141 -0
  228. package/src/bundle/contract.ts +387 -0
  229. package/src/bundle/export.ts +175 -0
  230. package/src/bundle/external.ts +285 -0
  231. package/src/bundle/format.ts +92 -0
  232. package/src/bundle/import.ts +157 -0
  233. package/src/cli/index.ts +1249 -0
  234. package/src/cli/init.ts +389 -0
  235. package/src/db/schema.ts +614 -0
  236. package/src/db/store.ts +4306 -0
  237. package/src/graph/pagerank.ts +53 -0
  238. package/src/indexer/architecture.ts +148 -0
  239. package/src/indexer/behavior.ts +466 -0
  240. package/src/indexer/boundaries.ts +374 -0
  241. package/src/indexer/churn.ts +58 -0
  242. package/src/indexer/classify.ts +96 -0
  243. package/src/indexer/context.ts +340 -0
  244. package/src/indexer/continuity.ts +322 -0
  245. package/src/indexer/detectchanges.ts +94 -0
  246. package/src/indexer/discovery.ts +176 -0
  247. package/src/indexer/externaldeps.ts +243 -0
  248. package/src/indexer/freshness.ts +166 -0
  249. package/src/indexer/git.ts +453 -0
  250. package/src/indexer/index.ts +1092 -0
  251. package/src/indexer/modules.ts +358 -0
  252. package/src/indexer/preflight.ts +548 -0
  253. package/src/indexer/protoScanner.ts +147 -0
  254. package/src/indexer/risk.ts +304 -0
  255. package/src/indexer/serviceHostScanner.ts +92 -0
  256. package/src/indexer/serviceLinks.ts +543 -0
  257. package/src/indexer/shapehash.ts +370 -0
  258. package/src/indexer/skeleton.ts +169 -0
  259. package/src/indexer/symbolhistory.ts +172 -0
  260. package/src/indexer/watcher.ts +206 -0
  261. package/src/mcp/server.ts +1659 -0
  262. package/src/parser/index.ts +37 -0
  263. package/src/parser/languages/cpp.ts +361 -0
  264. package/src/parser/languages/csharp.ts +235 -0
  265. package/src/parser/languages/go.ts +259 -0
  266. package/src/parser/languages/java.ts +382 -0
  267. package/src/parser/languages/python.ts +370 -0
  268. package/src/parser/languages/rust.ts +164 -0
  269. package/src/parser/languages/typescript.ts +1435 -0
  270. package/src/parser/parserContext.ts +392 -0
  271. package/src/parser/walker.ts +306 -0
  272. package/src/parser/worker.ts +181 -0
  273. package/src/parser/workerpool.ts +448 -0
  274. package/src/scip/format.ts +83 -0
  275. package/src/scip/import.ts +216 -0
  276. package/src/types.ts +457 -0
  277. package/tests/benchmark-service-links.ts +244 -0
  278. package/tests/bug-regressions.ts +626 -0
  279. package/tests/filters.ts +264 -0
  280. package/tests/fixtures/Counter.tsx +38 -0
  281. package/tests/fixtures/caller.ts +7 -0
  282. package/tests/fixtures/collisions.ts +23 -0
  283. package/tests/fixtures/local_helper.ts +5 -0
  284. package/tests/fixtures/overloads.java +17 -0
  285. package/tests/fixtures/remote_helper.ts +4 -0
  286. package/tests/fixtures/sample.c +15 -0
  287. package/tests/fixtures/sample.cpp +47 -0
  288. package/tests/fixtures/sample.cs +62 -0
  289. package/tests/fixtures/sample.go +68 -0
  290. package/tests/fixtures/sample.h +30 -0
  291. package/tests/fixtures/sample.java +85 -0
  292. package/tests/fixtures/sample.py +46 -0
  293. package/tests/fixtures/sample.rs +78 -0
  294. package/tests/fixtures/sample.ts +76 -0
  295. package/tests/fixtures-service/HttpClients.cs +30 -0
  296. package/tests/fixtures-service/HttpClients.java +24 -0
  297. package/tests/fixtures-service/billing.ts +15 -0
  298. package/tests/fixtures-service/docker-compose.yml +15 -0
  299. package/tests/fixtures-service/gateway.ts +10 -0
  300. package/tests/fixtures-service/get_user.ts +11 -0
  301. package/tests/fixtures-service/graphql_client.ts +63 -0
  302. package/tests/fixtures-service/graphql_server.ts +30 -0
  303. package/tests/fixtures-service/grpc_client.go +30 -0
  304. package/tests/fixtures-service/http_clients.go +23 -0
  305. package/tests/fixtures-service/http_clients.py +38 -0
  306. package/tests/fixtures-service/http_clients.ts +49 -0
  307. package/tests/fixtures-service/k8s/payment-service.yaml +22 -0
  308. package/tests/fixtures-service/k8s_calls.ts +20 -0
  309. package/tests/fixtures-service/messaging.ts +87 -0
  310. package/tests/fixtures-service/trpc_client.ts +39 -0
  311. package/tests/fixtures-service/trpc_server.ts +39 -0
  312. package/tests/fixtures-service/user_service.proto +33 -0
  313. package/tests/fixtures-trackcd/Cargo.toml +11 -0
  314. package/tests/fixtures-trackcd/SpringController.java +36 -0
  315. package/tests/fixtures-trackcd/auth_service.ts +19 -0
  316. package/tests/fixtures-trackcd/complex_module.py +50 -0
  317. package/tests/fixtures-trackcd/express_app.js +30 -0
  318. package/tests/fixtures-trackcd/fastapi_app.py +49 -0
  319. package/tests/fixtures-trackcd/fastify_object_routes.js +32 -0
  320. package/tests/fixtures-trackcd/go.mod +8 -0
  321. package/tests/fixtures-trackcd/package.json +15 -0
  322. package/tests/fixtures-trackcd/requirements.txt +4 -0
  323. package/tests/fixtures-trackcd/tests/auth_service.test.ts +13 -0
  324. package/tests/fixtures-tracke/auth/AuthService.ts +23 -0
  325. package/tests/fixtures-tracke/auth/crypto.ts +7 -0
  326. package/tests/fixtures-tracke/billing/Billing.ts +20 -0
  327. package/tests/fixtures-tracke/billing/Invoice.ts +10 -0
  328. package/tests/fixtures-tracke/billing/server.ts +17 -0
  329. package/tests/fixtures-tracke/package.json +7 -0
  330. package/tests/fixtures-tracke/tests/auth.test.ts +23 -0
  331. package/tests/fixtures-tracke/tests/billing.test.ts +14 -0
  332. package/tests/fixtures-trackf/package.json +5 -0
  333. package/tests/fixtures-trackf/src/auth.ts +26 -0
  334. package/tests/fixtures-trackf/src/handlers.ts +35 -0
  335. package/tests/fixtures-tracki/billing/routes.ts +12 -0
  336. package/tests/fixtures-tracki/gateway/client.ts +13 -0
  337. package/tests/git-features.ts +267 -0
  338. package/tests/init.ts +141 -0
  339. package/tests/mcp-jit.ts +130 -0
  340. package/tests/mcp-smoke.ts +191 -0
  341. package/tests/mcp-trackcd.ts +169 -0
  342. package/tests/mcp-tracke.ts +229 -0
  343. package/tests/mcp-trackf.ts +330 -0
  344. package/tests/mcp-trackg.ts +219 -0
  345. package/tests/mcp-tracki.ts +174 -0
  346. package/tests/mcp-watcher.ts +126 -0
  347. package/tests/optspec.ts +194 -0
  348. package/tests/parallel-index.ts +333 -0
  349. package/tests/parallel-read.ts +125 -0
  350. package/tests/parallel-recovery.ts +241 -0
  351. package/tests/perf-callers.ts +145 -0
  352. package/tests/query-parity.ts +184 -0
  353. package/tests/query-perf.ts +55 -0
  354. package/tests/scale-parallel-parity.ts +225 -0
  355. package/tests/scale-test.ts +523 -0
  356. package/tests/smoke.ts +396 -0
  357. package/tests/trackcd.ts +325 -0
  358. package/tests/tracke-collisions.ts +255 -0
  359. package/tests/tracke.ts +314 -0
  360. package/tests/trackf-bugs.ts +406 -0
  361. package/tests/trackf.ts +390 -0
  362. package/tests/trackg.ts +1372 -0
  363. package/tests/tracki-boundaries.ts +202 -0
  364. package/tests/tracki-continuity.ts +253 -0
  365. package/tests/tracki-contract-diff.ts +249 -0
  366. package/tests/tracki-external-bundles.ts +341 -0
  367. package/tests/tracki-preflight.ts +251 -0
  368. package/tests/verify-roles.ts +51 -0
  369. package/tests/worker-parity.ts +286 -0
  370. package/tests/worker-pool.ts +262 -0
  371. package/tsconfig.json +20 -0
package/docs/mcp.md ADDED
@@ -0,0 +1,199 @@
1
+ # MCP Setup
2
+
3
+ Seer speaks the Model Context Protocol over stdio. Any MCP-capable agent can
4
+ talk to it. The annoying part of MCP is that every client invented its own
5
+ config file, root key, and location, so this page covers all of them, plus a
6
+ command that writes them for you.
7
+
8
+ ---
9
+
10
+ ## The fast path: `seer init`
11
+
12
+ From inside the repo you want indexed:
13
+
14
+ ```bash
15
+ seer init
16
+ ```
17
+
18
+ This writes a project-local MCP config for Claude Code, Cursor, VS Code, Codex,
19
+ and Gemini, and drops an `AGENTS.md` guidance block so the agent knows Seer
20
+ exists and when to call it. It is idempotent: run it again and it leaves
21
+ existing entries alone unless you pass `--force`.
22
+
23
+ ### Options
24
+
25
+ | Flag | What it does |
26
+ |---|---|
27
+ | `--client <names>` | Comma-separated subset: `claude,cursor,vscode,codex,gemini,antigravity`, or `all`. |
28
+ | `--global` | Write the user-level config instead of the project-local one. |
29
+ | `--npx` | Emit a portable `npx -y seer-mcp mcp` launcher (no machine paths). |
30
+ | `--pkg <name>` | Package name for the `--npx` launcher (default `seer-mcp`). |
31
+ | `--command <cmd>` | Override the launch command entirely (advanced). |
32
+ | `--no-agents` | Do not write `AGENTS.md`. |
33
+ | `--print` | Show the plan and the exact snippets without writing anything. |
34
+ | `--force` | Overwrite an existing `seer` entry / `AGENTS.md` block. |
35
+ | `--db <path>` | Use a custom database path in the launcher. |
36
+
37
+ ### What the launcher looks like
38
+
39
+ By default `seer init` writes an absolute-path launcher, which works right now
40
+ without publishing anything:
41
+
42
+ ```
43
+ node /abs/path/to/Seer-Core/dist/cli/index.js mcp --workspace /abs/path/to/your-repo
44
+ ```
45
+
46
+ If you have published or linked the package, `--npx` gives you a portable
47
+ launcher that any teammate can use as-is (it relies on the client starting the
48
+ server with the repo as its working directory):
49
+
50
+ ```
51
+ npx -y seer-mcp mcp
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Manual configuration
57
+
58
+ Prefer to paste it yourself? Here is the exact config for each client. The
59
+ launcher (`command` + `args`) is the same everywhere; only the file location and
60
+ the surrounding keys differ. Replace the path with your absolute path, or use
61
+ the `npx` form.
62
+
63
+ ### Claude Code
64
+
65
+ Project-local: `.mcp.json` at the repo root. User-level: `~/.claude.json`.
66
+
67
+ ```json
68
+ {
69
+ "mcpServers": {
70
+ "seer": {
71
+ "command": "npx",
72
+ "args": ["-y", "seer-mcp", "mcp"]
73
+ }
74
+ }
75
+ }
76
+ ```
77
+
78
+ You can also use the CLI: `claude mcp add seer -- npx -y seer-mcp mcp`.
79
+
80
+ ### Cursor
81
+
82
+ Project-local: `.cursor/mcp.json`. User-level: `~/.cursor/mcp.json`. Same shape
83
+ as Claude Code (the `mcpServers` key).
84
+
85
+ ```json
86
+ {
87
+ "mcpServers": {
88
+ "seer": { "command": "npx", "args": ["-y", "seer-mcp", "mcp"] }
89
+ }
90
+ }
91
+ ```
92
+
93
+ ### VS Code (Copilot / native MCP)
94
+
95
+ Project-local: `.vscode/mcp.json`. Note the different root key (`servers`) and
96
+ the required `type`.
97
+
98
+ ```json
99
+ {
100
+ "servers": {
101
+ "seer": {
102
+ "type": "stdio",
103
+ "command": "npx",
104
+ "args": ["-y", "seer-mcp", "mcp"]
105
+ }
106
+ }
107
+ }
108
+ ```
109
+
110
+ ### OpenAI Codex
111
+
112
+ User-level: `~/.codex/config.toml`. Project-local: `.codex/config.toml`. This one
113
+ is TOML, not JSON.
114
+
115
+ ```toml
116
+ [mcp_servers.seer]
117
+ command = "npx"
118
+ args = ["-y", "seer-mcp", "mcp"]
119
+ ```
120
+
121
+ ### Gemini CLI
122
+
123
+ Project-local: `.gemini/settings.json`. User-level: `~/.gemini/settings.json`.
124
+
125
+ ```json
126
+ {
127
+ "mcpServers": {
128
+ "seer": { "command": "npx", "args": ["-y", "seer-mcp", "mcp"] }
129
+ }
130
+ }
131
+ ```
132
+
133
+ ### Google Antigravity
134
+
135
+ User-level only, shared across the Antigravity IDE and CLI:
136
+ `~/.gemini/config/mcp_config.json`. Uses the `mcpServers` key. Because there is
137
+ no project-local file, `seer init` only touches this one when you ask for it
138
+ (`--client antigravity` or `--client all`).
139
+
140
+ ```json
141
+ {
142
+ "mcpServers": {
143
+ "seer": { "command": "npx", "args": ["-y", "seer-mcp", "mcp"] }
144
+ }
145
+ }
146
+ ```
147
+
148
+ ---
149
+
150
+ ## Letting the agent know Seer exists
151
+
152
+ Configuring the server is half the job. The other half is making sure the agent
153
+ actually reaches for it instead of grepping. `seer init` writes an `AGENTS.md`
154
+ block (the cross-agent convention that Codex, Cursor, Gemini, and Claude Code
155
+ all read) describing what Seer is and the recommended workflow:
156
+
157
+ 1. `seer_health` to confirm the index is live.
158
+ 2. `seer_architecture` or `seer_boundaries` to orient.
159
+ 3. `seer_preflight { symbol }` before editing an unfamiliar symbol.
160
+ 4. `seer_preflight { fromRef, toRef }` for the blast radius of a diff.
161
+ 5. `seer_behavior` / `seer_history` for tests and blame.
162
+ 6. `seer_skeleton { file }` to read a big file cheaply.
163
+
164
+ The block is wrapped in `<!-- seer:begin -->` / `<!-- seer:end -->` markers so a
165
+ re-run updates it cleanly without clobbering the rest of your `AGENTS.md`.
166
+
167
+ ---
168
+
169
+ ## Server options
170
+
171
+ The MCP server itself is `seer mcp`:
172
+
173
+ ```bash
174
+ seer mcp --workspace <repo-path> [--db <path>] [--no-watch] [--no-jit]
175
+ ```
176
+
177
+ - `--workspace` defaults to the current working directory.
178
+ - `--no-watch` disables the background file watcher.
179
+ - `--no-jit` disables the freshness check that runs before each query.
180
+
181
+ The full tool surface is documented in the [Tool Guide](tools.md).
182
+
183
+ ---
184
+
185
+ ## Troubleshooting
186
+
187
+ **The agent does not list any Seer tools.** Reload the MCP servers (most clients
188
+ have a refresh button or need a restart). Confirm the config file is where that
189
+ client expects it, and that `node`/`npx` is on the PATH the client launches with.
190
+
191
+ **First query is slow.** That is the initial index. It runs once, then the cache
192
+ makes everything fast. You can pre-build it with `seer index .`.
193
+
194
+ **"Could not find .seer/graph.db".** A CLI query was run outside the repo. Pass
195
+ `--db <path>` or run from inside the workspace.
196
+
197
+ **Stale results.** Seer hashes files before each query and re-parses anything
198
+ that changed, so this should not happen. If it does, `seer index . --reset`
199
+ rebuilds from scratch.
@@ -0,0 +1,119 @@
1
+ # Quick Start
2
+
3
+ Seer is a local MCP server. You point it at a repo, it builds a small SQLite
4
+ index, and your AI agent can then ask it structural questions instead of
5
+ grepping around. This page gets you from zero to a connected agent.
6
+
7
+ There is no account, no API key, and nothing leaves your machine.
8
+
9
+ ---
10
+
11
+ ## 1. Install
12
+
13
+ You need Node.js 18 or newer (Node 26+ recommended).
14
+
15
+ ### From source (works today)
16
+
17
+ ```bash
18
+ git clone https://github.com/vladimirhegai/Seer-Core.git
19
+ cd Seer-Core
20
+ npm install
21
+ npm run build
22
+ ```
23
+
24
+ That produces the runnable CLI at `dist/cli/index.js`. If you want a global
25
+ `seer` command, link it:
26
+
27
+ ```bash
28
+ npm link # now `seer` is on your PATH
29
+ ```
30
+
31
+ ### From npm
32
+
33
+ Once published, the whole thing collapses to one line that every agent can run
34
+ without a global install:
35
+
36
+ ```bash
37
+ npx -y seer-mcp mcp
38
+ ```
39
+
40
+ ---
41
+
42
+ ## 2. Connect your agent (the easy way)
43
+
44
+ Run `seer init` inside the repo you want indexed. It detects nothing magical;
45
+ it just writes the right MCP config snippet to the right file for each agent,
46
+ and drops an `AGENTS.md` so the agent knows the tool exists and how to use it.
47
+
48
+ ```bash
49
+ seer init
50
+ ```
51
+
52
+ By default it configures the clients that support a project-local config file
53
+ (Claude Code, Cursor, VS Code, Codex, Gemini) and leaves a shareable, committable
54
+ config in your repo. Want everything, including the user-level ones?
55
+
56
+ ```bash
57
+ seer init --client all
58
+ ```
59
+
60
+ Pick specific agents:
61
+
62
+ ```bash
63
+ seer init --client claude,cursor
64
+ ```
65
+
66
+ See exactly what it would write without touching anything:
67
+
68
+ ```bash
69
+ seer init --print
70
+ ```
71
+
72
+ Full options live in [MCP Setup](mcp.md). If you would rather paste the snippet
73
+ yourself, that page has the exact JSON/TOML for every client.
74
+
75
+ ---
76
+
77
+ ## 3. First query
78
+
79
+ Restart (or reload the MCP servers in) your agent. Seer indexes the workspace
80
+ automatically the first time it is queried, so you do not have to run an index
81
+ step by hand. Ask your agent something like:
82
+
83
+ > Call seer_health, then give me the architecture overview.
84
+
85
+ If `seer_health` comes back with a schema version and some role counts, you are
86
+ connected.
87
+
88
+ ---
89
+
90
+ ## 4. Using the CLI directly (optional)
91
+
92
+ The same engine works from a plain shell, which is handy for scripting or just
93
+ poking around:
94
+
95
+ ```bash
96
+ seer index . # build/refresh the index
97
+ seer architecture # one-page overview of the repo
98
+ seer symbols --top 20 # top symbols by PageRank
99
+ seer preflight --symbol foo # everything you need before editing `foo`
100
+ ```
101
+
102
+ The full command list is in the [CLI Reference](cli.md).
103
+
104
+ ---
105
+
106
+ ## Where the index lives
107
+
108
+ Seer writes a single SQLite file to `<repo>/.seer/graph.db`. Add `.seer/` to
109
+ your `.gitignore` if you do not want to commit it. Delete the folder any time;
110
+ it rebuilds on the next query or `seer index`.
111
+
112
+ ---
113
+
114
+ ## Next steps
115
+
116
+ - [MCP Setup](mcp.md) for every client's config and troubleshooting.
117
+ - [Tool Guide](tools.md) for what each MCP tool returns.
118
+ - [Examples](examples.md) for real agent workflows.
119
+ - [Architecture](architecture.md) for how the index is built.
@@ -0,0 +1,123 @@
1
+ # Testing
2
+
3
+ ## The short version
4
+
5
+ Seer ships with a large automated test suite: more than 900 individual checks
6
+ across 37 test files. Every check has to pass before anything is considered
7
+ done, and we keep a strict no-regression rule, so once a bug is fixed it gets a
8
+ test that fails if the bug ever comes back.
9
+
10
+ The tests fall into a few plain-English buckets:
11
+
12
+ | What it checks | In human terms |
13
+ |---|---|
14
+ | Reading code correctly | Does Seer pull the right functions, classes, and calls out of each language? |
15
+ | Not getting confused at scale | Does a huge repo index the same way every time, with no crashes? |
16
+ | Staying fresh | When a file changes, does the next answer reflect it, instantly? |
17
+ | The agent tools | Do the MCP tools return what they promise, including the token-saving ones? |
18
+ | Cross-service tracing | Do calls in one service correctly link to handlers in another? |
19
+ | Edit-impact features | Are risk, tests, history, and blast radius accurate? |
20
+ | Easy install | Does `seer init` write the right config for every agent? |
21
+ | Old bugs | Every bug we ever fixed has a test so it cannot return. |
22
+
23
+ If you just want to confirm everything works on your machine:
24
+
25
+ ```bash
26
+ npm install
27
+ npm test
28
+ ```
29
+
30
+ A green run means all of the above passed.
31
+
32
+ ---
33
+
34
+ ## The categories in a bit more detail
35
+
36
+ **Reading code (smoke tests).** Small hand-written fixtures in each supported
37
+ language. They confirm the parser finds the right symbols, builds the right
38
+ qualified names, and resolves basic calls. This is the foundation; if these
39
+ break, nothing else matters.
40
+
41
+ **Scale and determinism.** Seer indexes real, large open-source repos and checks
42
+ that a second run produces byte-identical counts, that the cache truly
43
+ rehydrates, and that nothing crashes or drifts. This is also where speed is
44
+ measured (see [Benchmarks](benchmarks.md)).
45
+
46
+ **Worker threads.** Parsing runs across multiple threads for speed. These tests
47
+ prove the parallel path produces the exact same result as the simple serial
48
+ path, and that a crashed worker is recovered without corrupting the index.
49
+
50
+ **Freshness and the watcher.** Simulates an agent editing files in bursts and
51
+ confirms the index updates instantly, without stalls, leaks, or duplicate rows,
52
+ and that deleted files are pruned.
53
+
54
+ **The MCP tools.** Drives the actual server the way an agent would, over its
55
+ real protocol, and checks each tool's output. A dedicated optimization spec
56
+ covers the token-budget trimming, the "did you mean" suggestions on typos, the
57
+ file-skeleton renderer, and the batch and trace helpers.
58
+
59
+ **Cross-service links.** Builds small multi-service repos and confirms that an
60
+ outbound call (HTTP, gRPC, tRPC, GraphQL, or a message queue) resolves to the
61
+ right route handler, including across separate repos via bundles.
62
+
63
+ **Edit-impact features.** The risk score, the ranked tests, the per-symbol
64
+ history, the monorepo boundaries, and the rename/move continuity all have their
65
+ own suites with concrete expected values.
66
+
67
+ **Install.** Confirms `seer init` writes valid, mergeable config for Claude
68
+ Code, Cursor, VS Code, Codex, and Gemini, that re-running is safe, and that it
69
+ never clobbers your existing settings.
70
+
71
+ **Regressions.** Every real bug found, including during the pre-release stress
72
+ pass, is pinned with a test in `tests/bug-regressions.ts`, so it cannot quietly
73
+ come back.
74
+
75
+ ---
76
+
77
+ ## Running your own
78
+
79
+ The whole suite:
80
+
81
+ ```bash
82
+ npm test
83
+ ```
84
+
85
+ Just one category (handy while working on a feature):
86
+
87
+ ```bash
88
+ npm run test:smoke # language extractors
89
+ npm run test:mcp # the MCP server + optimization spec
90
+ npm run test:init # the cross-agent installer
91
+ npm run test:tracke # modules, behavior, risk, context
92
+ npm run test:trackg # service links and protocols
93
+ npm run test:tracki # external bundles, contract diff, preflight, boundaries, continuity
94
+ npm run test:regressions # locked-in bug fixes
95
+ ```
96
+
97
+ The large-codebase suite is separate because it needs real repos checked out
98
+ under `Large Codebases/` and takes a while:
99
+
100
+ ```bash
101
+ npm run scale-test # all available codebases
102
+ npm run scale-test -- --only helix,react # a subset
103
+ npm run scale-test -- --skip unreal # exclude the slow ones
104
+ ```
105
+
106
+ It writes a human-readable summary to `tests/outputs/latest.md` and a full
107
+ machine-readable report alongside it.
108
+
109
+ There is also a parity gate that proves the parallel and serial indexers agree
110
+ row-for-row at scale:
111
+
112
+ ```bash
113
+ npm run test:scale-parallel-parity
114
+ ```
115
+
116
+ ---
117
+
118
+ ## What a passing run looks like
119
+
120
+ Each test file prints a line per check and a final tally. A clean run ends with
121
+ every file reporting `PASS` and a zero failure count. If anything fails, the
122
+ exit code is non-zero (so CI catches it) and the failing check prints what it
123
+ expected versus what it got.
package/docs/tools.md ADDED
@@ -0,0 +1,115 @@
1
+ # Tool Guide
2
+
3
+ These are the MCP tools an agent sees once Seer is connected. Everything is
4
+ read-only structural fact: no prose, no summaries, no guessing. If a lookup
5
+ finds nothing, list tools return a `didYouMean` array of close matches rather
6
+ than a dead end.
7
+
8
+ This page is about what each tool is *for*. For exact parameters, every tool
9
+ also self-describes its input schema over MCP, so your agent sees the arguments
10
+ inline.
11
+
12
+ ---
13
+
14
+ ## Start here
15
+
16
+ | Tool | Use it when |
17
+ |---|---|
18
+ | `seer_health` | You want to confirm the index is live and fresh. Cheap. |
19
+ | `seer_architecture` | You just landed in an unfamiliar repo and need the lay of the land. |
20
+ | `seer_preflight` | You are about to edit something, or want a diff's blast radius. |
21
+
22
+ `seer_preflight` is the workhorse. Give it a symbol and it returns the
23
+ definition, who calls it, transitive dependents, the tests that cover it, recent
24
+ commit history, and a risk verdict, all in one call. Give it `fromRef`/`toRef`
25
+ and it maps a git diff to the affected symbols and their blast radius.
26
+
27
+ ---
28
+
29
+ ## Navigation and search
30
+
31
+ - `seer_symbols` (`query?`, `top?`) BM25 search, or top symbols by PageRank.
32
+ - `seer_definition` (`name`, `file?`) exact definition lookup.
33
+ - `seer_file_symbols` (`file`) symbols in a file, in line order.
34
+ - `seer_callers` / `seer_callees` (`symbol`) direct neighbors, with a true count.
35
+ - `seer_search` (`query`) combined symbol + file-path search.
36
+ - `seer_skeleton` (`file`, `focusSymbol?`) render a file as signatures only, with
37
+ bodies collapsed to `{ ... N lines ... }`. Read a 2,000-line file for the cost
38
+ of its outline. `focusSymbol` expands one body verbatim.
39
+
40
+ ## Routes, deps, config
41
+
42
+ - `seer_routes` (`method?`, `framework?`, `pathSubstr?`)
43
+ - `seer_dependencies` (`ecosystem?`, `nameSubstr?`)
44
+ - `seer_config` (`key?`, `source?`)
45
+
46
+ ## Complexity and blast radius
47
+
48
+ - `seer_complexity` (`by?`, `minValue?`) cyclomatic / cognitive / LOC rankings.
49
+ - `seer_behavior` (`symbol`) tests that exercise the symbol, ranked by how
50
+ directly they hit it.
51
+ - `seer_trace_path` (`from`, `to`) shortest call path between two symbols.
52
+ - `seer_trace_callers` / `seer_trace_callees` (`symbol`, `maxDepth?`) transitive
53
+ reachability.
54
+ - `seer_detect_changes` (`fromRef?`, `toRef?`) blast radius for a diff.
55
+
56
+ ## Modules and boundaries
57
+
58
+ - `seer_modules`, `seer_module_members`, `seer_symbol_module`,
59
+ `seer_module_dependencies` Louvain clusters and their edges.
60
+ - `seer_boundaries`, `seer_boundary_for_file`, `seer_boundary_dependencies`
61
+ monorepo package partitions and crossings.
62
+ - `seer_trace_file_dependencies`, `seer_trace_module_dependencies` import BFS.
63
+
64
+ ## History and continuity
65
+
66
+ - `seer_churn` file-level git stats.
67
+ - `seer_history` (`symbol`) per-symbol commit blame chain.
68
+ - `seer_continuity` (`symbol`) rename/move evidence (advisory, confidence-labeled).
69
+
70
+ ## Portability and precision
71
+
72
+ - `seer_bundle_export`, `seer_bundle_info`, `seer_bundle_import` portable
73
+ `.seerbundle` archives.
74
+ - `seer_external_bundles` list imported peer-repo layers.
75
+ - `seer_contract_diff` (`oldBundle`, `newBundle`) advisory API diff across protocols.
76
+ - `seer_scip_import`, `seer_scip_imports`, `seer_provenance` SCIP precision overlays.
77
+ - `seer_duplicates` near-duplicate code clusters via SimHash.
78
+
79
+ ## Service links (cross-service)
80
+
81
+ - `seer_service_calls`, `seer_service_links` outbound calls resolved to handlers.
82
+ - `seer_trace_service_path`, `seer_trace_service_dependencies`,
83
+ `seer_trace_module_service_dependencies` cross-service BFS.
84
+
85
+ ## Unified context
86
+
87
+ - `seer_preflight` consolidated pre-edit packet (symbol or diff-range mode).
88
+ - `seer_context` consolidated symbol context.
89
+ - `seer_risk` decomposed edit-risk analysis.
90
+
91
+ ---
92
+
93
+ ## Tools that save round-trips
94
+
95
+ - `seer_batch` (`calls`) run up to 25 read-only tools in a single request.
96
+ One failing call does not abort the rest. It cannot nest inside itself.
97
+ - `seer_trace` (`scope`, `args?`) a single entry point that dispatches to the
98
+ whole `seer_trace_*` family (`callers`, `callees`, `path`, `file`, `module`,
99
+ `service`, `service_path`, `module_service`).
100
+
101
+ ## Keeping output small
102
+
103
+ The high-volume list tools (`seer_symbols`, `seer_definition`, `seer_callers`,
104
+ `seer_callees`, `seer_complexity`, `seer_service_calls`, `seer_service_links`)
105
+ accept an optional `tokenBudget`. Seer packs the highest-ranked rows until the
106
+ serialized payload would exceed roughly `tokenBudget * 4` characters, then flags
107
+ `truncated: true` with an `omitted` count and a note on how to get the rest. With
108
+ no budget, output is untrimmed and byte-identical to before.
109
+
110
+ ## Tools you usually do not need
111
+
112
+ The heavy derived indexes (modules, shape hashes, symbol history) build
113
+ themselves on first use. The manual `*_build` tools (`seer_modules_build`,
114
+ `seer_symbol_history_build`, `seer_shape_hash_build`) are there only to force a
115
+ rebuild.
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "seer-mcp",
3
+ "version": "0.1.0",
4
+ "description": "Local-first AI codebase explainer — onboarding from months to days",
5
+ "private": false,
6
+ "type": "commonjs",
7
+ "bin": {
8
+ "seer": "./dist/cli/index.js"
9
+ },
10
+ "scripts": {
11
+ "dev": "tsx src/cli/index.ts",
12
+ "build": "tsc",
13
+ "test": "npm run test:smoke && npm run test:parallel && npm run test:trackcd && npm run test:tracke && npm run test:trackf && npm run test:trackg && npm run test:tracki && npm run test:git && npm run test:regressions && npm run test:query-parity && npm run test:filters && npm run test:init && npm run test:parallel-suite && npm run test:mcp && npm run test:bench",
14
+ "test:init": "tsx tests/init.ts",
15
+ "test:parallel-suite": "npm run build && tsx tests/worker-parity.ts && tsx tests/worker-pool.ts && tsx tests/parallel-index.ts && tsx tests/parallel-recovery.ts",
16
+ "test:smoke": "tsx tests/smoke.ts",
17
+ "test:mcp": "npm run build && tsx tests/mcp-smoke.ts && tsx tests/mcp-jit.ts && tsx tests/mcp-watcher.ts && tsx tests/mcp-trackcd.ts && tsx tests/mcp-tracke.ts && tsx tests/mcp-trackf.ts && tsx tests/mcp-trackg.ts && tsx tests/mcp-tracki.ts && tsx tests/optspec.ts",
18
+ "test:parallel": "tsx tests/parallel-read.ts",
19
+ "test:trackcd": "tsx tests/trackcd.ts",
20
+ "test:tracke": "tsx tests/tracke.ts && tsx tests/tracke-collisions.ts",
21
+ "test:trackf": "tsx tests/trackf.ts && tsx tests/trackf-bugs.ts",
22
+ "test:trackg": "tsx tests/trackg.ts",
23
+ "test:tracki": "tsx tests/tracki-external-bundles.ts && tsx tests/tracki-contract-diff.ts && tsx tests/tracki-preflight.ts && tsx tests/tracki-boundaries.ts && tsx tests/tracki-continuity.ts",
24
+ "test:git": "tsx tests/git-features.ts",
25
+ "test:regressions": "tsx tests/bug-regressions.ts",
26
+ "test:query-parity": "tsx tests/query-parity.ts",
27
+ "test:filters": "tsx tests/filters.ts",
28
+ "test:bench": "tsx tests/benchmark-service-links.ts",
29
+ "test:worker-parity": "npm run build && tsx tests/worker-parity.ts",
30
+ "test:worker-pool": "npm run build && tsx tests/worker-pool.ts",
31
+ "test:parallel-index": "npm run build && tsx tests/parallel-index.ts",
32
+ "test:parallel-recovery": "npm run build && tsx tests/parallel-recovery.ts",
33
+ "scale-test": "tsx tests/scale-test.ts",
34
+ "test:scale-parallel-parity": "npm run build && tsx tests/scale-parallel-parity.ts",
35
+ "clean": "rimraf dist"
36
+ },
37
+ "dependencies": {
38
+ "@modelcontextprotocol/sdk": "^1.29.0",
39
+ "chokidar": "^5.0.0",
40
+ "commander": "^12.0.0",
41
+ "fast-glob": "^3.3.2",
42
+ "ignore": "^5.3.1",
43
+ "tree-sitter-wasms": "^0.1.13",
44
+ "web-tree-sitter": "^0.22.0"
45
+ },
46
+ "devDependencies": {
47
+ "@types/node": "^22.0.0",
48
+ "rimraf": "^5.0.5",
49
+ "tsx": "^4.7.0",
50
+ "typescript": "^5.4.0"
51
+ }
52
+ }