Skip to main content
Glama

File System MCP

A CLI chat app that uses the Model Context Protocol (MCP) to let an LLM manage your filesystem. Ask questions, reference documents with @, and run commands like /summarize — all from your terminal.

How It Works

The app starts an MCP server as a subprocess and connects to it over stdio. When you send a message, it's forwarded to OpenAI with the MCP tools (read, create, edit, delete documents) available as function calls. The LLM decides which tools to invoke, and the results are streamed back to you.

You → CLI → OpenAI (with MCP tools) → MCP Server → Filesystem

Related MCP server: mcp-file-servers

Prerequisites

Setup

1. Configure environment variables

Copy or edit .env in the project root:

OPENAI_API_KEY="sk-..."
OPENAI_MODEL="gpt-4o"
USE_UV=1

Variable

Description

OPENAI_API_KEY

Your OpenAI API key (required)

OPENAI_MODEL

Model to use, e.g. gpt-4o (required)

USE_UV

Set to 1 to run the MCP server via uv, 0 for plain python

2. Install dependencies

With uv (recommended):

pip install uv
uv venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
uv pip install -e .

Without uv:

python -m venv .venv
source .venv/bin/activate
pip install -e .

3. Run

python main.py

Or with uv:

uv run main.py

Usage

Chatting

Type a message and press Enter:

> What files do I have?

Referencing documents

Use @filename to include a document's content in your query. Filenames with spaces work too:

> Summarize @pokemon.md
> What's in @Family Tree.pdf

Tab completion activates after typing @. The dropdown includes files from the default mcp_documents/ directory and any directories you've granted access to.

Commands

Type / to see available commands. Commands take a document ID as the first argument:

Command

Syntax

Description

/summarize

/summarize <doc>

Summarize a document

/format

/format <doc>

Reformat a document to markdown

/rewrite

/rewrite <doc> <tone>

Rewrite in a different tone (formal, casual, concise, technical, persuasive, simple)

/convert

/convert <doc> <format>

Convert to another format (json, csv, markdown, yaml, xml, html, plain text)

> /summarize pokemon.md
> /format pokemon.md
> /rewrite pokemon.md formal
> /convert pokemon.csv json

Tab completion works for commands, document names, and tone/format values.

Custom root directories

Point the server at specific directories with --roots:

python main.py --roots ~/my_docs ./data

Additional MCP servers

Load extra MCP server scripts as positional arguments:

python main.py my_server.py another_server.py

File access permissions

When you reference a file outside the allowed directories (--roots or default mcp_documents/), a permission prompt appears:

The MCP server wants to access:
/Users/prem/Desktop/secret.txt
This path is outside the allowed directories.
Allow access? (1=Allow Once, 2=Always Allow, 3=Deny): 
  • Allow Once (1) — grants access for this single operation

  • Always Allow (2) — grants access for the rest of the session, and adds the parent directory to the allowed list so other files in the same folder are accessible via @ without further prompts

  • Deny (3) — blocks access

After "Always Allow", the @ tab-completion dropdown refreshes to include files from the newly allowed directory.

Files are checked for existence before the permission prompt, so you won't be prompted for files that don't exist.

MCP Server

The built-in server (mcp_server.py) exposes:

Tools

Tool

Description

read_doc_contents

Read a document's contents

create_doc

Create a new document

edit_doc_contents

Replace text within a document

delete_doc

Delete a document

allow_path

Grant access to a file path (called by the client after permission is granted)

Resources

URI

Returns

docs://list

All filenames in the documents directory and any allowed directories

docs://recent

5 most recently modified files

docs://file/{filename}

Contents of a specific file

Prompts

Prompt

Syntax

Description

/summarize

/summarize <doc>

Summarize a document and return the result in chat

/format

/format <doc>

Reformat a document to markdown and return the result in chat

/rewrite

/rewrite <doc> <tone>

Rewrite in a different tone and return the result in chat

/convert

/convert <doc> <format>

Convert between formats and return the result in chat

Project Structure

├── main.py              # Entry point — parses args, starts MCP clients and CLI
├── mcp_client.py        # MCP client wrapper (connects to servers via stdio)
├── mcp_server.py        # MCP server with tools, resources, prompts, and permission checks
├── core/
│   ├── cli.py           # Terminal UI (prompt-toolkit, tab completion, key bindings)
│   ├── cli_chat.py      # CLI chat logic (@mentions, /commands, permission handling)
│   ├── chat.py          # Base chat loop (LLM ↔ tool execution cycle)
│   ├── llm.py           # OpenAI API wrapper
│   └── tools.py         # Converts MCP tools to OpenAI function-calling format
├── mcp_documents/       # Sample documents directory
├── pyproject.toml       # Project metadata and dependencies
└── .env                 # API keys and config

Adding documents

Place files in mcp_documents/ (or a custom --roots directory). The server reads from there by default. Supported formats are any text-based file.

To add documents programmatically, use the create_doc tool through the chat interface.

Available Tools

5 tools
allow_pathA

Grant the MCP server access to an absolute file path for this session

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to allow (e.g. /Users/me/Desktop/file.txt)

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses session-scoped access but does not mention potential security implications, revocation, or success/failure conditions. No annotations to supplement.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, clear and direct, no redundant wording.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Simple tool but context of when to use relative to siblings is missing. Does not state that this is likely needed before read/edit operations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Description of tool adds no extra meaning to the path parameter beyond the schema's own description. Coverage is 100%, so baseline 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states the action (grant) and the object (access to an absolute file path) with session scope. Distinct from sibling doc-manipulation tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Does not explicitly mention when to use or alternatives. Implied that it's a prerequisite for accessing files, but no direct guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

