FastCtx

Local Rust stdio server giving coding agents structured file read, search, replace and Bash tools

By yc-duan (individual) Rust Local · stdio Developer toolsFiles and storage

56 popularity score ★ 1.5k ↓ 150/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

Claude CodeTerminal
claude mcp add fastctx -- npx -y fastctx serve
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "fastctx": {
      "command": "npx",
      "args": [
        "-y",
        "fastctx",
        "serve"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "fastctx": {
      "command": "npx",
      "args": [
        "-y",
        "fastctx",
        "serve"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "fastctx": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "fastctx",
        "serve"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.fastctx]
command = "npx"
args = ["-y", "fastctx", "serve"]
Gemini CLITerminal
gemini mcp add --scope user fastctx npx -- -y fastctx serve
Local (from source)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

FirstTerminal
cargo install fastctx --locked
Claude CodeTerminal
claude mcp add fastctx -- fastctx serve
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "fastctx": {
      "command": "fastctx",
      "args": [
        "serve"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "fastctx": {
      "command": "fastctx",
      "args": [
        "serve"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "fastctx": {
      "type": "stdio",
      "command": "fastctx",
      "args": [
        "serve"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.fastctx]
command = "fastctx"
args = ["serve"]
Gemini CLITerminal
gemini mcp add --scope user fastctx fastctx -- serve

Settings 3

FASTCTX_BASH Optional: Absolute path to the GNU Bash used by the Bash tools. The WSL System32\bash.exe launcher is refused. For run, run_background.
FASTCTX_INHERIT_ENVIRONMENT Optional: Set to 0 to skip restoring the user's persisted Windows environment for commands. For run, run_background.
FASTCTX_DISABLE_UPDATE_CHECK Optional: Set to 1 to turn off the update check in the control terminal. serve does no update traffic. For control terminal.

What it does

FastCtx is a single Rust binary that a coding agent talks to over stdio. Instead of having the model build shell one-liners to read or search a repository, it exposes fixed-schema tools: read a file (text with line numbers and paging, images, PDF text or rendered pages, a hex view, legacy encodings), read up to 32 text files in one call, regex search of contents with gitignore handling, file discovery by pattern, and a batch find-and-replace with a dry-run preview. An optional group of five tools runs Bash commands in the foreground or as background jobs that outlive the session, with their output kept under ~/.fastctx/jobs/.

Running `fastctx` with no arguments opens a full-screen control terminal for settings and for writing its own entry into Codex's config.toml and AGENTS.md; ChatGPT App and Codex CLI get this guided setup. Any other MCP client registers `fastctx serve`. Each `serve` process is a thin proxy to one shared per-user background process that holds the search executor and limits; that shared process exits ten minutes after the last host using it is gone.

The source at v0.2.6 (src/server_manifest.rs) registers nine tools and names the reader `inspect_local_file`. The README bundled with the npm 0.2.6 package still calls that tool `read`, which is not a name the server publishes. The same file marks only inspect_local_file, grep, glob, job_output and job_list as read-only; every tool, including `run`, declares destructiveHint=false and openWorldHint=false, so a client that decides on approval from those hints alone will not treat shell commands as destructive.

What it needs

RuntimeNode.js 18+
Runs onmacOS, Windows, Linux
Also
  • GNU Bash for the Bash tools (Git Bash on Windows)

Node.js 18 or later for the npm package, which is a launcher that picks a prebuilt platform package (Windows x64/arm64, Linux x64, macOS x64/arm64); alternatively a Rust toolchain for cargo install. The Bash tools need GNU Bash: Git Bash on Windows, the system Bash on macOS and Linux. The Bash tools stay off until enabled in the control terminal.

Limits

  • Not covered Only the four file tools are published by default. The five Bash and job tools appear once the Bash terminal setting is turned on.
  • Size cap replace accepts files up to 256 MiB by default, settable from 64 MiB to 4096 MiB with [replace] max_file_size_mib.
  • Limit grep/glob use the available CPUs capped at 16 unless [search] max_cpu_cores is set. An invalid value stops sessions from starting.
  • Limit Background jobs have no timeout. Finished job history is capped at 1024 MiB and running jobs at 128 per user by default.
  • Limit Installs through a lagging npm mirror can silently skip the platform package and leave a launcher that cannot start.
  • Early release The main branch README describes an unreleased rebuild around World. This page covers the released 0.2.6 from the v0.2.6 tag.

Only the four file tools are published by default; run, run_background, job_output, job_kill and job_list appear only after the Bash terminal setting is turned on. replace accepts files up to 256 MiB by default (64 MiB to 4096 MiB via [replace] max_file_size_mib). grep/glob parallelism is the available CPUs capped at 16 unless [search] max_cpu_cores is set; an invalid value stops sessions from starting. Background jobs have no timeout; job history is capped at 1024 MiB and running jobs at 128 per user by default. Installs through a lagging npm mirror can silently skip the platform package and leave a launcher that cannot start.

Who it suits

Suits developers using Codex CLI or the ChatGPT App who want structured, paged repository reads and searches instead of improvised shell commands, and who are comfortable with a local process that can write files and, once enabled, run Bash with their own permissions. It runs entirely on the user's machine and needs no account. Clients other than ChatGPT/Codex work through `fastctx serve` but get no guided setup, and some output and approval advice in the docs is Codex-specific. Pick something narrower if you want a read-only file server: replace is on by default and writes.

Tools 9

5 only read, 1 changes things, 3 can delete or overwrite.

inspect_local_file
Reads one file (text with line numbers, image, PDF, hex) or a batch of 1-32 text files, with paging
grep
Regex search of file contents in a file or directory tree, with several output modes
glob
Finds files by path pattern, optionally sorted by path or modification time
replace deletes
Applies pattern-based replacements across files, with dry-run and a replacement cap
run deletes
Runs a Bash command in the foreground and returns output and exit code (Bash terminal setting)
run_background deletes
Starts a Bash command as a background job and returns its id (Bash terminal setting)
job_output
Checks a background job's state and shows output not yet seen, waiting up to wait_ms
job_kill changes
Stops a background job and its whole process tree
job_list
Lists running jobs by default, or retained finished ones

Similar servers