@lorrylurui/code-intelligence-mcp 1.1.13 → 1.1.14
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/config/env.js +1 -1
- package/dist/index.js +4 -2
- package/package.json +1 -1
package/dist/config/env.js
CHANGED
|
@@ -17,7 +17,7 @@ for (const arg of process.argv) {
|
|
|
17
17
|
// override: false,
|
|
18
18
|
// });
|
|
19
19
|
// MCP Server 本地 .env 路径(固定指向项目根目录)
|
|
20
|
-
const MCP_SERVER_ROOT = path.resolve(__dirname, '..', '..'); // MCP Server 根目录
|
|
20
|
+
const MCP_SERVER_ROOT = path.resolve(__dirname, '..', '..', './dist'); // MCP Server 根目录
|
|
21
21
|
const MCP_SERVER_ENV_PATH = path.resolve(MCP_SERVER_ROOT, '.env');
|
|
22
22
|
dotenv.config({
|
|
23
23
|
path: MCP_SERVER_ENV_PATH,
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
3
|
-
import {
|
|
3
|
+
import { loadProjectDotenv } from './config/env.js';
|
|
4
4
|
import { createServer } from './server/createServer.js';
|
|
5
5
|
async function main() {
|
|
6
|
-
|
|
6
|
+
// 加载第三方项目的 .env(通过 INDEX_ROOT 指定,或默认当前工作目录)
|
|
7
|
+
const projectRoot = process.env.INDEX_ROOT || process.cwd();
|
|
8
|
+
loadProjectDotenv(projectRoot);
|
|
7
9
|
const server = createServer();
|
|
8
10
|
const transport = new StdioServerTransport();
|
|
9
11
|
await server.connect(transport);
|