Content
# MCP Server for Local
A local proxy server and client implementation based on MCP (Multi-Component Platform), providing various AI tool invocation capabilities.
## Features
### Core Features
- **Weather Query**: Real-time access to weather information for any location worldwide, supporting detailed data such as temperature, humidity, wind speed, etc.
- **Google Search**: Intelligent retrieval of internet information, supporting multiple languages and advanced search syntax.
- **Camera Control**: Supports taking photos, video streaming, and micro-expression analysis, which can be used for emotion recognition.
- **Image Generation**: Integrates ComfyUI, supporting AI generation from text to image.
- **Intelligent Dialogue**: AI dialogue capabilities based on DashScope, supporting context understanding and multi-turn conversations.
### Technical Features
- Cross-platform support (Windows and Linux)
- Modular design, easy to extend new features
- Complete logging system for debugging and monitoring
- Supports custom tools and API integration
- High-performance concurrent processing capabilities
## Environment Configuration
### System Requirements
- Python 3.8+
- Node.js (optional, for running JavaScript server)
- Chrome browser (for Google search functionality)
- Camera (for photo-taking functionality)
- At least 4GB of RAM
- CUDA-compatible graphics card (optional, for accelerating AI computations)
### Installation Steps
1. Clone the repository:
```bash
git clone https://github.com/yourusername/mcp-server-for-local.git
cd mcp-server-for-local
```
2. Create and activate a virtual environment:
```bash
# Windows
python -m venv .venv
.venv\Scripts\activate
# Linux
python3 -m venv .venv
source .venv/bin/activate
```
3. Install dependencies:
```bash
# Use uv to install dependencies
uv pip install -r requirements.txt
# If you encounter network issues, you can use a domestic mirror
uv pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
```
4. Configure environment variables:
```bash
# Copy the environment variable template
cp .env.example .env
# Edit the .env file to set your configurations
```
### Environment Variable Configuration
Edit the `.env` file to set the following configurations:
- `DASHSCOPE_API_KEY`: DashScope API key (required)
- `MODEL`: Name of the model to use (default: qwen-max)
- `CONFIG_FILE`: Path to the server configuration file
- `GAODE_API_KEY`: Gaode Map API key (for weather queries)
- `CHROME_PATH`: Path to the Chrome browser
- `CHROMEDRIVER_PATH`: Path to ChromeDriver
- `BASE_URL`: ComfyUI server address
- `SERVERS_DIR`: Directory for server scripts
- `LOG_LEVEL`: Log level (optional: DEBUG, INFO, WARNING, ERROR)
## Usage
### Basic Usage
1. Navigate to the project directory:
```bash
cd src/mcp
```
2. Run the client:
```bash
uv run .\client\mcp_client.py .\proxy\proxy_server.py
```
3. Enter commands in the client, for example:
- "What's the weather like in Beijing?"
- "Search for Python tutorials on Google"
- "Take a photo"
- "Generate an image of a cat"
### Advanced Features
1. **Custom Tools**:
- Add new tool classes in the `src/mcp/tools` directory
- Implement necessary interface methods
- Register new tools in the configuration file
2. **API Extensions**:
- Support adding new API services
- Configurable API keys and endpoints
- Support for custom request and response handling
3. **Log Management**:
- Support multi-level logging
- Configurable log output locations
- Support for log rotation and archiving
## Frequently Asked Questions
### Installation Issues
1. Dependency installation failed:
```bash
# Try clearing the cache and reinstalling
uv pip cache purge
uv pip install -r requirements.txt
```
2. Virtual environment issues:
```bash
# If activation fails, try recreating the virtual environment
rm -rf .venv
python -m venv .venv
```
### Runtime Issues
1. Permission issues:
```bash
# Linux
chmod +x src/mcp/proxy/proxy_server.py
chmod +x src/mcp/client/mcp_client.py
```
2. Chrome-related issues:
- Ensure Chrome and ChromeDriver versions match
- Check if the Chrome path is correct
- Ensure sufficient permissions to run Chrome
- If you encounter driver issues, you can manually download the corresponding version of ChromeDriver
3. API key issues:
- Check if the API key in the `.env` file is correct
- Ensure the API key has sufficient quota
- Check if the network connection is stable
## Development Guide
### Project Structure
```
src/mcp/
├── client/ # Client code
├── proxy/ # Proxy server code
├── tools/ # Tool implementations
├── utils/ # Utility functions
└── config/ # Configuration files
```
### Adding New Features
1. Create new tool classes in the `tools` directory
2. Implement necessary interface methods
3. Register new tools in the configuration file
4. Write test cases
5. Update documentation
## Contribution Guidelines
Contributions are welcome! Please ensure that before submitting:
1. The code adheres to project standards
2. Necessary tests are included
3. Relevant documentation is updated
4. All tests pass
## License
MIT License
Connection Info
You Might Also Like
awesome-mcp-servers
A collection of MCP servers.
git
A Model Context Protocol server for Git automation and interaction.
Appwrite
Build like a team of hundreds
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...
chatbox
User-friendly Desktop Client App for AI Models/LLMs (GPT, Claude, Gemini, Ollama...)