@arizeai/phoenix-mcp 4.1.0 → 4.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 +6 -0
- package/build/config.js +32 -13
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -110,6 +110,12 @@ When developing, the server requires the following environment variables:
|
|
|
110
110
|
|
|
111
111
|
Make sure to set these in a `.env` file. See `.env.example`.
|
|
112
112
|
|
|
113
|
+
At runtime the server also discovers the nearest `.env.phoenix` file at or
|
|
114
|
+
above the working directory. Process environment variables and command-line
|
|
115
|
+
options take precedence. If a higher-priority API key is paired with
|
|
116
|
+
`PHOENIX_HOST` from the file, the server warns once and continues. Set
|
|
117
|
+
`PHOENIX_DISCOVER_CONFIG=false` to disable discovery.
|
|
118
|
+
|
|
113
119
|
## Tool Coverage
|
|
114
120
|
|
|
115
121
|
The MCP server covers the main operational Phoenix workflows:
|
package/build/config.js
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import { DEFAULT_PHOENIX_BASE_URL,
|
|
1
|
+
import { DEFAULT_PHOENIX_BASE_URL, ENV_PHOENIX_HOST, getCredentialsFromEnvironmentWithSource, getProjectFromEnvironment, getStrFromEnvironmentWithSource, warnIfUsingFileEndpointWithCredentials, } from "@arizeai/phoenix-config";
|
|
2
2
|
export const DEFAULT_PHOENIX_ENDPOINT = DEFAULT_PHOENIX_BASE_URL;
|
|
3
|
-
/**
|
|
4
|
-
* Load Phoenix MCP configuration from environment variables.
|
|
5
|
-
*/
|
|
3
|
+
/** Load Phoenix MCP configuration from environment variables. */
|
|
6
4
|
export function loadConfigFromEnvironment() {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
return loadConfigFromEnvironmentWithSources().config;
|
|
6
|
+
}
|
|
7
|
+
function loadConfigFromEnvironmentWithSources() {
|
|
8
|
+
const baseUrl = getStrFromEnvironmentWithSource(ENV_PHOENIX_HOST);
|
|
9
|
+
const { apiKey, headers, source: credentialSource, } = getCredentialsFromEnvironmentWithSource();
|
|
10
10
|
const project = getProjectFromEnvironment();
|
|
11
11
|
return {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
config: {
|
|
13
|
+
baseUrl: baseUrl.value || DEFAULT_PHOENIX_ENDPOINT,
|
|
14
|
+
apiKey: apiKey || undefined,
|
|
15
|
+
headers: headers || undefined,
|
|
16
|
+
project: project || undefined,
|
|
17
|
+
},
|
|
18
|
+
credentialSource,
|
|
19
|
+
endpointSource: baseUrl.source,
|
|
16
20
|
};
|
|
17
21
|
}
|
|
18
22
|
/**
|
|
@@ -39,9 +43,24 @@ function getStringCommandLineOptions(commandLineOptions) {
|
|
|
39
43
|
* parsed by `minimist` do not replace valid environment defaults with boolean `true`.
|
|
40
44
|
*/
|
|
41
45
|
export function resolveConfig({ commandLineOptions, }) {
|
|
42
|
-
const envConfig =
|
|
46
|
+
const { config: envConfig, credentialSource, endpointSource, } = loadConfigFromEnvironmentWithSources();
|
|
47
|
+
const commandLineConfig = getStringCommandLineOptions(commandLineOptions);
|
|
48
|
+
const usesFileEndpoint = endpointSource?.kind === "env-file" &&
|
|
49
|
+
commandLineConfig.baseUrl === undefined;
|
|
50
|
+
const resolvedCredentialSource = commandLineConfig.apiKey !== undefined
|
|
51
|
+
? "command-line options"
|
|
52
|
+
: credentialSource?.kind === "process"
|
|
53
|
+
? "the process environment"
|
|
54
|
+
: undefined;
|
|
55
|
+
if (usesFileEndpoint) {
|
|
56
|
+
warnIfUsingFileEndpointWithCredentials({
|
|
57
|
+
credentialSource: resolvedCredentialSource,
|
|
58
|
+
endpointSource,
|
|
59
|
+
endpointVariable: ENV_PHOENIX_HOST,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
43
62
|
return {
|
|
44
63
|
...envConfig,
|
|
45
|
-
...
|
|
64
|
+
...commandLineConfig,
|
|
46
65
|
};
|
|
47
66
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arizeai/phoenix-mcp",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "A MCP server for Arize Phoenix",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"arize-phoenix",
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"glob": "^13.0.6",
|
|
29
29
|
"minimist": "^1.2.8",
|
|
30
30
|
"zod": "^4.4.3",
|
|
31
|
-
"@arizeai/phoenix-client": "6.
|
|
32
|
-
"@arizeai/phoenix-config": "0.
|
|
31
|
+
"@arizeai/phoenix-client": "6.13.0",
|
|
32
|
+
"@arizeai/phoenix-config": "0.4.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/glob": "^9.0.0",
|
|
36
36
|
"@types/minimist": "^1.2.5",
|
|
37
|
-
"@types/node": "^
|
|
38
|
-
"tsx": "^4.
|
|
39
|
-
"vitest": "^4.1.
|
|
37
|
+
"@types/node": "^26.1.1",
|
|
38
|
+
"tsx": "^4.23.0",
|
|
39
|
+
"vitest": "^4.1.10"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "tsc && chmod 755 build/index.js",
|