Skip to content

Commit 65a5ed9

Browse files
author
Dev Agent Amelia
committed
fix: add MCP_CONFIG_PATH support + bump to v0.1.7
1 parent 5c23394 commit 65a5ed9

4 files changed

Lines changed: 18 additions & 9 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mcp-dataverse",
3-
"version": "0.1.6",
3+
"version": "0.1.7",
44
"description": "MCP Server for Microsoft Dataverse Web API",
55
"type": "module",
66
"main": "dist/server.js",

server.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,30 @@
1515
"url": "https://github.com/codeurali/mcp-dataverse",
1616
"source": "github"
1717
},
18-
"version": "0.1.6",
18+
"version": "0.1.7",
1919
"packages": [
2020
{
2121
"registryType": "npm",
2222
"registryBaseUrl": "https://registry.npmjs.org",
2323
"identifier": "mcp-dataverse",
24-
"version": "0.1.6",
24+
"version": "0.1.7",
2525
"transport": {
2626
"type": "stdio"
2727
},
2828
"environmentVariables": [
29+
{
30+
"name": "MCP_CONFIG_PATH",
31+
"description": "Path to a config.json file (overrides all other env vars). Recommended for VS Code / Claude Desktop setups.",
32+
"placeholder": "/path/to/config.json",
33+
"isRequired": false,
34+
"format": "string",
35+
"isSecret": false
36+
},
2937
{
3038
"name": "DATAVERSE_ENV_URL",
3139
"description": "Your Dataverse environment URL",
3240
"placeholder": "https://yourorg.crm.dynamics.com",
33-
"isRequired": true,
41+
"isRequired": false,
3442
"format": "string",
3543
"isSecret": false
3644
},

src/config/config.loader.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import { ConfigSchema, type Config } from "./config.schema.js";
55
const CONFIG_FILE_NAME = "config.json";
66

77
export function loadConfig(): Config {
8-
// Priority: env vars > config.json > defaults
9-
const configPath = join(process.cwd(), CONFIG_FILE_NAME);
8+
// Priority: env vars > MCP_CONFIG_PATH file > cwd/config.json > defaults
9+
const configPath =
10+
process.env["MCP_CONFIG_PATH"] ?? join(process.cwd(), CONFIG_FILE_NAME);
1011

1112
let rawConfig: Record<string, unknown> = {};
1213

@@ -16,7 +17,7 @@ export function loadConfig(): Config {
1617
rawConfig = JSON.parse(fileContent) as Record<string, unknown>;
1718
} catch {
1819
throw new Error(
19-
`Invalid JSON in ${CONFIG_FILE_NAME}. Check for syntax errors (trailing commas, missing quotes).`,
20+
`Invalid JSON in ${configPath}. Check for syntax errors (trailing commas, missing quotes).`,
2021
);
2122
}
2223
}

0 commit comments

Comments
 (0)