Content
# MyMcp
## Communication Group
QQ Group: 979958989
Join the group for more timely communication and discussion

## Introduction
Open Source Introduction https://blog.csdn.net/u012327423/article/details/147531100
## Software Architecture
Software architecture description
## Module Description
### Login Page

### MCP Template Square

#### MCP Template - Details

#### MCP Template - Tool Testing
Demonstrates
- Tool List
- Test Parameters (if configured in the template, you can set whether the parameters are required)
- Tool Execution (if tool function parameters are configured, they need to be filled in)
- Tool Function Code (understand the principles of tool execution)

#### MCP Template - Parameter Configuration

#### MCP Template - Publish Service

#### MCP Template - Code Editing

### MCP Service
Supports managing built-in services

Supports adding third-party http sse addresses

### MCP Statistics



### User Management

### Tenant Management
## System Management

### Scheduled Tasks

### Python Package Management

### New Features Added on 20250711
### MCP Service Key Management
#### Feature Overview
The new MCP service secret key configuration feature supports permission control and usage management for API access.
#### Key Management Interface

#### Key Details View

#### Key Creation and Editing
Supports adding and editing MCP service access keys, configuring access permissions and usage limits.



#### Access Record Statistics
Provides detailed records and statistics of key usage, facilitating the monitoring and management of API usage.

#### Client Testing Examples
**No Key Provided (401 Error)**
When the client does not provide a valid key, the system returns a 401 Unauthorized error.

**Exceeded Daily Limit**
When the number of uses for the key exceeds the set daily limit, the system will reject the request and indicate that the limit has been exceeded.

