Content
# Tool List (MCP Server)
[](https://python.org)
[](LICENSE)
> A toolset that exposes local Python scripts to AI clients (e.g., Claude Desktop) via **MCP (Model Context Protocol)**.
---
## 📦 Function Overview
| Tool | Function | Applicable Scenarios |
| --- | --- | --- |
| **tree_to_txt** | Scan directory to generate file tree, save as text file | Project structure overview, document writing |
| **xlsx_to_txt** | Read all `.xlsx` Excel files, extract content to text | Provide table data to AI for processing |
| **python_to_txt** | Extract all `.py` file code, merge into one text file | Code review, AI context preparation |
| **text_to_txt** | Auto-detect encoding, merge all text files | Document summarization, corpus organization |
All tools automatically skip directories like `.venv`, `__pycache__`, `.git`, etc., and respect `.gitignore` configurations.
---
## 🚀 Quick Start
### 1. Install Dependencies
This project uses [uv](https://docs.astral.sh/uv/) to manage dependencies:
```bash
uv sync
```
### 2. Configure MCP Client
Add the following JSON to your MCP client configuration (e.g., Claude Desktop `claude_desktop_config.json`):
```json
{
"mcpServers": {
"python-script-runner": {
"command": "path\\to\\.venv\\Scripts\\python.exe",
"args": [
"path\\to\\mcp_server.py"
]
}
}
}
```
> ⚠️ Replace `path\\to\\` with your actual project path.
### 3. Run Test
```bash
python mcp_server.py
```
---
## 🛠️ Tool Details
### tree_to_txt
```bash
python tree_to_txt.py # Scan current directory
python tree_to_txt.py -d /path/to/project # Specify directory
python tree_to_txt.py -o tree.txt # Custom output file name
```
### xlsx_to_txt
```bash
python xlsx_to_txt.py # Read all xlsx in current directory
python xlsx_to_txt.py --raw-formulas # Extract formula text
python xlsx_to_txt.py --max-rows 100 # Limit rows
```
### python_to_txt
```bash
python python_to_txt.py # Extract all .py files
```
### text_to_txt
```bash
python text_to_txt.py # Merge all text files
```
---
## 📄 LICENSE
This project is open-sourced under the [MIT License](LICENSE).