@lorrylurui/code-intelligence-mcp 1.1.7 → 1.1.9

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/.env ADDED
@@ -0,0 +1,24 @@
1
+ MYSQL_ENABLED=true
2
+ MYSQL_HOST=127.0.0.1
3
+ MYSQL_PORT=3306
4
+ MYSQL_USER=root
5
+ # 与 docker-compose.yml 中 MYSQL_ROOT_PASSWORD 一致(默认 devpassword,仅本地开发)
6
+ MYSQL_PASSWORD=devpassword
7
+ MYSQL_DATABASE=code_intelligence
8
+ MYSQL_SYMBOLS_TABLE=symbols
9
+ EMBEDDING_SERVICE_URL=http://127.0.0.1:8765
10
+
11
+ # MCP Server 传输模式:stdio | http
12
+ MCP_TRANSPORT=stdio
13
+ # HTTP 模式监听地址,0.0.0.0 支持局域网访问,公网用公网IP
14
+ MCP_HOST=0.0.0.0
15
+ # HTTP 模式端口
16
+ MCP_PORT=3000
17
+ # Docker Compose 可选:与 .env 同步(compose 会读环境变量覆盖默认值)
18
+ # MYSQL_ROOT_PASSWORD=devpassword
19
+
20
+ # Phase 2 索引(npm run index)
21
+ # INDEX_ROOT=
22
+ # INDEX_GLOB=src/**/*.{ts,tsx}
23
+ # INDEX_IGNORE=**/generated/**,**/*.spec.ts
24
+ GIT_CI_MOCK_SERVER=false
File without changes
@@ -16,11 +16,21 @@ dotenv.config({
16
16
  path: path.resolve(projectRoot, '.env'),
17
17
  override: false,
18
18
  });
19
+ // MCP Server 本地 .env 路径(固定指向项目根目录)
20
+ const MCP_SERVER_ROOT = path.resolve(__dirname, '..', '..');
21
+ const MCP_SERVER_ENV_PATH = path.resolve(MCP_SERVER_ROOT, '.env');
19
22
  /**
20
23
  * 从指定项目根目录加载 .env 到 process.env
21
24
  * 行为:优先使用第三方显式设置的值,否则保留 MCP Server 本地配置
22
25
  */
23
26
  export function loadProjectDotenv(projectRoot) {
27
+ // 先确保加载 MCP Server 本地的 .env(如果尚未加载)
28
+ if (existsSync(MCP_SERVER_ENV_PATH) && !process.env.MYSQL_ENABLED) {
29
+ dotenv.config({
30
+ path: MCP_SERVER_ENV_PATH,
31
+ override: false,
32
+ });
33
+ }
24
34
  const envPath = path.resolve(projectRoot, '.env');
25
35
  if (!existsSync(envPath)) {
26
36
  return;
package/dist/index.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lorrylurui/code-intelligence-mcp",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "private": false,
5
5
  "description": "MCP server 提供仓库内可复用代码块(ts/tsx/js/jsx/css/less)的索引和查询能力,支持基于代码上下文的智能推荐。",
6
6
  "type": "module",