create_docB

Create a new document with the given content

ParametersJSON Schema
NameRequiredDescriptionDefault
doc_idYesFilename for the new document (e.g. notes.txt)
contentYesContent of the document

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of disclosing side effects. It does not mention whether the tool overwrites an existing document, whether permissions from allow_path are required, or any other behavioral consequences of creating a document.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that directly states the tool's function. There is no unnecessary detail or clutter, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple and parameter schema is complete, but the description omits important contextual behavior such as handling existing doc_ids or interaction with allow_path. This is enough for basic usage but not fully complete for edge cases.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already provides full coverage of both parameters with clear descriptions. The tool description adds no extra semantic meaning beyond what is already documented in the schema, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (create), the resource (document), and the scope (new), which distinguishes it from sibling tools like edit_doc_contents and delete_doc. It does not explicitly name the sibling alternatives, but the purpose is unmistakable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives, such as using edit_doc_contents for existing documents or what happens if the doc_id already exists. The description only states the basic action without usage conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

delete_docA

Delete a document

ParametersJSON Schema
NameRequiredDescriptionDefault
doc_idYesID of the document to delete

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description only says 'Delete a document' without detailing side effects like permanence or confirmations. It implies destruction but lacks explicit behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence with no unnecessary words or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple delete operation with no output schema, the description is adequate. It identifies the action and the parameter, and no additional context is needed for the caller.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema includes a description for 'doc_id' ('ID of the document to delete'), covering the parameter fully. The description adds no extra semantic value beyond the schema, and schema coverage is 100%.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action 'Delete' and the resource 'document', distinguishing it from sibling tools like create, read, and edit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

While no explicit conditions or alternatives are mentioned, the delete operation is self-explanatory and distinct from siblings, making usage clear without further guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

edit_doc_contentsC

Can be used to edit the contents of a doc

ParametersJSON Schema
NameRequiredDescriptionDefault
doc_idYesID of the document we want to edit
new_strYesContent that's to be replacing the old_str.
old_strYesContent to replace. Must match exactly, including whitespaces

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It implies mutation but does not disclose whether replacement targets one occurrence or all occurrences, what happens if old_str is not found, or whether the edit is reversible.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single short sentence with no redundancy. The passive phrase 'Can be used to' is unnecessary filler, but the overall length is appropriate.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple three-parameter tool with no output schema, the description and parameter schema cover the basic operation. It is complete enough for a straightforward edit, though it omits replacement behavior details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and each parameter has a meaningful description. The tool description adds no extra semantic value beyond the schema, so the baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the verb 'edit' and the resource 'contents of a doc', which clearly distinguishes it from siblings like read_doc_contents, create_doc, delete_doc, and allow_path. However, it does not explicitly mention that edits are performed by replacing old_str with new_str.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives no guidance on when to use this tool versus the sibling tools, nor does it mention prerequisites or conditions such as the document needing to exist or old_str needing to be present. Usage is only implied by the verb 'edit'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_doc_contentsA

Can be used to read and return the contents of a doc as a string

ParametersJSON Schema
NameRequiredDescriptionDefault
doc_idYesID of the document we want to read

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description indicates a read operation, which is inherently non-destructive, but it does not explicitly state that no modifications occur or that no additional permissions are required. Since no annotations are provided, the description carries the full burden and could be more explicit about side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and directly states the purpose in one sentence without redundant information. It is well-structured and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read operation, the description fully explains the return value (contents as a string) and the required input (doc_id). No additional context is necessary for an agent to correctly invoke this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The only parameter, doc_id, is described as 'ID of the document we want to read', providing sufficient clarity. However, the description adds no further details beyond the schema, and the coverage is 100%, so a baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: to read and return the contents of a document as a string. This distinguishes it from sibling tools like create_doc, edit_doc_contents, and delete_doc, which imply write operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when a read operation is needed, but it does not explicitly contrast with alternatives or state when to prefer this tool over others. The sibling names provide context, but the description itself lacks explicit usage guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 5 tool updatesv0.1.0
    • First observedallow_path
    • First observedcreate_doc
    • First observeddelete_doc
    • First observededit_doc_contents
    • First observedread_doc_contents

TDQS

A3.7/5.0

Scored across 5 tools

Disambiguation5/5

Each tool targets a distinct action: granting path access, reading, creating, editing, or deleting a document. The shared doc/doc_contents wording does not create real ambiguity because the verbs clearly separate the operations.

Naming Consistency4/5

Most names follow a clear verb_noun pattern such as create_doc and delete_doc. The minor mismatch between doc and doc_contents for read and edit operations prevents a perfect score.

Tool Count5/5

Five tools is well-scoped for a document management server. Each tool serves a necessary purpose with no redundant or bloated operations.

Completeness4/5

The core CRUD lifecycle is fully covered: create, read, edit, and delete. A listing or search operation would be useful, but the main workflows are complete enough for agents to operate.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables file operations (PDF, Office, images, archives, media) through natural language, with tools for reading, writing, converting, and analyzing files locally.
    1
    -
  • F
    license
    A
    quality
    C
    maintenance
    Enables local document search and reading across formats like docx, pdf, md, and more, providing tools for listing, searching, and reading documents.
    3
    -
  • A
    license
    A
    quality
    B
    maintenance
    Enables local file management through natural language interactions using the Gemini API, with tools for listing, reading, writing, deleting, and updating files.
    5
    1
    MIT