smart-coding-mcp 1.0.1 → 1.2.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.
package/README.md CHANGED
@@ -30,36 +30,90 @@ This MCP server solves that by indexing your codebase with AI embeddings. Your A
30
30
 
31
31
  ## Installation
32
32
 
33
- ### Prerequisites
33
+ Install globally via npm:
34
34
 
35
- - Node.js 18 or higher
36
- - npm or yarn
35
+ ```bash
36
+ npm install -g smart-coding-mcp
37
+ ```
37
38
 
38
- ### Setup
39
+ ## Configuration
39
40
 
40
- 1. Install dependencies:
41
+ Add to your MCP configuration file (e.g., `~/.config/claude/mcp.json` or similar):
41
42
 
42
- ```bash
43
- npm install
43
+ ### Option 1: Specific Project (Recommended)
44
+
45
+ ```json
46
+ {
47
+ "mcpServers": {
48
+ "smart-coding-mcp": {
49
+ "command": "smart-coding-mcp",
50
+ "args": ["--workspace", "/absolute/path/to/your/project"]
51
+ }
52
+ }
53
+ }
44
54
  ```
45
55
 
46
- 2. Add to your MCP configuration file:
56
+ ### Option 2: Multi-Project Support
57
+
58
+ ```json
59
+ {
60
+ "mcpServers": {
61
+ "smart-coding-mcp-project-a": {
62
+ "command": "smart-coding-mcp",
63
+ "args": ["--workspace", "/path/to/project-a"]
64
+ },
65
+ "smart-coding-mcp-project-b": {
66
+ "command": "smart-coding-mcp",
67
+ "args": ["--workspace", "/path/to/project-b"]
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
73
+ ### Option 3: Auto-Detect Current Directory
47
74
 
48
75
  ```json
49
76
  {
50
77
  "mcpServers": {
51
78
  "smart-coding-mcp": {
52
- "command": "node",
53
- "args": ["/path/to/smart-coding-mcp/index.js"],
54
- "cwd": "/path/to/smart-coding-mcp"
79
+ "command": "smart-coding-mcp"
55
80
  }
56
81
  }
57
82
  }
58
83
  ```
59
84
 
60
- 3. Restart your AI assistant
85
+ ## Environment Variables
86
+
87
+ Override configuration settings via environment variables in your MCP config:
88
+
89
+ | Variable | Type | Default | Description |
90
+ | ----------------------------- | ------- | --------- | ------------------------------ |
91
+ | `SMART_CODING_VERBOSE` | boolean | `false` | Enable detailed logging |
92
+ | `SMART_CODING_BATCH_SIZE` | number | `100` | Files to process in parallel |
93
+ | `SMART_CODING_MAX_FILE_SIZE` | number | `1048576` | Max file size in bytes (1MB) |
94
+ | `SMART_CODING_CHUNK_SIZE` | number | `15` | Lines of code per chunk |
95
+ | `SMART_CODING_MAX_RESULTS` | number | `5` | Max search results |
96
+ | `SMART_CODING_SMART_INDEXING` | boolean | `true` | Enable smart project detection |
97
+
98
+ **Example with environment variables:**
99
+
100
+ ```json
101
+ {
102
+ "mcpServers": {
103
+ "smart-coding-mcp": {
104
+ "command": "smart-coding-mcp",
105
+ "args": ["--workspace", "/path/to/project"],
106
+ "env": {
107
+ "SMART_CODING_VERBOSE": "true",
108
+ "SMART_CODING_BATCH_SIZE": "200",
109
+ "SMART_CODING_MAX_FILE_SIZE": "2097152"
110
+ }
111
+ }
112
+ }
113
+ }
114
+ ```
61
115
 
62
- The server will automatically index your codebase on first run.
116
+ **Note**: The server starts instantly and indexes in the background, so your IDE won't be blocked waiting for indexing to complete.
63
117
 
64
118
  ## Available Tools
65
119
 
@@ -119,7 +173,7 @@ This typically reduces indexed file count by 100x. A project with 50,000 files (
119
173
 
120
174
  ## Configuration
121
175
 
122
- The server works out of the box with sensible defaults. Create a `config.json` file to customize:
176
+ The server works out of the box with sensible defaults. Create a `config.json` file in your workspace to customize:
123
177
 
124
178
  ```json
125
179
  {
@@ -132,6 +186,8 @@ The server works out of the box with sensible defaults. Create a `config.json` f
132
186
  "cacheDirectory": "./.smart-coding-cache",
133
187
  "watchFiles": true,
134
188
  "chunkSize": 15,
189
+ "batchSize": 100,
190
+ "maxFileSize": 1048576,
135
191
  "maxResults": 5
136
192
  }
137
193
  ```
@@ -143,6 +199,8 @@ The server works out of the box with sensible defaults. Create a `config.json` f
143
199
  - `watchFiles`: Automatically reindex when files change (default: true)
144
200
  - `enableCache`: Cache embeddings to disk (default: true)
145
201
  - `chunkSize`: Lines of code per chunk - smaller = more precise, larger = more context (default: 15)
202
+ - `batchSize`: Number of files to process in parallel (default: 100)
203
+ - `maxFileSize`: Skip files larger than this size in bytes (default: 1MB)
146
204
 
147
205
  ## Examples
148
206
 
package/index.js CHANGED
@@ -99,8 +99,11 @@ async function initialize() {
99
99
  features[1].instance = hybridSearch;
100
100
  features[2].instance = cacheClearer;
101
101
 
102
- // Index codebase
103
- await indexer.initialize();
102
+ // Start indexing in background (non-blocking)
103
+ console.error("[Server] Starting background indexing...");
104
+ indexer.initialize().catch(err => {
105
+ console.error("[Server] Background indexing error:", err.message);
106
+ });
104
107
  }
105
108
 
106
109
  // Setup MCP server
package/lib/config.js CHANGED
@@ -136,6 +136,26 @@ export async function loadConfig(workspaceDir = null) {
136
136
  console.error(`[Config] Error: ${error.message}`);
137
137
  }
138
138
 
139
+ // Apply environment variable overrides (prefix: SMART_CODING_)
140
+ if (process.env.SMART_CODING_VERBOSE !== undefined) {
141
+ config.verbose = process.env.SMART_CODING_VERBOSE === 'true';
142
+ }
143
+ if (process.env.SMART_CODING_BATCH_SIZE !== undefined) {
144
+ config.batchSize = parseInt(process.env.SMART_CODING_BATCH_SIZE, 10);
145
+ }
146
+ if (process.env.SMART_CODING_MAX_FILE_SIZE !== undefined) {
147
+ config.maxFileSize = parseInt(process.env.SMART_CODING_MAX_FILE_SIZE, 10);
148
+ }
149
+ if (process.env.SMART_CODING_CHUNK_SIZE !== undefined) {
150
+ config.chunkSize = parseInt(process.env.SMART_CODING_CHUNK_SIZE, 10);
151
+ }
152
+ if (process.env.SMART_CODING_MAX_RESULTS !== undefined) {
153
+ config.maxResults = parseInt(process.env.SMART_CODING_MAX_RESULTS, 10);
154
+ }
155
+ if (process.env.SMART_CODING_SMART_INDEXING !== undefined) {
156
+ config.smartIndexing = process.env.SMART_CODING_SMART_INDEXING === 'true';
157
+ }
158
+
139
159
  return config;
140
160
  }
141
161
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smart-coding-mcp",
3
- "version": "1.0.1",
3
+ "version": "1.2.0",
4
4
  "description": "An extensible MCP server that enhances coding productivity with AI-powered features including semantic code search, intelligent indexing, and more, using local LLMs",
5
5
  "type": "module",
6
6
  "main": "index.js",