Content
# mcp-demo
A simple implementation based on the official mcp documentation, including mcp-client and multiple mcp-servers, supporting local file search, system control, command execution, and online API calls.
Recommended to be used with oneapi/newapi.
## Environment Configuration
- Python3.12 (this is the version used locally; others have not been tested, but 3.11 and 3.10 should work fine)
- uv, a package management tool, very useful!
## Clone the Repository:
```
git clone https://github.com/syuchua/mcp-demo.git
cd mcp-demo
```
## Install Dependencies:
```
uv pip install -e .
```
## Configure Your API_KEY
- (Optional) Create a .env file and add OPENAI_API_KEY="your-api-key"
- Directly edit src/config/default_config.yaml
## Getting Started:
```
python main.py
# You can also run it directly with uv
uv run main.py
```
## Command Line Interaction
After starting the client, you can enter queries or use the following commands:
- `!help` - Display help information
- `!servers` - List available servers
- `!connect <server>` - Connect to the specified server
- `!models` - List available LLM models
- `!model <name>` - Switch to the specified model
- `!debug <on/off>` - Enable/disable debug mode
- `!quit` or `!exit` - Exit the program
## Supported Servers and Tools
### US Weather Server (weather)
- `get_forecast` - Get weather forecast for specified coordinates
- `get_alerts` - Get weather alerts for specified states
### Amap Server (高德)
- Geocoding/Reverse Geocoding
- Weather query
- Route planning (driving/walking/cycling/public transport)
- POI search
- Location query
### Local File Search Server (everything)
- `search` - File search function based on Everything search engine
- Supports various search syntax, including wildcards, regular expressions, and advanced filtering
### System Tools Server (system_tools)
- `execute_program` - Execute specified programs or applications
- `open_app` - Open common applications (QQ, WeChat, browser, etc.)
- `send_qq_message` - Send QQ messages
- `list_running_processes` - List currently running processes
- `kill_process` - Terminate specified processes
- `create_file` - Create and write to a file
- `read_file` - Read file content
- `list_files` - List files in a directory
- `delete_file` - Delete a file
- `get_working_directory` - Get the current working directory
- `run_python_code` - Execute Python code and return results
## Example Queries
### Weather Query
Check the weather forecast for San Francisco and whether there is a storm warning for New York.
### Map Services
Check the weather for Beijing tomorrow, find the location of West Lake in Hangzhou, calculate the walking route from Tsinghua University to Peking University.
### File Search
Find all PDF files, search for recently modified Python code, find Excel files with names containing "report".
### File/Application Operations
Open Notepad, create a helloworld.py file and write Python code, view files in the current directory, execute Python code to calculate the sum from 1 to 100, convert video D:\demo.mp4 to MP3 audio, merge two video files, extract a 5-second clip from a video to create a GIF.
## Intelligent Server Selection
No need to manually switch servers; just ask your question! The system will automatically select the most suitable server to handle your request based on the query content.
## Custom Server
You can add custom servers by modifying the configuration file.
## License
MIT License
Connection Info
You Might Also Like
awesome-mcp-servers
A collection of MCP servers.
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.
git
A Model Context Protocol server for Git automation and interaction.
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
Appwrite
Build like a team of hundreds