Content
# General Personal MCP Server
A general-purpose personal MCP server that integrates multiple functional modules and supports continuous addition of new features.
## Quick Start: Using MCP in Cursor
### 1. Install the Project
```bash
# Execute in the project root directory (development mode installation)
pip install -e .
```
### 2. Configure MCP Server
Add the following configuration to the `.cursor/mcp.json` file of any project:
```json
{
"mcpServers": {
"personal-mcp": {
"command": "personal-mcp",
"args": [],
"cwd": ".",
"env": {
"PYTHONUTF8": "1"
}
}
}
}
```
### 3. Restart Cursor
After configuration, restart Cursor to use all MCP tools.
### 4. Available Tools
#### ShowDoc Related Tools
- `fetch_showdoc_apis` - Fetch interface tree from ShowDoc
- `fetch_showdoc_node_tree` - Fetch lightweight node tree
- `generate_android_from_showdoc` - Generate Android code from ShowDoc with one click
- `generate_flutter_from_showdoc` - Generate Flutter code from ShowDoc with one click
- `fetch_node_detail_info` - Query detailed information of a specified node
- `fetch_node_cookie` - Query Cookie information of a specified node
#### Cursor Cloud Agents API Tools
- `set_cursor_api_key_tool` - Set and cache Cursor API Key (required for first use)
- `list_cursor_agents_tool` - List all cloud agents
- `get_cursor_agent_status_tool` - Get agent status
- `get_cursor_agent_conversation_tool` - Get agent conversation history
- `add_cursor_agent_followup_tool` - Add follow-up instructions for agents
- `delete_cursor_agent_tool` - Delete agents
- `get_cursor_api_key_info_tool` - Get API Key information
- `list_cursor_models_tool` - List recommended models
- `list_cursor_repositories_tool` - List GitHub repositories
#### MarkItDown Tools
- `convert_to_markdown` - Convert various resources (URLs, files, etc.) to Markdown format
- Supports http://, https://, file://, data:// and other URI formats
- Can convert web pages, PDFs, Word documents, images and other formats
### 5. Usage Examples
#### First Use of Cursor Agents API
```json
{
"api_key": "your_cursor_api_key_here",
"fetch_user_info": true
}
```
Call tool: `set_cursor_api_key_tool`
#### Generate Android Code from ShowDoc
```json
{
"base_url": "https://doc.cqfengli.com/web/#/90/",
"password": "123456",
"node_name": "Order",
"base_package": "com.example.api",
"output_dir": "android_output"
}
```
Call tool: `generate_android_from_showdoc`
For more usage examples and detailed instructions, please see [mcp_server/README.md](mcp_server/README.md)
## Project Structure
```text
showdoc/
├── core/ # Core module: ShowDoc client, verification code recognition
├── android_codegen/ # Android code generation tool (Entity, Repository, Retrofit)
├── flutter_codegen/ # Flutter code generation tool
├── cursor_agents/ # Cursor Cloud Agents API client
├── mcp_server/ # MCP server implementation
├── api_docs/ # API document examples and research documents
└── pyproject.toml # Project configuration
```
## Core Functions
### 1. ShowDoc Data Acquisition and Code Generation
#### ShowDoc Data Acquisition (`core/`)
- Automatic login (support password or Cookie authentication)
- Automatic saving and reuse of Cookies (similar to browser session management)
- Verification code recognition (based on ddddocr, high recognition accuracy)
- Structured data parsing (classification, page, API definition)
- Support for screening data by node
- Support for multiple URL formats (standard, login page, `https://www.showdoc.com.cn/{item}/{page}` and other shared links)
#### Code Generation
- **Android** (`android_codegen/`): Entity class, Repository data warehouse, Retrofit interface, OkHttp configuration
- **Flutter** (`flutter_codegen/`): Entity class, Repository data warehouse, Dio Service interface, Dio configuration
### 2. Cursor Cloud Agents API (`cursor_agents/`)
- Dynamic API Key management and automatic caching
- Complete Cursor Cloud Agents API encapsulation
- Support for agent management, session query, follow-up instructions and other functions
### 3. MCP Server (`mcp_server/`)
Provides a unified MCP protocol interface, integrating all functional modules:
- ShowDoc related tools (crawling, code generation, etc.)
- Cursor Agents related tools (agent management, session query, etc.)
- MarkItDown tools (convert various resources to Markdown)
- Compression and decompression tools (ZIP, 7Z, RAR)
- Continuously expanding...
## Development and Use
### Install Dependencies
```bash
# Install all dependencies
pip install -r requirements.txt
# Or install the complete project (including MCP server)
pip install -e .
```
### Python Code Usage Example
```python
from core import ShowDocClient
# Initialize client
base_url = "https://doc.cqfengli.com/web/#/90/"
client = ShowDocClient(base_url, password="123456")
# Get all interface data
api_tree = client.get_all_apis()
# Get data for a specified node
api_tree = client.get_all_apis(node_name="Order")
# Convert to dictionary format
data = api_tree.to_dict()
```
### Run Tests
```bash
# Run core module tests
python -m core.test
# Run Cursor Agents API tests
python -m cursor_agents.test
# Run Flutter code generation tests
python -m flutter_codegen.test
```
## Module Description
- **core/**: ShowDoc client core implementation, see [core/README.md](core/README.md)
- **android_codegen/**: Android code generation tool, see [android_codegen/README.md](android_codegen/README.md)
- **flutter_codegen/**: Flutter code generation tool, see [flutter_codegen/README.md](flutter_codegen/README.md)
- **cursor_agents/**: Cursor Cloud Agents API client, see [cursor_agents/README.md](cursor_agents/README.md)
- **mcp_server/**: MCP server, see [mcp_server/README.md](mcp_server/README.md)
- **api_docs/**: API document examples, see [api_docs/README.md](api_docs/README.md)
- **archive_tools/**: General compression/decompression tool module (ZIP/7Z/RAR), and encapsulated as MCP tool, see [archive_tools/README.md](archive_tools/README.md)
## Dependency Requirements
- Python >= 3.9
- Core dependencies: requests, opencv-python, numpy, ddddocr
## Development Specifications
This project follows the following specifications:
- Use simplified Chinese for comments and documentation
- Prioritize modern Python features (type annotations, dataclass, etc.)
- Modular design, maintaining a single responsibility
- Detailed exception handling and error prompts
## License
This project is an internal tool, only for team use.