Skip to main content
Glama

workspace-mcp

A small, safety-first local MCP server for one bounded code workspace.

Requires Python 3.10–3.13. Python 3.11 or 3.12 is recommended. The MCP Python SDK does not support Python 3.9, and Python 3.14 is not enabled until the dependency stack is verified there.

Install and run

Use pipx for the CLI application, or a dedicated virtual environment. Do not install into the macOS system/Homebrew environment:

brew install pipx python@3.11
pipx ensurepath
pipx install --python python3.11 ./workspace_mcp-0.3.2-py3-none-any.whl

Equivalent virtual-environment installation:

python3.11 -m venv ~/.venvs/workspace-mcp
~/.venvs/workspace-mcp/bin/python -m pip install -U pip
~/.venvs/workspace-mcp/bin/python -m pip install workspace_mcp-0.3.2-py3-none-any.whl
cd /path/to/project
~/.venvs/workspace-mcp/bin/workspace-mcp

The default transport is MCP stdio, so it should be launched by Codex or another MCP client. Running workspace-mcp directly in an interactive terminal prints a ready-to-run codex mcp add command for the current directory and exits instead of waiting indefinitely. For a manual local HTTP test:

workspace-mcp --transport streamable-http --port 8765 --max-port 8865

If the requested HTTP port is busy, the server selects the first available port in the configured range. It binds to 127.0.0.1 by default and rejects non-loopback hosts unless --allow-network is explicitly supplied. HTTP mode has no built-in authentication, so do not use --allow-network on an untrusted network.

Related MCP server: chatbottool-mcp

Safety contract

  • The current directory is the only workspace root by default.

  • Absolute paths, .. traversal, and symlink escapes are rejected.

  • File reads and writes are UTF-8 and size-limited.

  • Edits use a line-range replacement with a mandatory SHA-256 optimistic lock.

  • No arbitrary shell tool is exposed.

  • git_diff is read-only and runs only in the bounded workspace.

The initial tool set is workspace_root, list_files, read_file, search_text, replace_range, and git_diff. Add a separately reviewed allowlisted run_check tool only if needed.

Platform note

The package and CLI are cross-platform, but v0.3.2 file access intentionally fails closed unless Python exposes secure POSIX dir_fd, O_NOFOLLOW, atomic rename, and flock primitives. A native Windows handle-relative implementation is required before claiming cross-platform file access or editing support.

Available Tools

6 tools
git_diffA

Return the current Git diff for the workspace.

Inputs: no named parameters. Returns: result

list_filesB

List files and directories below the bounded workspace.

Inputs: glob. Returns: result

read_fileA

Read a UTF-8 text file using a 1-based inclusive line range.

Inputs: path (required), end_line, start_line. Returns: result

replace_rangeA

Atomically replace an inclusive line range using a mandatory optimistic-lock hash.

Inputs: path (required), end_line (required), start_line (required), replacement (required), +1 more. Returns: object

search_textB

Search UTF-8 text files within the workspace.

Inputs: query (required), glob, max_results. Returns: result

workspace_rootA

Return the single directory this server can access.

Inputs: no named parameters. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct operation: workspace info, listing, reading, searching, editing, and diffing. There is no meaningful overlap or ambiguity between any two tools.

    Naming Consistency4/5

    Most tools follow a clear verb_noun pattern (list_files, read_file, search_text, replace_range). workspace_root and git_diff are minor deviations but remain readable and do not confuse the overall convention.

    Tool Count5/5

    Six tools is well-scoped for a workspace file server. Each tool earns its place and there is no redundancy or unnecessary bloat.

    Completeness3/5

    The set covers listing, reading, searching, updating, and diffing, but lacks create and delete operations for files or directories. This is a notable gap for a file workspace toolset and will leave some workflows incomplete.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A local-first MCP server providing guarded access to a workspace with file operations, search, commands, tests, Git helpers, checkpoints, and structured tool results. It supports multiple tool modes and emphasizes security with workspace restrictions and secret blocking.
      1
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      A security-first MCP server that enables clients to inspect and edit multiple local repositories via configured aliases, with read-only Git access and allowlisted test commands.
      4
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      A minimal, security-focused MCP server that provides structured read/write access to exactly one local workspace, with built-in local Git checkpoints and rollback.
      Apache 2.0