Claude Desktop的本地开发助理
一个简单的 本地MCP服务器 这允许 克劳德桌面版 读取、列出和搜索项目文件夹中的文件——完全在本地和私下进行。
非常适合询问有关您自己的代码库(React、Next.js、Python、Laravel、NestJS)的问题,而无需在任何地方上传任何内容。
特性
- 列出项目中的所有文件(忽略有用文件夹)
- 读取任何文件的全部内容
- 在所有文件中搜索关键字或文本
- 100%本地-没有云,没有数据离开您的计算机
- 当前为只读(默认为安全)
项目结构
本地开发助理/ ├── myenv/#Python虚拟环境 ├── 您的项目/#← 你的实际代码库在这里 ├── core/ │ ├── config.py │ ├── mcp_stdio.py#stdio传输补丁(空白stdin行) │ └── security.py ├── 工具/ │ ├── file_tools.py │ └── search_tools.py ├── server.py#主FastMCP服务器 ├── .env.example#项目根配置 ├── 需求.txt └── README.md
快速设置
1.先决条件
- Python 3.9+
- Claude Desktop(支持本地MCP)
2.安装
# Create and activate virtual environment
python -m venv myenv
source myenv/Scripts/activate # Windows
# Install required packages
pip install fastmcp python-dotenv
# (Optional) Save installed packages
pip freeze > requirements.txt
## Add your codebase in the `your_project` folder
Paste your codebase inside **`your_project/`** (in this repo). Point **`PROJECT_ROOT`** in `.env` at that folder.
your_project/
├── app/
│ └── page.tsx
├── components/
├── package.json
└── ...
## Run the server
source myenv/Scripts/activate
python server.py
## Connect in Claude Desktop
**Step-by-step:** see **[Guide-Setup.md](Guide-Setup.md)** in this repo.
Open Claude Desktop → **Settings → Developer → Edit Config** (`claude_desktop_config.json`), add the server under `mcpServers`, then fully quit and restart Claude. Use **tools / hammer** or **+ → Connectors** to confirm **Local Dev Assistant** is connected.
## Example questions to ask Claude
Show me all files in the project
...