Skip to main content
Glama

Civo MCP Server

networks.ts2.1 kB
import { CIVO_API_KEY, CIVO_API_URL } from './civo.js'; export interface Network { id: string; name: string; default: boolean; cider: string; label: string; } export async function listNetworks(): Promise<Network[]> { const url = `${CIVO_API_URL}/networks`; const response = await fetch(url, { headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${CIVO_API_KEY}`, }, }); if (!response.ok) { throw new Error(`Failed to list networks: ${response.statusText}`); } return await response.json(); } export async function createNetwork(params: { label: string; region?: string; }): Promise<any> { const url = `${CIVO_API_URL}/networks`; const response = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${CIVO_API_KEY}`, }, body: JSON.stringify(params), }); if (!response.ok) { throw new Error(`Failed to create network: ${response.statusText}`); } return await response.json(); } export async function renameNetwork(params: { id: string; label: string; region?: string; }): Promise<any> { const url = `${CIVO_API_URL}/networks/${params.id}`; const response = await fetch(url, { method: 'PUT', headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${CIVO_API_KEY}`, }, body: JSON.stringify({ label: params.label, region: params.region }), }); if (!response.ok) { throw new Error(`Failed to rename network: ${response.statusText}`); } return await response.json(); } export async function deleteNetwork(params: { id: string; region: string; }): Promise<any> { const url = new URL(`${CIVO_API_URL}/networks/${params.id}`); url.searchParams.set('region', params.region); const response = await fetch(url.toString(), { method: 'DELETE', headers: { Authorization: `Bearer ${CIVO_API_KEY}`, }, }); if (!response.ok) { throw new Error(`Failed to delete network: ${response.statusText}`); } return await response.json(); }

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/tao12345666333/civo-mcp'

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