Skip to main content
Glama

Model Context Protocol Server

command.ts4.07 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { buildCommand } from "@stricli/core"; import { numberParser } from "@stricli/core"; import * as z from "zod"; import { ServerRegion } from "../../../lib/config.js"; import { consoleLoggerLevels } from "../../console-logger.js"; import { mcpScopes } from "../../scopes.js"; export const startCommand = buildCommand({ loader: async () => { const { main } = await import("./impl.js"); return main; }, parameters: { flags: { transport: { kind: "enum", brief: "The transport to use for communicating with the server", default: "stdio", values: ["stdio", "sse"], }, port: { kind: "parsed", brief: "The port to use when the SSE transport is enabled", default: "2718", parse: (val: string) => z.coerce.number().int().gte(0).lt(65536).parse(val), }, tool: { kind: "parsed", brief: "Specify tools to mount on the server", optional: true, variadic: true, parse: (value) => { return z.string().parse(value); }, }, scope: { kind: "enum", brief: "Mount tools/resources that match given scope (repeatable flag)", values: mcpScopes, variadic: true, optional: true, }, "api-key": { kind: "parsed", brief: "Sets the api_key auth field for the API", optional: true, parse: (value) => { return z.string().parse(value); }, }, "api-secret": { kind: "parsed", brief: "Sets the api_secret auth field for the API", optional: true, parse: (value) => { return z.string().parse(value); }, }, oauth2: { kind: "parsed", brief: "Sets the oauth2 auth field for the API", optional: true, parse: (value) => { return z.string().parse(value); }, }, "cloud-name": { kind: "parsed", brief: "Allows setting the cloud_name parameter for all supported operations", optional: true, parse: (value) => { return z.string().parse(value); }, }, "server-url": { kind: "parsed", brief: "Overrides the default server URL used by the SDK", optional: true, parse: (value) => new URL(value).toString(), }, "server-index": { kind: "parsed", brief: "Selects a predefined server used by the SDK", optional: true, parse: numberParser, }, region: { kind: "enum", brief: "Sets the region variable for url substitution", optional: true, values: Object.values(ServerRegion) as Array<ServerRegion>, }, "api-host": { kind: "parsed", brief: "Sets the host variable for url substitution", optional: true, parse: (value) => value, }, "log-level": { kind: "enum", brief: "The log level to use for the server", default: "info", values: consoleLoggerLevels, }, env: { kind: "parsed", brief: "Environment variables made available to the server", optional: true, variadic: true, parse: (val: string) => { const sepIdx = val.indexOf("="); if (sepIdx === -1) { throw new Error("Invalid environment variable format"); } const key = val.slice(0, sepIdx); const value = val.slice(sepIdx + 1); return [ z.string().nonempty({ message: "Environment variable key must be a non-empty string", }).parse(key), z.string().nonempty({ message: "Environment variable value must be a non-empty string", }).parse(value), ] satisfies [string, string]; }, }, }, }, docs: { brief: "Run the Model Context Protocol 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/kanwardeep007/random-mcp-server'

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