Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official

list_certificates

Retrieve and filter certificates from an Octopus Deploy space to manage SSL/TLS credentials for secure deployments.

Instructions

List certificates in a space

This tool lists all certificates in a given space. The space name is required. You can optionally filter by various parameters like name, archived status, tenant, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceNameYes
skipNo
takeNo
searchNo
archivedNo
tenantNo
firstResultNo
orderByNo
idsNo
partialNameNo

Implementation Reference

  • The handler function that implements the core logic of the 'list_certificates' tool. It creates an Octopus Deploy client, resolves the space ID, fetches certificates with optional filters, maps them using mapCertificateResource, and returns structured JSON data.
    async ({ spaceName, skip, take, search, archived, tenant, firstResult, orderBy, ids, partialName, }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const spaceId = await resolveSpaceId(client, spaceName); const response = await client.get<ResourceCollection<CertificateResource>>( "~/api/{spaceId}/certificates{?skip,take,search,archived,tenant,firstResult,orderBy,ids,partialName}", { spaceId, skip, take, search, archived, tenant, firstResult, orderBy, ids, partialName, } ); const certificates = response.Items.map((cert: CertificateResource) => mapCertificateResource(cert)); return { content: [ { type: "text", text: JSON.stringify({ totalResults: response.TotalResults, itemsPerPage: response.ItemsPerPage, numberOfPages: response.NumberOfPages, lastPageNumber: response.LastPageNumber, items: certificates, }), }, ], }; } );
  • Zod input schema defining the parameters for the 'list_certificates' tool, including required spaceName and optional filters.
    { spaceName: z.string(), skip: z.number().optional(), take: z.number().optional(), search: z.string().optional(), archived: z.boolean().optional(), tenant: z.string().optional(), firstResult: z.number().optional(), orderBy: z.string().optional(), ids: z.array(z.string()).optional(), partialName: z.string().optional(), },
  • Registers the 'list_certificates' tool in the TOOL_REGISTRY with its configuration and registration function for conditional enabling.
    registerToolDefinition({ toolName: "list_certificates", config: { toolset: "certificates", readOnly: true }, registerFn: registerListCertificatesTool, });
  • The function that registers the 'list_certificates' tool directly on the MCP server, specifying name, description, input schema, output hints, and handler.
    export function registerListCertificatesTool(server: McpServer) { server.tool( "list_certificates", `List certificates in a space This tool lists all certificates in a given space. The space name is required. You can optionally filter by various parameters like name, archived status, tenant, etc.`, { spaceName: z.string(), skip: z.number().optional(), take: z.number().optional(), search: z.string().optional(), archived: z.boolean().optional(), tenant: z.string().optional(), firstResult: z.number().optional(), orderBy: z.string().optional(), ids: z.array(z.string()).optional(), partialName: z.string().optional(), }, { title: "List all certificates in an Octopus Deploy space", readOnlyHint: true, }, async ({ spaceName, skip, take, search, archived, tenant, firstResult, orderBy, ids, partialName, }) => { const configuration = getClientConfigurationFromEnvironment(); const client = await Client.create(configuration); const spaceId = await resolveSpaceId(client, spaceName); const response = await client.get<ResourceCollection<CertificateResource>>( "~/api/{spaceId}/certificates{?skip,take,search,archived,tenant,firstResult,orderBy,ids,partialName}", { spaceId, skip, take, search, archived, tenant, firstResult, orderBy, ids, partialName, } ); const certificates = response.Items.map((cert: CertificateResource) => mapCertificateResource(cert)); return { content: [ { type: "text", text: JSON.stringify({ totalResults: response.TotalResults, itemsPerPage: response.ItemsPerPage, numberOfPages: response.NumberOfPages, lastPageNumber: response.LastPageNumber, items: certificates, }), }, ], }; } ); }
  • Supporting utility function that maps the full Octopus Deploy CertificateResource to a simplified object returned by the tool.
    export function mapCertificateResource(cert: CertificateResource) { return { spaceId: cert.SpaceId, id: cert.Id, name: cert.Name, notes: cert.Notes, thumbprint: cert.Thumbprint, subjectDistinguishedName: cert.SubjectDistinguishedName, issuerDistinguishedName: cert.IssuerDistinguishedName, subjectCommonName: cert.SubjectCommonName, subjectOrganization: cert.SubjectOrganization, issuerCommonName: cert.IssuerCommonName, issuerOrganization: cert.IssuerOrganization, notAfter: cert.NotAfter, notBefore: cert.NotBefore, isExpired: cert.IsExpired, version: cert.Version, serialNumber: cert.SerialNumber, signatureAlgorithmName: cert.SignatureAlgorithmName, environmentIds: cert.EnvironmentIds, tenantIds: cert.TenantIds, tenantTags: cert.TenantTags, certificateDataFormat: cert.CertificateDataFormat, archived: cert.Archived, replacedBy: cert.ReplacedBy, selfSigned: cert.SelfSigned, selfSignedCertificateCurve: cert.SelfSignedCertificateCurve, hasPrivateKey: cert.HasPrivateKey, tenantedDeploymentParticipation: cert.TenantedDeploymentParticipation, subjectAlternativeNames: cert.SubjectAlternativeNames, }; }

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