Skip to main content
Glama
jfrog

JFrog MCP Server

Official
by jfrog

jfrog_create_virtual_repository

Aggregate multiple repositories into a unified virtual repository in Artifactory, supporting various package types and customizable patterns for artifact inclusion and exclusion.

Instructions

Create a new virtual repository in Artifactory that aggregates multiple repositories

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
artifactoryRequestsCanRetrieveRemoteArtifactsNo
debianDefaultArchitecturesNoDefault architectures for Debian repositories
debianTrivialLayoutNoWhether to use trivial layout for Debian repositories
defaultDeploymentRepoNoDefault deployment repository
descriptionNoThe virtual repository public description
environmentsNoEnvironments to assign the repository to
excludesPatternNoPattern to define artifacts to exclude
externalDependenciesEnabledNoEnable external dependencies (Bower, npm, Go)
externalDependenciesPatternsNoPatterns for external dependencies
externalDependenciesRemoteRepoNoRemote repository for external dependencies
forceMavenAuthenticationNoForce authentication for Maven repositories
includesPatternNoPattern to define artifacts to include**/*
keyYesthe key of the repository
keyPairNoKey pair used for signing
notesNoSome internal notes
optionalIndexCompressionFormatsNo
packageTypeYesPackage type of the repository
pomRepositoryReferencesCleanupPolicyNodiscard_active_reference
primaryKeyPairRefNoPrimary GPG key pair reference
projectKeyNoProject key to assign the repository to
rclassYesThe repository type
repoLayoutRefNoRepository layout reference
repositoriesYesList of repository keys to include in the virtual repository
secondaryKeyPairRefNoSecondary GPG key pair reference

Implementation Reference

  • Tool registration for 'jfrog_create_virtual_repository', including the handler function that validates input with CreateVirtualRepoSchema and calls the createVirtualRepository helper.
    const createVirtualRepositoryTool = { name: "jfrog_create_virtual_repository", description: "Create a new virtual repository in Artifactory that aggregates multiple repositories", inputSchema: zodToJsonSchema(CreateVirtualRepoSchema), //outputSchema: zodToJsonSchema(JFrogRepositoryCreateResponseSchema), handler: async (args: any) => { const parsedArgs = CreateVirtualRepoSchema.parse(args); return await createVirtualRepository(parsedArgs); } };
  • Input schema (Zod) for the jfrog_create_virtual_repository tool, defining parameters like repositories list, patterns, and virtual repo options.
    export const CreateVirtualRepoSchema = BaseRepositorySchema.extend({ rclass: z.literal("virtual").describe("The repository type"), repositories: z.array(z.string()).describe("List of repository keys to include in the virtual repository"), description: z.string().optional().describe("The virtual repository public description"), notes: z.string().optional().describe("Some internal notes"), includesPattern: z.string().default("**/*").describe("Pattern to define artifacts to include"), excludesPattern: z.string().default("").describe("Pattern to define artifacts to exclude"), repoLayoutRef: z.string().optional().describe("Repository layout reference"), debianTrivialLayout: z.boolean().default(false).describe("Whether to use trivial layout for Debian repositories"), debianDefaultArchitectures: z.string().optional().describe("Default architectures for Debian repositories"), artifactoryRequestsCanRetrieveRemoteArtifacts: z.boolean().default(false), keyPair: z.string().optional().describe("Key pair used for signing"), pomRepositoryReferencesCleanupPolicy: z.enum([ "discard_active_reference", "discard_any_reference", "nothing" ]).default("discard_active_reference"), defaultDeploymentRepo: z.string().optional().describe("Default deployment repository"), optionalIndexCompressionFormats: z.array(z.enum(["bz2", "lzma", "xz"])).optional(), forceMavenAuthentication: z.boolean().default(false).describe("Force authentication for Maven repositories"), externalDependenciesEnabled: z.boolean().default(false).describe("Enable external dependencies (Bower, npm, Go)"), externalDependenciesPatterns: z.array(z.string()).optional().describe("Patterns for external dependencies"), externalDependenciesRemoteRepo: z.string().optional().describe("Remote repository for external dependencies"), primaryKeyPairRef: z.string().optional().describe("Primary GPG key pair reference"), secondaryKeyPairRef: z.string().optional().describe("Secondary GPG key pair reference") });
  • Core helper function implementing the JFrog API call to create a virtual repository via PUT request to /artifactory/api/repositories/{key}.
    export async function createVirtualRepository(options: z.infer<typeof CreateVirtualRepoSchema>) { const response = await jfrogRequest(`/artifactory/api/repositories/${options.key}`, { method: "PUT", body: options }); return JFrogRepositoryCreateResponseSchema.parse(response); }
  • Export of RepositoryTools array registering the jfrog_create_virtual_repository tool (at line 172). This array is imported and spread into the main tools list.
    export const RepositoryTools =[ checkJfrogAvailabilityTool, createLocalRepositoryTool, createRemoteRepositoryTool, createVirtualRepositoryTool, setFolderPropertyTool, listRepositoriesTool ];
  • tools/index.ts:13-23 (registration)
    Main tools registration array in index.ts that includes all tools by spreading RepositoryTools (containing jfrog_create_virtual_repository).
    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