We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/debugmcpdev/mcp-debugger'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
environment-impl.ts•1.05 KiB
/**
* Environment implementation that wraps Node.js process.env and process.cwd()
*/
import { IEnvironment } from '@debugmcp/shared';
/**
* Production implementation of IEnvironment
* Provides access to real process environment variables and working directory
*/
export class ProcessEnvironment implements IEnvironment {
private readonly envSnapshot: Record<string, string | undefined>;
constructor() {
// Create an immutable snapshot of environment variables at construction time
// This prevents mid-execution environment changes from affecting behavior
this.envSnapshot = { ...process.env };
}
/**
* Get a specific environment variable
*/
get(key: string): string | undefined {
return this.envSnapshot[key];
}
/**
* Get all environment variables
*/
getAll(): Record<string, string | undefined> {
// Return a copy to prevent external modifications
return { ...this.envSnapshot };
}
/**
* Get the current working directory
*/
getCurrentWorkingDirectory(): string {
return process.cwd();
}
}