Skip to main content
Glama
local-context
by JustinA988

Local Context

Local MCP server for Claude Desktop and Claude Code. It runs on your machine and can:

  • list, search, and read files

  • run one terminal command

  • query SQLite

  • run named tasks on a schedule, without calling Claude

Python 3.11+ is the only requirement. The server does not call the Claude API. Tool results are capped (4,000 characters by default, 16,000 max) so a read cannot dump a whole file into the chat.

Claude Desktop

  1. Install Python 3.11+. On Windows, py -3 --version should work.

  2. Open Settings → Developer → Edit Config. That opens the config file this install actually reads.

  3. Add a server. Use the full path to run.cmd on Windows so the Microsoft Store python stub is not used:

{
  "mcpServers": {
    "local-context": {
      "command": "C:\\path\\to\\local-context\\run.cmd",
      "env": {
        "PYTHONUNBUFFERED": "1",
        "PYTHONIOENCODING": "utf-8",
        "LOCAL_CONTEXT_ROOT": "C:\\path\\to\\folder\\claude\\may\\use"
      }
    }
  }
}

On macOS or Linux, set command to python3 and args to ["/path/to/local-context/run.py"].

  1. Quit Claude completely and open it again.

  2. Settings → Developer → Local MCP servers should list local-context.

LOCAL_CONTEXT_ROOT is the folder Claude may read and use as the shell working directory.

Related MCP server: MCP Server Toolkit

Claude Code

From this directory:

claude --plugin-dir .

From GitHub, add this repository as a marketplace, then install local-context@local-context-market.

Tools

Tool

Returns

list_dir

Names in a directory

search_text

Matching lines

read_file

A text slice (offset continues a capped read)

run_command

One command, output capped

query_sql

SQLite rows, read-only unless you opt in

list_sources / read_source

A data source from config

refresh_source

Status only; command output stays on disk

list_tasks / run_task / task_status

Named local tasks

server_status

Roots, caps, and api_calls=0

Plug in data

Copy config.example.json to config.json (gitignored). Source types: file, directory, json, csv, sqlite, command.

A project can also ship .local-context.json with file, directory, json, csv, or sqlite sources inside that project. It cannot add shell access, tasks, or command sources.

query_sql runs one statement. Writes need "allow_sql_writes": true and a sqlite source with "read_only": false.

Run due tasks without Claude:

py -3 run.py --runner --once

every_seconds: 0 means manual only. Point Task Scheduler or cron at --once.

Limits

The process runs as you. It is not a sandbox.

  • Reads and the shell working directory stay under an allowed root, or a source you configured.

  • Symlinks are followed only when the real file is still inside that area.

  • .claude, .claude.json, and the Claude Desktop credential folders are blocked.

  • Commands do not inherit Anthropic environment variables. Commands that name those credential files, the Anthropic API, encoded PowerShell, disk format, or shutdown are refused.

  • A command can still open some other file by absolute path.

  • Regex search does not allow *, +, ?, or {.

Develop

py -3 -m pip install pytest
py -3 -m pytest

Available Tools

12 tools
list_dirA
Read-only

List names in an allowed directory. Does not read file contents.

Inputs: path, limit.

list_sourcesA
Read-only

List configured external data sources by name and type.

Inputs: no named parameters.

list_tasksB
Read-only

List named local tasks.

Inputs: no named parameters.

query_sqlB
Read-only

Run one SQLite statement. Ad-hoc files are read-only. Rows are capped.

Inputs: sql (required), limit, database.

read_fileC
Read-only

Read a capped text slice. offset is a character offset.

Inputs: path (required), limit, offset.

read_sourceB
Read-only

Read a capped slice of a configured source. pointer is a JSON pointer.

Inputs: name (required), path, limit, offset, +1 more.

refresh_sourceB
Destructive

Run a command source locally and store its output. Returns a short status, not the output.

Inputs: name (required).

run_commandA
Destructive

Run one command inside an allowed root. Output is capped. Anthropic credentials are removed from the child environment.

Inputs: command (required), cwd, timeout_seconds.

run_taskC
Destructive

Run one named task locally and return a capped status.

Inputs: name (required).

search_textA
Read-only

Search text under an allowed root. Returns capped matching lines.

Inputs: query (required), path, limit, regex.

server_statusA
Read-only

Show roots, caps, and that this server makes no Claude API calls.

Inputs: no named parameters.

task_statusB
Read-only

Read a capped slice of the latest stored task output.

Inputs: name, offset.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 12 tools

    Disambiguation4/5

    Tools are mostly distinct by resource and action: files, sources, tasks, commands, SQL, and server status each have clear boundaries. There is mild overlap between read_file/read_source and run_command/run_task/refresh_source, but the descriptions generally help an agent choose correctly.

    Naming Consistency4/5

    Names are consistently snake_case and mostly follow a verb_noun pattern such as list_dir, read_file, run_command, and refresh_source. The two *_status tools break the verb_noun pattern, but the overall convention remains predictable and readable.

    Tool Count5/5

    Twelve tools sit comfortably within the expected 3-15 range for this kind of local-context server. Each tool maps to a clear capability area—file browsing, search, execution, SQL, sources, tasks, and status—with no obvious filler.

    Completeness4/5

    The core local-context workflows are covered: listing, searching, reading, command execution, SQL querying, source access, task execution, and status introspection. Explicit write/edit and create/delete operations for files, sources, or tasks are absent, but run_command provides partial workarounds and some configuration may be external.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Provides Claude Desktop with direct access to your local file system for development tasks, enabling file operations (read, write, edit), directory browsing, command execution, and codebase search within a configured projects directory.
      6
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables Claude to perform file operations, retrieve system information, run calculations, and generate timestamps on the local system.
      -
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables Claude Desktop or other MCP clients to execute shell commands, read/write files, and list directories on the local machine. Includes basic safety guardrails to block obviously destructive operations.
      -