Skip to main content
Glama
comet-ml

Opik MCP Server

by comet-ml

create-project

Set up a new project or workspace by specifying its name and optional details using the Model Context Protocol on the Opik MCP Server.

Instructions

Create a new project/workspace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoDescription of the project
nameYesName of the project
workspaceNameNoWorkspace name to use instead of the default

Implementation Reference

  • The main handler function for the 'create-project' tool. It extracts arguments, constructs a POST request body, calls makeApiRequest to the /v1/private/projects endpoint, and returns a text response indicating success or error.
    async (args: any) => {
      const { name, description, workspaceName } = args;
      const requestBody: any = { name };
      if (description) requestBody.description = description;
    
      const response = await makeApiRequest<any>(
        `/v1/private/projects`,
        {
          method: 'POST',
          body: JSON.stringify(requestBody),
        },
        workspaceName
      );
    
      return {
        content: [
          {
            type: 'text',
            text: response.error || 'Successfully created project',
          },
        ],
      };
    }
  • Zod input schema for the create-project tool defining required 'name' and optional 'description' and 'workspaceName' parameters.
    {
      name: z.string().min(1).describe('Name of the project'),
      description: z.string().optional().describe('Description of the project'),
      workspaceName: z.string().optional().describe('Workspace name to use instead of the default'),
    },
  • Registers the 'create-project' tool on the MCP server within the loadProjectTools function, specifying name, description, input schema, and handler.
    server.tool(
      'create-project',
      'Create a new project',
      {
        name: z.string().min(1).describe('Name of the project'),
        description: z.string().optional().describe('Description of the project'),
        workspaceName: z.string().optional().describe('Workspace name to use instead of the default'),
      },
      async (args: any) => {
        const { name, description, workspaceName } = args;
        const requestBody: any = { name };
        if (description) requestBody.description = description;
    
        const response = await makeApiRequest<any>(
          `/v1/private/projects`,
          {
            method: 'POST',
            body: JSON.stringify(requestBody),
          },
          workspaceName
        );
    
        return {
          content: [
            {
              type: 'text',
              text: response.error || 'Successfully created project',
            },
          ],
        };
      }
    );
  • src/index.ts:86-88 (registration)
    Top-level conditional registration of project tools, including 'create-project', by invoking loadProjectTools when the 'projects' toolset is enabled in configuration.
    if (config.enabledToolsets.includes('projects')) {
      server = loadProjectTools(server);
      logToFile('Loaded projects toolset');

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/comet-ml/opik-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server