ShowDoc MCP Server
Automatically fetches API documentation from ShowDoc and generates Android code including Entity classes, Repository patterns, and Retrofit interfaces.
README
ShowDoc 自动化工具集
从 ShowDoc 自动获取 API 文档数据,并生成 Android 代码的 Python 工具集。
项目结构
fengli/
├── core/ # 核心模块:ShowDoc 客户端、验证码识别
├── android_codegen/ # Android 代码生成工具(Entity、Repository、Retrofit)
├── api_docs/ # API 文档示例和预研文档
├── mcp_showdoc_android/ # MCP 服务器实现
└── pyproject.toml # 项目配置
核心功能
1. ShowDoc 数据获取 (core/)
- 自动登录(支持密码或 Cookie 认证)
- Cookie 自动保存和复用(类似浏览器会话管理)
- 验证码识别(基于 ddddocr,识别准确率高)
- 结构化数据解析(分类、页面、API 定义)
- 支持按节点筛选数据
- 支持多种 URL 格式(标准格式和登录页面格式)
2. Android 代码生成 (android_codegen/)
- Entity 实体类生成
- Repository 数据仓库生成
- Retrofit 接口生成
- OkHttp 配置生成
3. MCP 服务器 (mcp_showdoc_android/)
- 提供 MCP 协议接口
- 支持通过 MCP 调用代码生成功能
快速开始
安装依赖
# 安装所有依赖
pip install -r requirements.txt
# 或安装完整项目(包括 MCP 服务器)
pip install -e .
基本使用
from core import ShowDocClient
# 初始化客户端
base_url = "https://doc.cqfengli.com/web/#/90/"
client = ShowDocClient(base_url, password="123456")
# 获取所有接口数据
api_tree = client.get_all_apis()
# 获取指定节点的数据
api_tree = client.get_all_apis(node_name="订单")
# 转换为字典格式
data = api_tree.to_dict()
测试
# 运行核心模块测试
cd core
python test.py
# 或从项目根目录运行
python -m core.test
模块说明
- core/: ShowDoc 客户端核心实现,详见 core/README.md
- android_codegen/: Android 代码生成工具,详见 android_codegen/README.md
- mcp_showdoc_android/: MCP 服务器,详见 mcp_showdoc_android/README.md
- api_docs/: API 文档示例,详见 api_docs/README.md
依赖要求
- Python >= 3.9
- 核心依赖:requests, opencv-python, numpy, ddddocr
开发规范
本项目遵循以下规范:
- 使用简体中文进行注释和文档
- 优先使用现代 Python 特性(类型注解、dataclass 等)
- 模块化设计,保持单一职责
- 详细的异常处理和错误提示
许可证
本项目为内部工具,仅供团队使用。
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.