@reinteractive/rails-insight 1.0.6 → 1.0.7

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
@@ -1,6 +1,6 @@
1
1
  # RailsInsight
2
2
 
3
- [![npm version](https://img.shields.io/npm/v/@reinteractive/railsinsight.svg)](https://www.npmjs.com/package/@reinteractive/railsinsight)
3
+ [![npm version](https://img.shields.io/npm/v/@reinteractive/rails-insight.svg)](https://www.npmjs.com/package/@reinteractive/rails-insight)
4
4
  [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](LICENSE)
5
5
 
6
6
  A Rails-aware codebase indexer that runs as an MCP (Model Context Protocol) server, giving AI coding agents deep structural understanding of your Rails application — models, associations, routes, schema, authentication, jobs, components, and 56 total file categories — without reading every file.
@@ -57,7 +57,7 @@ Add to your Claude Code MCP configuration:
57
57
  "mcpServers": {
58
58
  "railsinsight": {
59
59
  "command": "npx",
60
- "args": ["@reinteractive/rails-insight"]
60
+ "args": ["-y", "@reinteractive/rails-insight"]
61
61
  }
62
62
  }
63
63
  }
@@ -72,7 +72,7 @@ In your `.cursor/mcp.json`:
72
72
  "mcpServers": {
73
73
  "railsinsight": {
74
74
  "command": "npx",
75
- "args": ["@reinteractive/rails-insight"]
75
+ "args": ["-y", "@reinteractive/rails-insight"]
76
76
  }
77
77
  }
78
78
  }
@@ -88,14 +88,15 @@ In your VS Code `.mcp.json` file:
88
88
  {
89
89
  "servers": {
90
90
  "railsinsight": {
91
+ "type": "stdio",
91
92
  "command": "npx",
92
- "args": ["@reinteractive/railsinsight"]
93
+ "args": ["-y", "@reinteractive/rails-insight"]
93
94
  }
94
95
  }
95
96
  }
96
97
  ```
97
98
 
98
- This configuration is required for the VS Code MCP extension, which expects the `servers` block and the package name to be `@reinteractive/railsinsight` (no hyphen).
99
+ Note: VS Code MCP configuration uses the `servers` block (not `mcpServers` as used by Claude Desktop/Cursor). The `"type": "stdio"` field is required.
99
100
 
100
101
  ## Available Tools
101
102
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reinteractive/rails-insight",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Rails-aware codebase indexer — MCP server for AI agents",
5
5
  "type": "module",
6
6
  "bin": {
package/src/server.js CHANGED
@@ -38,6 +38,25 @@ export async function startLocal(projectRoot, options = {}) {
38
38
  const provider = new LocalFSProvider(projectRoot)
39
39
  const verbose = options.verbose || false
40
40
 
41
+ // Connect the transport immediately so VS Code's MCP handshake completes
42
+ // without waiting for the index to be built. Tools return a "not ready"
43
+ // response until state.index is populated below.
44
+ const server = new McpServer({
45
+ name: 'railsinsight',
46
+ version: PKG_VERSION,
47
+ capabilities: { tools: {} },
48
+ })
49
+
50
+ const state = registerTools(server, {
51
+ index: null,
52
+ provider,
53
+ tier: options.tier || 'pro',
54
+ verbose,
55
+ })
56
+
57
+ const transport = new StdioServerTransport()
58
+ await server.connect(transport)
59
+
41
60
  if (verbose) {
42
61
  process.stderr.write(`[railsinsight] Indexing ${projectRoot}...\n`)
43
62
  }
@@ -47,19 +66,11 @@ export async function startLocal(projectRoot, options = {}) {
47
66
  verbose,
48
67
  })
49
68
 
69
+ state.index = index
70
+
50
71
  if (verbose) {
51
- process.stderr.write(`[railsinsight] Index built. Starting MCP server...\n`)
72
+ process.stderr.write(`[railsinsight] Index built.\n`)
52
73
  }
53
-
54
- const server = createServer({
55
- index,
56
- provider,
57
- tier: options.tier || 'pro',
58
- verbose,
59
- })
60
-
61
- const transport = new StdioServerTransport()
62
- await server.connect(transport)
63
74
  }
64
75
 
65
76
  /**
@@ -31,4 +31,6 @@ export function registerTools(server, options) {
31
31
  if (tier === 'pro' || tier === 'team') {
32
32
  registerProTools(server, state)
33
33
  }
34
+
35
+ return state
34
36
  }