Content
# MCP_dev Project Description
The purpose of this project is to encapsulate the development of MCP, simplifying and structuring the development process of MCP.
Firstly, the development of MCP can be roughly divided into two categories:
### 1. Tool Development for MCP, used to execute core tool logic in base_Mcp_Handles.py:
In the base class of this project, all tools are placed in a list container, and the methods `run_tool` and `get_tool_description`, which are required by the MCP specification, are defined as interfaces that must be inherited by subclasses.
The tool base class is as follows:
In the Python package where this file is located, directly create the tool you want to develop, such as a Python class for operating MySQL or sending emails via a mail server, and inherit from this class. You only need to override the two class attributes and the `get_tool_description` and `run_tool` methods to automatically register. Implement the logic and return parameters according to the requirements of these two methods.
### 2. Prompt Development Module for MCP
Different scenarios require different prompts. The logic for the prompts in each scenario is similar to that of the tool module mentioned in point 1. There is also a base class, base_Prompt.py. For specific encapsulation methods, refer to the source code, and the method of use is to inherit from the `BasePrompt` class and override the attributes.

Additionally, override the following two methods:

This will complete the automatic registration.
### 3. A Unified Configuration Module
The dbconfig.py under the config directory.
Create a new .env file and copy the path.
Modify the following paths to your own:

An example of what to fill in the .env file is as follows:
```python
# MySQL Database Configuration
mysql_host=localhost
mysql_port=11801
mysql_user=root
mysql_password=123456
mysql_database=MCP_taobao
# Optional values: readonly, writer, admin; default is readonly
mysql_role=readonly
```
Of course, other configurations are also acceptable and can be read by dbconfig.
For specific examples, refer to the source code.
4. Actual construction of the MCP service in server.py
Pass the various encapsulated tools and prompts to the MCP server, and since the SSE or STDIO servers are different, they need to be implemented in different ways. For specifics, refer to the source code.