mcplocal
mcplocal
本地文件 MCP 服务器,允许支持 MCP 的客户端(包括可用的 ChatGPT Web 自定义 MCP 应用)在一个明确配置的目录内读取、搜索和修改文件。
功能特性
旧版 HTTP+SSE:
GET /sse+POST /messages新版 MCP HTTP 端点:
/mcp健康检查:
/health沙箱:所有文件路径均在
MCP_ROOT下解析可选 Bearer 认证
用于项目探索的读取/搜索工具
用于编码工作流的写入/编辑工具
默认禁用删除
无 shell/CLI 执行工具
不依赖外部数据库
Node.js 20+
MCP TypeScript SDK 目前建议远程服务器使用 Streamable HTTP,并将 HTTP+SSE 视为向后兼容的传输方式。本项目有意同时提供这两种方式,以便旧版 SSE 客户端仍可连接,而新版客户端可使用 /mcp。
Related MCP server: FilesystemMCP
1. 运行
cp .env.example .env
# edit MCP_ROOT if needed
npm start示例:
MCP_ROOT=~/Projects
MCP_HOST=127.0.0.1
MCP_PORT=8008
MCP_AUTH_TOKEN=change-me然后:
SSE: http://127.0.0.1:8008/sse
Streamable: http://127.0.0.1:8008/mcp
Health: http://127.0.0.1:8008/health2. ChatGPT Web 可以连接什么
ChatGPT Web 无法从托管服务直接访问 localhost。本地 MCP 服务器必须通过受支持的 Secure MCP Tunnel/私有网络机制才能被访问到。获得远程 MCP 端点后,在 ChatGPT Developer Mode 中将其添加为自定义 MCP 应用,扫描其工具并启用它。
对于映射本地服务的隧道,本地源为:
http://127.0.0.1:8008/sse或者,对于新版客户端:
http://127.0.0.1:8008/mcp不要在未启用认证和明确网络策略的情况下将此服务器暴露到公共互联网。
3. 向 ChatGPT 公开的工具
list_files(path, recursive)read_file(path, startLine, endLine)write_file(path, content, createDirs)edit_file(path, oldText, newText, replaceAll)search_files(query, path, regex, caseSensitive, maxResults)create_directory(path)file_info(path)delete_file(path)仅在MCP_ENABLE_DELETE=true时
典型编码工作流:
使用
list_files了解项目。使用
search_files定位符号。使用
read_file检查相关代码。使用
edit_file进行精准修改,或使用write_file创建新文件。再次使用
read_file验证结果。
4. 安全模型
MCP_ROOT 是硬性边界。../ 路径穿越以及其外的绝对路径都会被拒绝。搜索会跳过二进制/不可读文件。文件大小受 MCP_MAX_FILE_BYTES 限制。
服务器有意不暴露任意 shell 执行能力。这意味着 ChatGPT 可以编辑代码,但不能通过此 MCP 自动运行 rm、curl、包管理器、git 命令或任意程序。
对于开发机器,请将 MCP_HOST 保持为 127.0.0.1,并使用受支持的 Secure MCP Tunnel,而不要将服务器绑定到所有网络接口。
5. 构建
npm run build
node dist/server.js构建过程无依赖,并将运行时复制到 dist/。
6. Docker
docker build -t mcplocal .
docker run --rm -p 8008:8008 -v "$PWD:/workspace" mcplocal7. ChatGPT 中的示例提示
Inspect this local project and tell me where the authentication flow is implemented. Do not modify anything.Open src/server.js and refactor the error handling. Before changing it, read the relevant code. Then edit only the necessary section and show me what changed.Search the project for TODO comments and create a report at reports/todos.md.许可证
MIT
This server cannot be installed
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 Servers
- -licenseNot gradedqualityNot gradedmaintenanceA secure MCP server enabling read-only access and file search capabilities within a specified directory, while respecting .gitignore patterns.
- AlicenseNot gradedqualityCmaintenanceA local, customizable MCP server for filesystem access that extends the official Anthropic implementation with additional tools and functionality. It enables users to securely read, write, edit, and manage files and directories within specific allowed local paths.529,343Inno Setup
- FlicenseBqualityDmaintenanceA lightweight MCP server for basic file operations, enabling reading, writing, and listing files securely via the Model Context Protocol.31
- AlicenseNot gradedqualityBmaintenanceSafe local MCP server for Windows to list, read, search, patch, backup, and verify code files in allowed folders, with Git integration and dry-run diffs.1MIT
Related MCP Connectors
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
A MCP server built for developers enabling Git based project management with project and personal…
An MCP server that gives your AI access to the source code and docs of all public github repos
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/aiautotool/mcplocal'
If you have feedback or need assistance with the MCP directory API, please join our Discord server