Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

list_projects

Retrieve all projects in a specified Octopus Deploy space to manage software applications, deployment processes, and variables. Filter results by partial name match for targeted project discovery.

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
partialNameNo
skipNo
spaceNameYes
takeNo

Implementation Reference

  • The core handler function for the 'list_projects' tool. It creates an Octopus Deploy client, queries the project repository for the given space, applies optional filters, and returns a JSON-formatted list of projects.
    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, })), }), }, ], }; }
  • Zod input schema defining parameters for the 'list_projects' tool: required spaceName (string), optional partialName, skip, take (string/number).
    { 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, 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, })), }), }, ], }; } ); }
  • Self-registration of the 'list_projects' tool to the global TOOL_REGISTRY, enabling conditional registration via index.ts.
    registerToolDefinition({ toolName: "list_projects", config: { toolset: "projects", readOnly: true }, registerFn: registerListProjectsTool, });
  • The registerTools function in index.ts that iterates over TOOL_REGISTRY and calls registerFn for enabled tools, including 'list_projects'.
    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