@arizeai/phoenix-mcp 4.1.0 → 4.1.1

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
@@ -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, ENV_PHOENIX_API_KEY, ENV_PHOENIX_CLIENT_HEADERS, ENV_PHOENIX_HOST, getHeadersFromEnvironment, getProjectFromEnvironment, getStrFromEnvironment, } from "@arizeai/phoenix-config";
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
- const baseUrl = getStrFromEnvironment(ENV_PHOENIX_HOST);
8
- const apiKey = getStrFromEnvironment(ENV_PHOENIX_API_KEY);
9
- const headers = getHeadersFromEnvironment(ENV_PHOENIX_CLIENT_HEADERS);
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
- baseUrl: baseUrl || DEFAULT_PHOENIX_ENDPOINT,
13
- apiKey: apiKey || undefined,
14
- headers: headers || undefined,
15
- project: project || undefined,
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 = loadConfigFromEnvironment();
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
- ...getStringCommandLineOptions(commandLineOptions),
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.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "A MCP server for Arize Phoenix",
5
5
  "keywords": [
6
6
  "arize-phoenix",
@@ -28,8 +28,8 @@
28
28
  "glob": "^13.0.6",
29
29
  "minimist": "^1.2.8",
30
30
  "zod": "^4.4.3",
31
- "@arizeai/phoenix-client": "6.12.1",
32
- "@arizeai/phoenix-config": "0.2.0"
31
+ "@arizeai/phoenix-client": "6.12.2",
32
+ "@arizeai/phoenix-config": "0.3.0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/glob": "^9.0.0",