Skip to main content
Glama
PraneshASP

Foundry MCP Server

by PraneshASP
workspace.ts815 B
import * as fs from "fs/promises"; import * as path from "path"; import * as os from "os"; import { executeCommand, FOUNDRY_PATHS } from "./command.js"; export const FOUNDRY_WORKSPACE_DIR = path.join(os.homedir(), '.mcp-foundry-workspace'); export async function ensureWorkspaceInitialized(): Promise<string> { try { await fs.mkdir(FOUNDRY_WORKSPACE_DIR, { recursive: true }); const isForgeProject = await fs.access(path.join(FOUNDRY_WORKSPACE_DIR, 'foundry.toml')) .then(() => true) .catch(() => false); if (!isForgeProject) { await executeCommand(`cd ${FOUNDRY_WORKSPACE_DIR} && ${FOUNDRY_PATHS.forgePath} init --no-git`); } return FOUNDRY_WORKSPACE_DIR; } catch (error) { console.error("Error initializing workspace:", error); throw error; } }

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/PraneshASP/foundry-mcp-server'

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