disk-space-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@disk-space-mcpcheck disk space on /projects"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
disk-space-mcp
A small Model Context Protocol server that
reports and validates free disk space. It exposes a single read-only tool,
check_disk_space, backed by Node's fs.statfs — no shell-outs to df, no
runtime dependencies beyond the MCP SDK and Zod.
Tool: check_disk_space
Reports total / used / available space for the filesystem that contains a path, and validates it against optional free-space thresholds.
Argument | Type | Default | Description |
| string | home directory | Any path; stats apply to the filesystem containing it. |
| number | — | If available space is below this many GiB, |
| number |
| If available space is below this percentage, |
It returns both a human-readable text block and structuredContent:
{
"path": "/Users/you",
"totalBytes": 494384795648,
"usedBytes": 312000000000,
"freeBytes": 182000000000,
"availableBytes": 175000000000,
"usedPercent": 63.11,
"availablePercent": 35.4,
"status": "ok",
"message": "OK: 163 GiB available of 460 GiB (35.4% free, 63.11% used) on /Users/you."
}availableBytes (POSIX bavail) is the space actually usable by your user and
is the value the thresholds check; freeBytes (bfree) additionally counts
space reserved for root.
Related MCP server: disk-clean-mcp
Develop
npm install
npm run build # tsc -> dist/
npm test # vitest: pure-logic unit tests + in-memory protocol tests
npm run typecheck # tsc --noEmit
npm run smoke # build first, then spawn the server and call the tool over stdioRegister with Claude Code
npm run build
claude mcp add disk-space --scope user -- node /ABSOLUTE/PATH/TO/disk-space-mcp/dist/index.jsOr add it manually to an MCP client config:
{
"mcpServers": {
"disk-space": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/disk-space-mcp/dist/index.js"]
}
}
}Design notes
Layered for testability.
diskSpace.tsis a pure module (byte math, thresholds, formatting) with no I/O, unit-tested in isolation.getDiskStats.tsis the thinfs.statfsadapter, injected intocreateServer()so the protocol wiring can be tested end-to-end against an in-memory transport with fabricated stats.stdio-safe. All diagnostics go to stderr; stdout carries only JSON-RPC.
Read-only and shell-free. The tool only reads filesystem capacity via
statfs; it never reads file contents and never invokes a shell, so there is no command-injection surface. Paths are resolved to absolute and failures (missing path, permission denied) return a cleanisErrorresult.Unit semantics. Byte counts use
frsizewhen available (Node ≥ 24.16), falling back tobsizeon older runtimes. Sizes are formatted with binary (IEC) units — KiB / MiB / GiB.
Security
Read-only, shell-free. The only side effect is
fs.statfs. There is nochild_process/exec/spawnanywhere, so there is no command-injection surface, andstatfsexposes filesystem capacity only — never file contents.Input is validated at the boundary. The
pathargument is length-capped and rejected if it contains control characters (NUL, ESC, CR, …), which both neutralizesstatfs's silent null-byte truncation and prevents control/ANSI sequences from being reflected into tool output that a terminal or agent later renders.minFreeGb/minFreePercentare bounded and must be finite.No information leak on error. Failures return a clean
isErrorresult with an errno code (e.g.ENOENT) rather than raw runtime internals; full error detail is logged to stderr only.stdio-only. Only
StdioServerTransportis instantiated. The MCP SDK transitively pulls in an HTTP/auth stack that this server never uses; since consumers only run the stdio binary, those code paths are never reached. For a hardened install,npm ci --ignore-scriptsis safe (no runtime dependency needs an install script). CI gates production dependencies withnpm audit --omit=dev --audit-level=high.
License
MIT — see LICENSE.
Available Tools
1 toolcheck_disk_spaceCheck disk spaceARead-onlyIdempotent
Report total, used, and available disk space for the filesystem containing a path, and validate it against optional free-space thresholds. Read-only: reads filesystem stats via statfs, never runs a shell. Returns a status of "ok" or "warning".
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Filesystem path to inspect. Stats apply to the filesystem that contains this path. Defaults to the user home directory. | |
| minFreeGb | No | Minimum free space in GiB. When available space is below this, status becomes "warning". | |
| minFreePercent | No | Minimum available space as a percentage of total. Defaults to 10. When available space is below this, status becomes "warning". |
Output Schema
| Name | Required | Description |
|---|---|---|
| path | Yes | The resolved absolute path that was inspected. |
| totalBytes | Yes | Total filesystem size in bytes. |
| usedBytes | Yes | Used bytes (total minus free). |
| freeBytes | Yes | Free bytes including space reserved for root. |
| availableBytes | Yes | Bytes available to unprivileged users (the real usable free space). |
| usedPercent | Yes | Used bytes as a percentage of total. |
| availablePercent | Yes | Available bytes as a percentage of total. |
| status | Yes | "warning" when available space is below a threshold, otherwise "ok". |
| message | Yes | Human-readable one-line summary. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds context beyond annotations by specifying the method ('reads filesystem stats via statfs') and explaining the return status ('ok' or 'warning'). This complements the readOnlyHint and idempotentHint annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences long, no wasted words, and front-loads the primary purpose. It is appropriately sized and structured for quick comprehension.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of an output schema (indicated), the description does not need to detail return values. It covers all necessary behavioral and safety aspects for a simple read-only tool, making it complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the base score is 3. The description adds context about optional thresholds and default path, but does not significantly extend the schema descriptions, which already cover parameter details.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool reports total, used, and available disk space for a filesystem path, and validates against thresholds. It uses a specific verb ('report') and resource ('disk space'), distinguishing it from potential siblings, though none are listed.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says it is read-only and never runs a shell, indicating safety. It implies usage for checking disk space without harm. Since there are no sibling tools, explicit when-not or alternatives are not needed.
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. Dates show when Glama detected each change.
1 tool update
v1.0.0- First observed
check_disk_space
TDQS
With only one tool, there is no ambiguity. The tool's purpose is clearly distinct and well-described.
The single tool name 'check_disk_space' follows a consistent verb_noun pattern and is descriptive, so no inconsistency exists.
One tool is borderline thin for a file system utility. While it serves a focused purpose, users might expect additional capabilities like listing mounts or checking multiple paths.
The tool provides basic disk space checking for a single path but lacks coverage for multiple filesystems, threshold management, or detailed usage reports. Notable operations are missing.
Maintenance
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
Free MCP tools: the only MCP linter, health checks, cost estimation, and trust evaluation.
Validate oh-my-posh configurations and segment snippets against the official schema.
Detect breaking changes, generate changelogs, diff, and validate OpenAPI specs.
Check if your MCP server is ready to publish on the MCP Registry, Smithery, or npm.
Related MCP Servers
- FlicenseBqualityDmaintenanceProvides tools to check disk usage and search files by keyword on the local system.2-
- AlicenseBqualityCmaintenanceEnables read-only analysis of local disk usage to identify cleanup targets by size, type, recency, and duplicates.6171MIT
- AlicenseNot gradedqualityCmaintenanceA read-only MCP server that reports largest files, folder sizes, and disk usage, running locally without any data leaving your machine.MIT
- FlicenseAqualityCmaintenanceEnables real-time Windows storage analysis, deep folder scanning, safety tiering, and protected cleanup operations through natural language.41-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/fjmn2001/disk-space-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server