Skip to content

feat: Self-developed Filesystem MCP Server — 26 tools, pure Python, zero deps - #143

Open
raymondginger2018-sudo wants to merge 4 commits into
HKUDS:mainfrom
raymondginger2018-sudo:feat/custom-filesystem-mcp
Open

feat: Self-developed Filesystem MCP Server — 26 tools, pure Python, zero deps#143
raymondginger2018-sudo wants to merge 4 commits into
HKUDS:mainfrom
raymondginger2018-sudo:feat/custom-filesystem-mcp

Conversation

@raymondginger2018-sudo

Copy link
Copy Markdown
Contributor

Overview

Self-developed pure Python Filesystem MCP Server, replacing the npx-based @modelcontextprotocol/server-filesystem.

Key advantages: No Node.js/npm/npx required. Pure Python + FastMCP. Fast startup, zero external dependencies.

Comparison with Official

Feature Official This PR
Tools ~8 26
Dependencies npx + Node.js Pure Python
Line editing No edit_file + dryRun diff
Batch replace No batch_replace (sed -i style)
Built-in grep No grep_files (regex + context)
File find No find_by_size / find_by_date
Directory tree No directory_tree (JSON)
File diff No diff_files
File hash No file_hash (md5/sha1/sha256)
Line count No count_lines (wc replacement)
Encoding detection No Auto utf-8/gbk/gb2312/latin-1
Security Basic Whitelist dirs + path validation

26 Tools

Information: list_allowed_directories, get_file_info
Reading: read_text_file, read_file, read_media_file, read_multiple_files
Writing: write_file, edit_file (dryRun diff preview), append_file
Directory: create_directory, list_directory, list_directory_with_sizes, directory_tree
Search: search_files, grep_files (regex+grep), find_by_size, find_by_date
File Ops: move_file, copy_file, delete_file, diff_files, file_hash
Batch: batch_replace (sed -i style + dry_run), count_lines (wc style)

Registration

Files Changed

  • core/mcp_servers/filesystem_mcp_server.py — New: 638 lines, 26 MCP tools
  • mcp_servers_canonical.json — New: Standardized MCP config registry

DeepCodeClone and others added 4 commits July 30, 2026 21:25
替代 @modelcontextprotocol/server-filesystem 的 npx 方案。

亮点:
- 26 个工具覆盖全生命周期
- 行级编辑 edit_file 支持 dryRun 预览 unified diff
- 批量替换 batch_replace 类 sed -i
- 内置 grep_files 正则搜索+上下文
- LLM 友好: 结构化 JSON、编码自动检测
- 安全沙箱: 白名单目录+路径验证
- 纯 Python: 仅依赖 mcp+fastmcp
清除配置示例中的第三方品牌引用
@raymondginger2018-sudo

Copy link
Copy Markdown
Contributor Author

Hi @akaxlh @chaohuang-ai, this PR adds a self-developed Filesystem MCP Server (26 tools, pure Python, zero external deps) plus the canonical MCP server config. Synced with latest main, conflict-free. Could you please review when you get a chance? Thanks!

@raymondginger2018-sudo

Copy link
Copy Markdown
Contributor Author

@Zongwei9888 The CI workflow (Linting and Formatting) for this PR is stuck in action_required -- GitHub requires a maintainer to approve running Actions on fork pull requests.

All code has been verified locally (npm run check / py_compile all pass, no conflicts). Could you please Approve and run workflows on this PR, or adjust repo Actions settings to allow fork PRs without approval?

Thanks!

1 similar comment
@raymondginger2018-sudo

Copy link
Copy Markdown
Contributor Author

@Zongwei9888 The CI workflow (Linting and Formatting) for this PR is stuck in action_required -- GitHub requires a maintainer to approve running Actions on fork pull requests.

All code has been verified locally (npm run check / py_compile all pass, no conflicts). Could you please Approve and run workflows on this PR, or adjust repo Actions settings to allow fork PRs without approval?

Thanks!

pull Bot pushed a commit to ari1988/DeepCode that referenced this pull request Aug 6, 2026
The Secret history scan has failed on main since dd8f0a8. Cause: merging HKUDS#131
with -s ours recorded the branch in history without applying its tree, and
gitleaks scans history, not the working tree.

The finding is a fixture, not a credential — the literal "sk-secret123456"
inside a RuntimeError message, asserting that error text is redacted before it
reaches the UI. Its file, tests/ui_session_resume_test.py, does not exist on
main, so the finding cannot be fixed by editing it; a fingerprint entry is the
only route.

Verified: gitleaks over origin/main now reports no leaks across 240 commits.

Note for future -s ours merges: they bring the branch's full history under the
secret scan. Two branches deliberately left unmerged (HKUDS#133, HKUDS#143) carry
findings of their own, and HKUDS#133's is a real key — merging them for attribution
alone would have put it in main's history permanently.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants