Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

list_projects

Retrieve all projects within a specified Octopus Deploy space to manage deployment processes, lifecycles, and variables. Filter results by partial name match for targeted access.

Instructions

This tool lists all projects in a given space. Projects let you manage software applications and services, each with their own deployment process, lifecycles, and variables. Projects are where you define what you are deploying and how it should be deployed. The space name is required, if you can't find the space name, ask the user directly for the name of the space. Optionally filter by partial name match using partialName parameter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceNameYes
partialNameNo
skipNo
takeNo

Implementation Reference

  • The handler function for the 'list_projects' tool. It creates an Octopus Deploy client, queries the project repository for the given space with optional filters, and returns a JSON-formatted response containing project details.
    async ({ spaceName, partialName, skip, take }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const projectRepository = new ProjectRepository(client, spaceName); const projectsResponse = await projectRepository.list({ partialName, skip, take }); return { content: [ { type: "text", text: JSON.stringify({ totalResults: projectsResponse.TotalResults, itemsPerPage: projectsResponse.ItemsPerPage, numberOfPages: projectsResponse.NumberOfPages, lastPageNumber: projectsResponse.LastPageNumber, items: projectsResponse.Items.map((project: Project) => ({ spaceId: project.SpaceId, id: project.Id, name: project.Name, description: project.Description, slug: project.Slug, deploymentProcessId: project.DeploymentProcessId, lifecycleId: project.LifecycleId, isDisabled: project.IsDisabled, repositoryUrl: project.PersistenceSettings.Type === "VersionControlled" ? project.PersistenceSettings.Url : null, })), }), }, ], }; }
  • Input schema for the 'list_projects' tool using Zod, defining required 'spaceName' and optional 'partialName', 'skip', 'take' parameters.
    { spaceName: z.string(), partialName: z.string().optional(), skip: z.number().optional(), take: z.number().optional() },
  • The registerListProjectsTool function that registers the 'list_projects' tool on the MCP server, including name, description, input schema, metadata, and handler.
    export function registerListProjectsTool(server: McpServer) { server.tool( "list_projects", `This tool lists all projects in a given space. ${projectsDescription} The space name is required, if you can't find the space name, ask the user directly for the name of the space. Optionally filter by partial name match using partialName parameter.`, { spaceName: z.string(), partialName: z.string().optional(), skip: z.number().optional(), take: z.number().optional() }, { title: "List all projects in an Octopus Deploy space", readOnlyHint: true, }, async ({ spaceName, partialName, skip, take }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const projectRepository = new ProjectRepository(client, spaceName); const projectsResponse = await projectRepository.list({ partialName, skip, take }); return { content: [ { type: "text", text: JSON.stringify({ totalResults: projectsResponse.TotalResults, itemsPerPage: projectsResponse.ItemsPerPage, numberOfPages: projectsResponse.NumberOfPages, lastPageNumber: projectsResponse.LastPageNumber, items: projectsResponse.Items.map((project: Project) => ({ spaceId: project.SpaceId, id: project.Id, name: project.Name, description: project.Description, slug: project.Slug, deploymentProcessId: project.DeploymentProcessId, lifecycleId: project.LifecycleId, isDisabled: project.IsDisabled, repositoryUrl: project.PersistenceSettings.Type === "VersionControlled" ? project.PersistenceSettings.Url : null, })), }), }, ], }; } ); }
  • Registers the tool definition in the TOOL_REGISTRY, specifying toolset 'projects' and read-only, linking to the register function for conditional registration.
    registerToolDefinition({ toolName: "list_projects", config: { toolset: "projects", readOnly: true }, registerFn: registerListProjectsTool, });
  • The top-level registerTools function that iterates over all tool definitions and calls their registerFn if enabled by config.
    export function registerTools(server: McpServer, config: ToolsetConfig = {}) { // Iterate through all registered tools and register those that are enabled for (const [, toolRegistration] of TOOL_REGISTRY) { if (isToolEnabled(toolRegistration, config)) { toolRegistration.registerFn(server); } } }

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/OctopusDeploy/mcp-server'

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