Safe File MCP

Safe File MCP is an MCP server that aggregates and loads an entire codebase directly into an LLM context window for streamlined development and editing. It connects AI assistants to local project directories, enabling models to inspect full code context before making changes. Software engineers, full-stack developers, and AI assisted programmers use Safe File MCP with clients like Claude Desktop and Claude Code to overcome fragmented context when writing code that matches existing architectural patterns. The server exposes tools to check codebase size, retrieve token counts, minify or ignore non-essential files, and read or search project directories. In addition to analysis, it provides file manipulation capabilities, including directory creation, moving files, complete file writing, and line-based partial edits via a dedicated edit mode. By executing commands and surfacing repository structure without requiring manual file uploads, Safe File MCP equips language models with the operational background needed to understand multi-file interactions, debug complex issues, and perform targeted project refactoring without losing structural context.

Category: Other & General Purpose

Tags: demonstration, examples, protocol, testing

Visit Safe File MCP

How to install and configure Safe File MCP

  1. In your project directory, start the server using npx context-coder or pass npx context-coder --edit-file-mode to allow partial line edits. 2. Alternatively, run the server using Docker by specifying image: ghcr.io/khromov/context-coder:full with port mapping 3001:3001 in your docker-compose.yml file. 3. For Claude Desktop, configure the client via supergateway: json { "mcpServers": { "context-coder": { "command": "npx", "args": ["-y", "supergateway", "--streamableHttp", "http://localhost:3001/mcp"] } } } 4. For Claude Code, add the server to .mcp.json in your root: json { "mcpServers": { "context-coder": { "command": "npx", "args": ["-y", "context-coder", "--mini", "--stdio"] } } } 5. Restart the client and begin sessions by invoking get_codebase_size and get_codebase.

What you can do with Safe File MCP

  • Ingesting full project contexts by checking codebase token size with get_codebase_size and retrieving formatted project summaries with get_codebase. * Identifying large files with get_codebase_top_largest_files to configure exclusion patterns in .cocoignore or placeholder substitution in .cocominify. * Rewriting complete multi-file modules using write_file to keep implementations aligned with existing code conventions and dependencies. * Performing targeted, line-based partial edits using the edit_file tool when running the server with --edit-file-mode enabled. * Managing workspace files by creating directories, moving files, inspecting directory trees, and executing terminal shell commands within the project environment.

Key facts

  • https://github.com/khromov/safe-file-mcp
  • Other & General Purpose
  • demonstration, examples, protocol, testing

Part of MCP Servers

Related MCP servers

  • MCP Media Player — MCP Media Player is an MCP server that exposes playback controls for Home Assistant media players to AI agents. It…
  • MCP Marvel Rivals — MCP Marvel Rivals is an MCP server that provides access to Marvel Rivals game data through a standardized interface. It…
  • MCP Notify Server — MCP Notify Server is an MCP server that sends desktop notifications accompanied by audio alerts when AI agents complete tasks.…
  • MCP Notification Server — MCP Notification Server is an MCP server that sends periodic notifications at fixed intervals of every 10 seconds. Built around…
  • MCP Minecraft Remote — MCP Minecraft Remote is an MCP server that enables AI assistants to remotely connect to and control a player character…
  • MCP Montano Server — MCP Montano Server is an MCP server that provides a general-purpose TypeScript starter project designed for Model Context Protocol integration.…

How do I install Safe File MCP?

You can run Safe File MCP directly using npx context-coder in your terminal or by pulling the official Docker images such as ghcr.io/khromov/context-coder:full. For Claude Code, you can register the package inside your project configuration file using npx with the mini and stdio flags.

What tools does Safe File MCP provide?

Safe File MCP provides tools to evaluate and manipulate your project files. These include get_codebase_size, get_codebase, get_codebase_top_largest_files, read_file, write_file, edit_file for line-based edits, create_directory, list_directory, directory_tree, move_file, search_files, and execute_command for shell execution.

Which MCP clients work with Safe File MCP?

Safe File MCP is designed to integrate with Claude Desktop and Claude Code. Claude Desktop connects either through a local HTTP stream managed by supergateway on port 3001 or through Docker containers. Claude Code integrates directly using standard input and output with npx or Docker.

How do I exclude large files from the AI context?

You can exclude unwanted files and directories by creating a .cocoignore file in your repository root, matching standard gitignore syntax. To keep files visible without loading full contents, create a .cocominify file, which substitutes file bodies with placeholders to conserve context tokens.

What is the difference between full write and edit file mode?

By default, the server expects complete file overwrites using the write_file tool to ensure file consistency. When you pass the --edit-file-mode flag or set the CONTEXT_CODER_EDIT_MODE environment variable, the server exposes the edit_file tool, allowing the model to perform line-based partial changes.

  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories