MCP 官方参考服务器,在可配置的允许目录范围内安全地读写、搜索和管理本地文件。
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem '<dir>'~/.codex/config.toml
[mcp_servers.filesystem]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "<dir>"]
# codex mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem '<dir>'~/.cursor/mcp.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"<dir>"
]
}
}
}.vscode/mcp.json
{
"servers": {
"filesystem": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"<dir>"
]
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"<dir>"
]
}
}
}claude_desktop_config.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"<dir>"
]
}
}
}.trae/mcp.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"<dir>"
]
}
}
}