Skip to main content
Glama
OctopusDeploy

Octopus Deploy MCP Server

Official
getClientConfigurationFromEnvironment.ts1.44 kB
import { type ClientConfiguration } from "@octopusdeploy/api-client"; import { env } from "process"; import { SEMVER_VERSION } from "../index.js"; import { getClientInfo } from "../utils/clientInfo.js"; const USER_AGENT_NAME = "octopus-mcp-server"; export interface ConfigurationOptions { instanceURL?: string; apiKey?: string; } function isEmpty(value: string | undefined): value is undefined | "" { return !value || value.trim().length === 0; } function constructUserAgent(): string { const clientInfo = getClientInfo(); const userAgent = `${USER_AGENT_NAME}/${SEMVER_VERSION} (${clientInfo.name}/${clientInfo.version})`; return userAgent; } function getClientConfiguration(options: ConfigurationOptions = {}): ClientConfiguration { if (isEmpty(options.instanceURL) || isEmpty(options.apiKey)) { throw new Error( "Octopus server URL and API key must be provided either via command line arguments (--server-url, --api-key) or environment variables (OCTOPUS_SERVER_URL, OCTOPUS_API_KEY)." ); } const userAgent = constructUserAgent(); return { userAgentApp: userAgent, instanceURL: options.instanceURL, apiKey: options.apiKey, }; } export function getClientConfigurationFromEnvironment(): ClientConfiguration { return getClientConfiguration({ instanceURL: env["CLI_SERVER_URL"] || env["OCTOPUS_SERVER_URL"], apiKey: env["CLI_API_KEY"] || env["OCTOPUS_API_KEY"], }); }

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