内容
# Claude MCP Server Collection
这个仓库包含了一系列模型上下文协议(MCP)服务器,旨在增强 Claude 桌面应用程序的功能。每个服务器提供特定的功能,允许 Claude 以不同的方式与您的计算机交互。
## 最新添加:DuckDB 集成!🚀
用于高效大规模数据分析的全新 DuckDB FastAPI 服务器:
### 示例查询和结果
#### Query 1: Analysis
<img src="./fastapi/duckdb/assets/duckdb_query1.png" alt="DuckDB Query Example 1">
#### Query 2: Aggregated Results
<img src="./fastapi/duckdb/assets/duckdb_query2.png" alt="DuckDB Query Example 2">
### DuckDB Server Features
- 在 Claude Desktop 中直接分析多个 CSV 文件(>1GB)
- 使用 DuckDB 进行闪电般的 SQL 查询
- 内存高效的数据处理
- 连接池和缓存
- 自动清理未使用的连接
## Overview
该项目由几个 MCP 服务器组成:
1. Screen Capture Server - 捕获和处理屏幕截图
2. Computer Control Server - 启用键盘和鼠标自动化
3. FastAPI Integration Server - 处理数据处理和 API 端点
4. Curl Server - 提供 HTTP 请求功能
5. DuckDB Server - 启用大规模数据分析
## Prerequisites
- Python 3.8 或更高版本
- Node.js 和 npm(用于 filesystem server)
- Claude Desktop Application
- Git
## Installation
1. 克隆仓库:
```bash
git clone https://github.com/syedazharmbnr1/ClaudeMCPServer.git
cd ClaudeMCPServer
```
2. 创建并激活虚拟环境:
```bash
python3 -m venv .env
source .env/bin/activate # On Windows: .env\Scripts\activate
```
3. 安装依赖项:
```bash
pip install -r requirements.txt
```
## Server Components
### 1. DuckDB Server
使 Claude 能够高效地分析大型 CSV 文件。
#### Setup and Usage:
```bash
cd fastapi/duckdb
python main.py
```
#### Features:
- 同时处理多个 CSV 文件
- 处理大于 1GB 的文件
- 使用 DuckDB 进行快速 SQL 查询
- 内存高效的处理
- 连接池
### 2. Screen Capture Server
使 Claude 能够捕获和处理屏幕截图。
#### Setup and Usage:
```bash
python mcp_screen_server.py
```
#### Features:
- 实时屏幕捕获
- 动态图像压缩
- WebP 格式支持,以实现最佳文件大小
- 可自定义的保存位置
### 3. Computer Control Server
允许 Claude 控制鼠标和键盘操作。
#### Setup and Usage:
```bash
python ComputerUse/mcp_computer_server.py
```
#### Features:
- 鼠标移动和点击
- 键盘快捷键和文本输入
- 屏幕位置跟踪
- 剪贴板操作
### 4. FastAPI Integration Server
FastAPI 服务器为数据处理和集成提供了一个强大的 API 接口。
#### Setup and Configuration:
1. 导航到 FastAPI 目录:
```bash
cd fastapi
```
2. 配置环境变量:
```bash
export PYTHONPATH=/path/to/mcp-server-py
export PORT=8000
```
3. 启动服务器:
```bash
python main.py
```
### 5. Curl Server
为 Claude 提供 HTTP 请求功能。
#### Setup:
```bash
cd Curl_Server
./start_server.sh # For the basic server
./start_mcp_server.sh # For the MCP integration
```
## Claude Desktop Integration
### Configuration
1. 将 `claude_desktop_config.json` 复制到您的 Claude Desktop 应用程序配置目录
2. 更新配置中的路径以匹配您的系统:
```json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"<your-paths-here>"
]
},
"duckdb": {
"command": "/path/to/python",
"args": [
"/path/to/fastapi/duckdb/main.py"
],
"cwd": "/path/to/fastapi/duckdb",
"env": {
"PYTHONPATH": "/path/to/mcp-server-py",
"PORT": "8010"
}
}
}
}
```
## Testing
每个组件都有自己的测试套件:
```bash
# Test screen capture
python test_screen_server.py
# Test computer control
python ComputerUse/test_computer_control.py
# Test integration
python ComputerUse/test_client.py
```
## Troubleshooting
### Common Issues
1. Python Path Issues:
- 确保 PYTHONPATH 设置正确
- 验证虚拟环境是否已激活
2. Permission Errors:
- 确保脚本文件是可执行的:
```bash
chmod +x *.py
chmod +x Curl_Server/*.sh
```
3. Port Conflicts:
- Screen Server: Default port 8767
- FastAPI Server: Default port 8000
- DuckDB Server: Default port 8010
- Integration Server: Default port 8768
### Logging
- 检查 `debug.log` 以获取详细的错误消息
- 每个服务器组件都写入其自己的日志文件
## Security Notes
1. GitHub Integration:
- 安全地存储您的 GitHub 令牌
- 永远不要将令牌提交到仓库
2. File System Access:
- 仔细配置文件系统路径
- 仅限访问必要的目录
## Contributing
1. Fork 仓库
2. 创建一个功能分支
3. 提交一个 pull request
## License
This project is licensed under the MIT License - see the LICENSE file for details.