## Temporary Experience Address
http://111.4.141.154:7002
guest/123456 (can only view public and their own)
admin/mcp@12345 (can manage all)
## Installation Guide
### 1. Pull the Project
Pull the project to the local machine.
### 2. Backend
## 2.1 Create Python Environment
Taking conda as an example, create a conda environment named mcp. It is recommended to use Python version 3.11.
Wait for the creation to succeed.
Switch to the newly created conda environment.
```
conda activate mcp
```
Navigate to the backend directory and install Python dependencies, using Tsinghua source as recommended.
```
cd backend
pip install -r ./requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
```
## 2.2 Adjusting the Configuration File
Create a new configuration file by copying config.jsonbak to config.json in the backend path.
## 2.3 Configuration File Structure
The configuration file `backend/config.json` contains the following main sections:
### 1. cors (Cross-Origin Resource Sharing Configuration)
```json
"cors": {
"origins": ["*"], // Allowed origin domains, "*" means all domains are allowed
"credentials": true, // Whether to allow sending credentials
"methods": ["*"], // Allowed HTTP methods, "*" means all methods are allowed
"headers": ["*"] // Allowed HTTP headers, "*" means all headers are allowed
}
```
### 2. api (API Configuration)
```json
"api": {
"prefix": "/api/v1/mcp", // API path prefix
"title": "MCP Server", // API title
"version": "1.0.0" // API version number
}
```
### 3. server (Server Configuration)
```json
"server": {
"host": "0.0.0.0", // The server binding address, 0.0.0.0 means listening on all network interfaces
"port": 8002, // The server listening port
"debug": true // Whether to enable debug mode
}
```
### 4. mcp (deprecated)
### 5. logging
```json
"logging": {
"level": "info", // Log level
"backup_count": 7 // Number of log backups
}
```
### 6. database (Database Configuration)
```json
"database": {
"type": "mysql", // Database type, supports mysql and sqlite
"file": "mcp.db", // Database file (for file-based databases like SQLite)
"mysql_host": "127.0.0.1", // MySQL host address
"mysql_port": 3306, // MySQL port
"mysql_user": "root", // MySQL username
"mysql_password": "123456", // MySQL password
"mysql_database": "mcp" // MySQL database name
}
```
The mysql mode will connect to the mysql database, and a new database needs to be created; the service will automatically initialize it upon startup.
The sqlite mode will automatically create a db database under backend when the service starts.
## 2.4 Start the Service
In the backend directory
```
python run.py
```
### 3. Frontend
The frontend folder is for the frontend project, and you need to install node. It is recommended to use yarn as the build tool (npm is also acceptable).
Environment version specifications:
- node: v18.20.4
- yarn: 1.22.15
## 3.1 Install Dependencies
```
cd frontend
yarn install
```
Wait for the installation to complete successfully.
## 3.2 Starting the Frontend
Enter the frontend folder
```
yarn run dev
```
Once started, you can access the frontend.
The default username and password are: admin mcp@12345
After starting, built-in example tools will be available. The database assistant and tavily_search tool need to be configured with the corresponding database information and key.
The backend address is configured in vite.config.ts, and the frontend will forward the /api requests to the backend service.
## 3.3 Packaging
Enter the frontend folder
```
yarn run build
```
After a successful build, place the generated dist folder into the backend/ folder, and you can directly access the backend port to preview the platform.
## Usage Instructions
## Configuration File Description
The configuration file `backend/config.json` contains the following main sections:
### 1. cors (Cross-Origin Resource Sharing Configuration)
```json
"cors": {
"origins": ["*"], // Allowed origin domains, "*" means all domains are allowed
"credentials": true, // Whether to allow sending credentials
"methods": ["*"], // Allowed HTTP methods, "*" means all methods are allowed
"headers": ["*"] // Allowed HTTP headers, "*" means all headers are allowed
}
```
### 2. api (API Configuration)
```json
"api": {
"prefix": "/api", // API path prefix
"title": "Egova AI MCP Server", // API title
"version": "1.0.0" // API version number
}
```
### 3. server (Server Configuration)
```json
"server": {
"host": "0.0.0.0", // Server binding address, 0.0.0.0 means listening on all network interfaces
"port": 8002, // Server listening port
"debug": true // Whether to enable debug mode
}
```
### 4. mcp (MCP Specific Configuration)
```json
"mcp": {
"port": 8002, // MCP server port
"sse_url": "http://10.4.1.132:8002/sse", // Server-Sent Events (SSE) URL
"enabled_tools": [] // List of enabled tools
}
```
### 5. logging(Logging Configuration)
```json
"logging": {
"level": "info", // Log level
"backup_count": 7 // Number of log backups
}
```
### 6. database (Database Configuration)
```json
"database": {
"type": "mysql", // Database type, supports mysql and sqlite
"file": "mcp.db", // Database file (for file-based databases like SQLite)
"mysql_host": "127.0.0.1", // MySQL host address
"mysql_port": 3306, // MySQL port
"mysql_user": "root", // MySQL username
"mysql_password": "root", // MySQL password
"mysql_database": "mcp" // MySQL database name
}
```
## MCP Tool Example Description
The following MCP examples will be automatically created when the system starts:
### 1. Calculator (计算工具)
Provides basic mathematical calculation functions, including addition, multiplication, and complex expression calculations.
### 2. Web Search Tool (web_search)
Provides web search functionality to retrieve information and trending topics from the internet.
### 3. Tavily Search Assistant
To perform real-time online searches using the Tavily API, you need to configure the Tavily API key.
### 4. Database Tool Assistant
Provides database operation functions, including table queries, field queries, and executing SQL statements, etc. Database connection parameters need to be configured.
### Custom MCP Tools
Users can customize MCP tools in the following ways:
1. Write tool code
2. Configure the required keys and parameters
3. Publish as an MCP service
For specific development specifications, please refer to the example code. Placeholders in the format `${parameter_name}` in the code will be automatically replaced by the actual configured parameter values at runtime.
## MCP Usage Effect
### Effect Description
Question: Query the device number and alarm time of 10 alarm data entries. First, use the tool to find out which alarm table to query, and then use the SQL query method to retrieve the data. This is not querying the table field information, but querying the row data recorded in the table.
The large model automatically executed the following steps based on the question and the MCP tool:
1. Retrieved the available MCP tools
- execute_raw_query
- get_all_tables
- get_table_columns
- get_table_data
2. Selected the get_all_tables tool to query all table data
```json
[{"name": "com_alarm_data", "comment": "", "CREATE_TIME": "2025-04-10 11:49:07", "UPDATE_TIME": "2025-05-07 13:56:17"}, {"name": "com_alarm_level", "comment": "", "CREATE_TIME": "2024-05-20 17:07:57", "UPDATE_TIME": null}, {"na...
```
3. Selected the com_base_alarm table
4. Chose the execute_raw_query tool to write an SQL query to retrieve device_id from the alarm table, but the result showed that this field does not exist.
5. Re-selected the get_table_columns tool to check which fields are available in the alarm table.
6. Selected the execute_raw_query tool again to write an SQL query to retrieve the DeviceCode and AlarmTime fields from the alarm table (since the question is about the alarm device number and time).
7. Called the chart MCP tool to generate the ECharts chart code, which was rendered on the page.

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...
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.