Skip to main content
Glama
state.py979 B
"""State tracking for the remote MCP shell session.""" from __future__ import annotations from dataclasses import dataclass, field from typing import Dict @dataclass class RemoteShellState: """Represents mutable session state for the remote shell.""" cwd: str environment: Dict[str, str] = field(default_factory=dict) def build_environment(self, overrides: dict[str, str] | None = None) -> dict[str, str]: """Return the environment dictionary for a command execution.""" merged = dict(self.environment) if overrides: merged.update(overrides) return merged def update_environment(self, updates: dict[str, str]) -> None: """Persistently update the session environment.""" self.environment.update(updates) def remove_environment_keys(self, keys: list[str]) -> None: """Remove environment keys when present.""" for key in keys: self.environment.pop(key, None)

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/FreddyE1982/mcp2term'

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