@arizeai/phoenix-mcp 4.0.19 → 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
@@ -105,11 +105,17 @@ When developing, the server requires the following environment variables:
105
105
 
106
106
  - `PHOENIX_API_KEY`: Your Phoenix API key
107
107
  - `PHOENIX_HOST`: The base URL for Phoenix
108
- - `PHOENIX_PROJECT`: Optional default project for project-scoped tools
108
+ - `PHOENIX_PROJECT`: Optional default project for project-scoped tools (alias: `PHOENIX_PROJECT_NAME`)
109
109
  - `PHOENIX_CLIENT_HEADERS`: Optional JSON-encoded request headers
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, ENV_PHOENIX_PROJECT, getHeadersFromEnvironment, 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);
10
- const project = getStrFromEnvironment(ENV_PHOENIX_PROJECT);
5
+ return loadConfigFromEnvironmentWithSources().config;
6
+ }
7
+ function loadConfigFromEnvironmentWithSources() {
8
+ const baseUrl = getStrFromEnvironmentWithSource(ENV_PHOENIX_HOST);
9
+ const { apiKey, headers, source: credentialSource, } = getCredentialsFromEnvironmentWithSource();
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
  }
@@ -3,7 +3,8 @@
3
3
  *
4
4
  * Precedence:
5
5
  * 1. Explicit `projectIdentifier` from the tool call
6
- * 2. Configured default from `PHOENIX_PROJECT` env var or `--project` CLI flag
6
+ * 2. Configured default from `PHOENIX_PROJECT`/`PHOENIX_PROJECT_NAME` env var or
7
+ * `--project` CLI flag
7
8
  */
8
9
  export function resolveProjectIdentifier({ projectIdentifier, defaultProjectIdentifier, }) {
9
10
  const resolved = projectIdentifier?.trim() || defaultProjectIdentifier?.trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arizeai/phoenix-mcp",
3
- "version": "4.0.19",
3
+ "version": "4.1.1",
4
4
  "description": "A MCP server for Arize Phoenix",
5
5
  "keywords": [
6
6
  "arize-phoenix",
@@ -28,14 +28,14 @@
28
28
  "glob": "^13.0.6",
29
29
  "minimist": "^1.2.8",
30
30
  "zod": "^4.4.3",
31
- "@arizeai/phoenix-client": "6.12.0",
32
- "@arizeai/phoenix-config": "0.1.4"
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",
36
36
  "@types/minimist": "^1.2.5",
37
37
  "@types/node": "^25.9.4",
38
- "tsx": "^4.22.4",
38
+ "tsx": "^4.22.5",
39
39
  "vitest": "^4.1.9"
40
40
  },
41
41
  "scripts": {