@arizeai/phoenix-mcp 2.1.7 → 2.1.8
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 +1 -0
- package/build/index.js +2 -0
- package/build/projectTools.js +48 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,6 +19,7 @@ Phoenix MCP Server is an implementation of the Model Context Protocol for the Ar
|
|
|
19
19
|
|
|
20
20
|
You can use Phoenix MCP Server for:
|
|
21
21
|
|
|
22
|
+
- **Projects Management**: List and explore projects that organize your observability data
|
|
22
23
|
- **Prompts Management**: Create, list, update, and iterate on prompts
|
|
23
24
|
- **Datasets**: Explore datasets, and syntesize new examples
|
|
24
25
|
- **Experiments**: Pull experiment results and visualize them with the help of an LLM
|
package/build/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import minimist from "minimist";
|
|
|
7
7
|
import { initializeDatasetTools } from "./datasetTools.js";
|
|
8
8
|
import { initializeExperimentTools } from "./experimentTools.js";
|
|
9
9
|
import { initializePromptTools } from "./promptTools.js";
|
|
10
|
+
import { initializeProjectTools } from "./projectTools.js";
|
|
10
11
|
import { initializeReadmeResources } from "./readmeResource.js";
|
|
11
12
|
const argv = minimist(process.argv.slice(2));
|
|
12
13
|
// Initialize Phoenix client
|
|
@@ -31,6 +32,7 @@ const server = new McpServer({
|
|
|
31
32
|
initializePromptTools({ client, server });
|
|
32
33
|
initializeExperimentTools({ client, server });
|
|
33
34
|
initializeDatasetTools({ client, server });
|
|
35
|
+
initializeProjectTools({ client, server });
|
|
34
36
|
async function main() {
|
|
35
37
|
// Initialize readme resources first
|
|
36
38
|
if (process.env.DANGEROUSLY_READ_README_FILES === "true") {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
const LIST_PROJECTS_DESCRIPTION = `Get a list of all projects.
|
|
3
|
+
|
|
4
|
+
Projects are containers for organizing traces, spans, and other observability data.
|
|
5
|
+
Each project has a unique name and can contain traces from different applications or experiments.
|
|
6
|
+
|
|
7
|
+
Example usage:
|
|
8
|
+
Show me all available projects
|
|
9
|
+
|
|
10
|
+
Expected return:
|
|
11
|
+
Array of project objects with metadata.
|
|
12
|
+
Example: [
|
|
13
|
+
{
|
|
14
|
+
"id": "UHJvamVjdDox",
|
|
15
|
+
"name": "default",
|
|
16
|
+
"description": "Default project for traces"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "UHJvamVjdDoy",
|
|
20
|
+
"name": "my-experiment",
|
|
21
|
+
"description": "Project for my ML experiment"
|
|
22
|
+
}
|
|
23
|
+
]`;
|
|
24
|
+
export const initializeProjectTools = ({ client, server, }) => {
|
|
25
|
+
server.tool("list-projects", LIST_PROJECTS_DESCRIPTION, {
|
|
26
|
+
limit: z.number().min(1).max(100).default(100).optional(),
|
|
27
|
+
cursor: z.string().optional(),
|
|
28
|
+
includeExperimentProjects: z.boolean().default(false).optional(),
|
|
29
|
+
}, async ({ limit = 100, cursor, includeExperimentProjects = false }) => {
|
|
30
|
+
const response = await client.GET("/v1/projects", {
|
|
31
|
+
params: {
|
|
32
|
+
query: {
|
|
33
|
+
limit,
|
|
34
|
+
cursor,
|
|
35
|
+
include_experiment_projects: includeExperimentProjects,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
content: [
|
|
41
|
+
{
|
|
42
|
+
type: "text",
|
|
43
|
+
text: JSON.stringify(response.data?.data, null, 2),
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
};
|