Skip to main content
Glama
MCP Workspace Server

MCP Workspace Server

MCP Workspace Server

A lightweight Python MCP server that gives AI agents safe, structured access to files inside a controlled local workspace.

Overview

AI agents often need access to project context stored in local files. Giving an agent unrestricted filesystem access introduces unnecessary security risk.

This project uses the Model Context Protocol (MCP) to expose a small set of controlled workspace tools while restricting access to a configured directory.

Related MCP server: file-reader-mcp

MCP Tools

The server exposes three tools:

list_workspace_files

Lists the files available inside the configured workspace.

read_text_file

Reads UTF-8 text files with configurable size limits.

search_text

Searches workspace documents and returns matching filenames, line numbers, and text.

Security

The server resolves requested paths against a defined workspace root and prevents path traversal outside that directory.

Additional safeguards include:

  • Restricted workspace access

  • Input validation

  • File-size limits

  • UTF-8 handling

  • Path traversal protection

  • Automated security tests

Project Structure

mcp-workspace-server/
├── src/
│   └── mcp_workspace_server/
│       ├── __init__.py
│       └── server.py
├── tests/
│   └── test_paths.py
├── workspace/
│   └── example.txt
├── pyproject.toml
└── README.md

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables Large Language Models to safely browse and interact with local file systems through secure directory listing, file reading, and content search capabilities. Built with comprehensive security controls and high-performance handling of large directories and files.
      1
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables LLM agents to securely explore, read, search, and analyze text-based files within a sandboxed environment.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to safely read and write files in a sandboxed workspace via natural language, with on-demand connection, CVE-hardened path confinement, injection resistance, and full audit logging.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to safely read, write, and search files within a whitelisted sandbox directory, rejecting any attempts to escape the sandbox.
      MIT