Skip to main content
Glama
jfrog

JFrog MCP Server

Official
by jfrog

jfrog_create_local_repository

Set up a local repository in JFrog Artifactory with specific configurations, including package type, project key, and assigned environments, for efficient artifact management.

Instructions

Create a new local repository in artifactroy

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoRepository description
environmentsNoEnvironments to assign the repository to
keyYesthe key of the repository
packageTypeYesPackage type of the repository
projectKeyNoProject key to assign the repository to
rclassYesThe repository type

Implementation Reference

  • The core handler function that executes the JFrog Artifactory API call to create a local repository via PUT request to `/artifactory/api/repositories/{key}` with the provided options.
    export async function createLocalRepository(options: CreateLocalRepositoryOptions) { console.error("Starting createLocalRepository"); const response = await jfrogRequest(`/artifactory/api/repositories/${options.key}`, { method: "PUT", body: options }); return JFrogRepositoryCreateResponseSchema.parse(response); }
  • Zod schemas defining the input structure for creating a local repository: BaseRepositorySchema provides common fields, extended by CreateLocalRepoSchema which fixes rclass to 'local'.
    export const BaseRepositorySchema = z.object({ key: z.string().describe("the key of the repository"), rclass: z.enum([ "local", "remote", "virtual", "federated" ]).describe("The repository type"), packageType: PackageTypeEnum, projectKey: z.string().optional().describe("Project key to assign the repository to"), environments: z.array(z.string()).optional().describe("Environments to assign the repository to"), description: z.string().optional().describe("Repository description") }); export const CreateLocalRepoSchema = BaseRepositorySchema.extend({ rclass: z.literal("local").describe("The repository type") });
  • Tool registration object defining the 'jfrog_create_local_repository' tool, including name, description, input schema, and handler that parses args and delegates to createLocalRepository.
    const createLocalRepositoryTool = { name: "jfrog_create_local_repository", description: "Create a new local repository in artifactroy", inputSchema: zodToJsonSchema(CreateLocalRepoSchema), //outputSchema: zodToJsonSchema(JFrogRepositoryCreateResponseSchema), handler: async (args: any) => { const parsedArgs = CreateLocalRepoSchema.parse(args); return await createLocalRepository(parsedArgs); } };
  • Export of RepositoryTools array that includes the createLocalRepositoryTool for use in the main tools list.
    export const RepositoryTools =[ checkJfrogAvailabilityTool, createLocalRepositoryTool, createRemoteRepositoryTool, createVirtualRepositoryTool, setFolderPropertyTool, listRepositoriesTool ];
  • tools/index.ts:13-23 (registration)
    Global tools array registration where RepositoryTools (containing jfrog_create_local_repository) is spread into the main exported tools list.
    export const tools =[ ...RepositoryTools, ...BuildsTools, ...RuntimeTools, ...AccessTools, ...AQLTools, ...CatalogTools, ...CurationTools, ...PermissionsTools, ...ArtifactSecurityTools, ];

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/jfrog/mcp-jfrog'

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