Skip to main content
Glama

DevDb MCP Server

sail.ts1.25 kB
import { join } from "path"; import { parse } from 'yaml' import { fileExists, getBasePath, getWorkspaceFileContent } from "../workspace"; import { getEnvFileValue } from "./laravel-core"; import { KnexClientType } from "../../types"; export async function hasLaravelSailDockerComposeFile() { const workspacePath = getBasePath() if (!workspacePath) return false const dockerComposeFilePath = join(workspacePath, 'docker-compose.yml'); const exists = await fileExists(dockerComposeFilePath) return exists } export async function getPortFromDockerCompose(dialect: KnexClientType): Promise<number | undefined> { const dockerComposeContent = (getWorkspaceFileContent('docker-compose.yml'))?.toString() if (!dockerComposeContent) return const dockerComposeParsed = parse(dockerComposeContent) const portDefinition: string = dockerComposeParsed.services?.[dialect]?.ports[0].toString() if (!portDefinition) return // Match string like '${FORWARD_DB_PORT:-3307}:3306' where FORWARD_DB_PORT and 3307 are captured const match = portDefinition.match(/\${(\w+):-(\d+)}:\d+/) if (!match) return const [, envVariable, defaultPort,] = match const port: string = await getEnvFileValue(envVariable) || defaultPort return parseInt(port) }

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/damms005/devdb-vscode'

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