# mcprapi **Repository Path**: chuangyeshuo/mcprapi ## Basic Information - **Project Name**: mcprapi - **Description**: No description available - **Primary Language**: Go - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2025-07-27 - **Last Updated**: 2025-07-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
MCP RAPI Logo # ๐Ÿ”ง MCP RAPI **Modern API Permission Management System with MCP Integration** [![Go Version](https://img.shields.io/badge/Go-1.21+-00ADD8?style=for-the-badge&logo=go)](https://golang.org/) [![Vue Version](https://img.shields.io/badge/Vue-2.7+-4FC08D?style=for-the-badge&logo=vue.js)](https://vuejs.org/) [![License](https://img.shields.io/badge/License-MIT-blue?style=for-the-badge)](LICENSE) [![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?style=for-the-badge&logo=docker)](https://docker.com/) [![MCP](https://img.shields.io/badge/MCP-Compatible-FF6B6B?style=for-the-badge)](https://modelcontextprotocol.io/) [๐ŸŽฏ Features](#-features) โ€ข [๐Ÿš€ Quick Start](#-quick-start) โ€ข [๐Ÿ“– Documentation](#-documentation) โ€ข [๐Ÿค Contributing](#-contributing) โ€ข [๐ŸŒŸ Star History](#-star-history)
--- ## ๐Ÿ’ก What is MCP RAPI? **MCP RAPI** (Model Context Protocol - Role-based API) is a **modern, enterprise-grade API permission management system** built with Go and Vue.js, designed specifically for **MCP (Model Context Protocol)** environments. It provides comprehensive RBAC (Role-Based Access Control) capabilities for managing API access permissions across your organization with seamless MCP integration. ### ๐ŸŽฏ Perfect for: - **๐Ÿค– AI/LLM Applications** - MCP-compatible API permission management - **๐Ÿ—๏ธ Microservices Architecture** - Centralized API permission control - **๐Ÿข Enterprise Applications** - Multi-tenant permission management - **๐Ÿ‘ฅ Development Teams** - Streamlined API access workflows - **๐Ÿ”„ DevOps Automation** - Automated permission deployment ## โšก Key Features
## ๐Ÿ› ๏ธ Tech Stack
### Backend ![Go](https://img.shields.io/badge/Go-00ADD8?style=for-the-badge&logo=go&logoColor=white) ![Gin](https://img.shields.io/badge/Gin-00ADD8?style=for-the-badge&logo=go&logoColor=white) ![GORM](https://img.shields.io/badge/GORM-00ADD8?style=for-the-badge&logo=go&logoColor=white) ![Casbin](https://img.shields.io/badge/Casbin-FF6B6B?style=for-the-badge) ![JWT](https://img.shields.io/badge/JWT-000000?style=for-the-badge&logo=JSON%20web%20tokens&logoColor=white) ![MySQL](https://img.shields.io/badge/MySQL-4479A1?style=for-the-badge&logo=mysql&logoColor=white) ![Redis](https://img.shields.io/badge/Redis-DC382D?style=for-the-badge&logo=redis&logoColor=white) ### Frontend ![Vue.js](https://img.shields.io/badge/Vue.js-4FC08D?style=for-the-badge&logo=vue.js&logoColor=white) ![Element UI](https://img.shields.io/badge/Element%20UI-409EFF?style=for-the-badge&logo=element&logoColor=white) ![Axios](https://img.shields.io/badge/Axios-5A29E4?style=for-the-badge&logo=axios&logoColor=white) ![Vue Router](https://img.shields.io/badge/Vue%20Router-4FC08D?style=for-the-badge&logo=vue.js&logoColor=white) ![Vuex](https://img.shields.io/badge/Vuex-4FC08D?style=for-the-badge&logo=vue.js&logoColor=white) ### DevOps & Infrastructure ![Docker](https://img.shields.io/badge/Docker-2496ED?style=for-the-badge&logo=docker&logoColor=white) ![Docker Compose](https://img.shields.io/badge/Docker%20Compose-2496ED?style=for-the-badge&logo=docker&logoColor=white) ![Nginx](https://img.shields.io/badge/Nginx-009639?style=for-the-badge&logo=nginx&logoColor=white) ![GitHub Actions](https://img.shields.io/badge/GitHub%20Actions-2088FF?style=for-the-badge&logo=github-actions&logoColor=white)
## ๐Ÿ“ Project Structure ``` ๐Ÿ“ฆ mcp-rapi/ โ”œโ”€โ”€ ๐Ÿ”ง backend/ # Go Backend Service โ”‚ โ”œโ”€โ”€ ๐Ÿš€ cmd/ # Application Entry Point โ”‚ โ”‚ โ””โ”€โ”€ main.go # Main application โ”‚ โ”œโ”€โ”€ โš™๏ธ configs/ # Configuration Files โ”‚ โ”‚ โ”œโ”€โ”€ dev.yaml # Development config โ”‚ โ”‚ โ”œโ”€โ”€ prod.yaml # Production config โ”‚ โ”‚ โ””โ”€โ”€ casbin_model.conf # Casbin RBAC model โ”‚ โ”œโ”€โ”€ ๐Ÿ—๏ธ internal/ # Internal Application Code โ”‚ โ”‚ โ”œโ”€โ”€ ๐ŸŽฏ domain/ # Business Domain Layer โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“‹ entity/ # Domain Entities โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ—„๏ธ repository/ # Repository Interfaces โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ”ง service/ # Business Services โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿญ infrastructure/ # Infrastructure Layer โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ’พ cache/ # Redis Cache Implementation โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ฆ container/ # Dependency Injection โ”‚ โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ—ƒ๏ธ database/ # Database Connection โ”‚ โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ—„๏ธ repository/ # Repository Implementation โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ› ๏ธ pkg/ # Internal Utilities โ”‚ โ”‚ โ””โ”€โ”€ ๐ŸŒ transport/ # Transport Layer โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ”— http/ # HTTP Handlers โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ”’ middleware/ # HTTP Middleware โ”‚ โ”œโ”€โ”€ ๐Ÿ“š pkg/ # Public Utilities โ”‚ โ”‚ โ””โ”€โ”€ casbinx/ # Casbin Extensions โ”‚ โ””โ”€โ”€ ๐Ÿ“œ scripts/ # Utility Scripts โ”‚ โ””โ”€โ”€ init_admin.go # Admin Initialization โ”œโ”€โ”€ ๐ŸŽจ frontend/ # Vue.js Frontend โ”‚ โ”œโ”€โ”€ ๐ŸŒ public/ # Static Assets โ”‚ โ”œโ”€โ”€ ๐Ÿ“ src/ # Source Code โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ”Œ api/ # API Client โ”‚ โ”‚ โ”œโ”€โ”€ ๐ŸŽญ assets/ # Assets โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿงฉ components/ # Vue Components โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ—บ๏ธ router/ # Vue Router Configuration โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ—ƒ๏ธ store/ # Vuex Store โ”‚ โ”‚ โ”œโ”€โ”€ ๐ŸŽจ styles/ # Global Styles โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ› ๏ธ utils/ # Utility Functions โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ‘๏ธ views/ # Vue Views/Pages โ”‚ โ”œโ”€โ”€ ๐Ÿ“ฆ package.json # NPM Dependencies โ”‚ โ””โ”€โ”€ โš™๏ธ vue.config.js # Vue CLI Configuration โ”œโ”€โ”€ ๐Ÿณ docker-compose.yml # Docker Compose Configuration โ”œโ”€โ”€ ๐Ÿณ docker-compose.dev.yml # Development Docker Compose โ”œโ”€โ”€ ๐Ÿ“„ .env.example # Environment Variables Template โ”œโ”€โ”€ ๐ŸŽจ assets/ # Project Assets โ”‚ โ””โ”€โ”€ logo.svg # Project Logo โ”œโ”€โ”€ ๐Ÿ“š docs/ # Documentation โ”œโ”€โ”€ ๐Ÿš€ deploy/ # Deployment & Container Management โ”‚ โ”œโ”€โ”€ ๐Ÿณ docker-compose.ghcr.yml # GHCR Docker Compose โ”‚ โ”œโ”€โ”€ ๐Ÿ”ง build-and-push.sh # Build & Push Images Script โ”‚ โ”œโ”€โ”€ ๐Ÿš€ deploy-ghcr.sh # GHCR Deployment Script โ”‚ โ”œโ”€โ”€ โš™๏ธ .env.production # Production Environment Config โ”‚ โ”œโ”€โ”€ ๐Ÿ“– README.md # Deployment Guide โ”‚ โ””โ”€โ”€ ๐Ÿ“š GITHUB_CONTAINER_REGISTRY_GUIDE.md # GHCR Guide โ”œโ”€โ”€ ๐Ÿ”ง mcp-example/ # MCP Integration Examples โ”œโ”€โ”€ fastmcp_http_server.py # FastMCP HTTP Server โ”œโ”€โ”€ requirements.txt # Python Dependencies โ””โ”€โ”€ start_fastmcp_http_server.sh # Startup Script ``` ## ๐Ÿš€ Quick Start ### ๐Ÿณ One-Click Docker Setup (Recommended) Get up and running in under 2 minutes: ```bash # 1. Clone the repository git clone https://github.com/chuangyeshuo/mcprapi.git cd mcprapi # 2. Start development environment (with hot reload & admin tools) docker-compose -f docker-compose.dev.yml up -d # 3. Check service status docker-compose -f docker-compose.dev.yml ps # ๐ŸŽ‰ Your MCP RAPI system is now running! ``` **๐ŸŒ Access URLs:** - **Frontend Dashboard**: http://localhost:8082 - **Backend API**: http://localhost:8081 - **API Documentation**: http://localhost:8081/swagger/index.html - **Health Check**: http://localhost:8081/health - **Database Admin**: http://localhost:8083 (Adminer) - **Redis Admin**: http://localhost:8084 (Redis Commander) **๐Ÿ”‘ Default Login:** ``` Username: admin Password: admin ``` > โš ๏ธ **Security Note**: Please change the default password immediately after first login! ### ๐Ÿญ Production Deployment #### ๐Ÿณ GitHub Container Registry (ๆŽจ่) ไฝฟ็”จ้ข„ๆž„ๅปบ็š„Docker้•œๅƒๅฟซ้€Ÿ้ƒจ็ฝฒ๏ผš ```bash # 1. ่ฟ›ๅ…ฅ้ƒจ็ฝฒ็›ฎๅฝ• cd deploy # 2. ้…็ฝฎ็Žฏๅขƒๅ˜้‡ cp .env.production .env # ็ผ–่พ‘ .env ๆ–‡ไปถ๏ผŒ่ฎพ็ฝฎๅฟ…่ฆ็š„็Žฏๅขƒๅ˜้‡ # 3. ไฝฟ็”จGHCR้•œๅƒๅฏๅŠจๆœๅŠก docker-compose -f docker-compose.ghcr.yml up -d # 4. ๆฃ€ๆŸฅๆœๅŠก็Šถๆ€ docker-compose -f docker-compose.ghcr.yml ps ``` **๐Ÿ“š ่ฏฆ็ป†ๆŒ‡ๅ—**: ๆŸฅ็œ‹ [`deploy/README.md`](deploy/README.md) ่Žทๅ–ๅฎŒๆ•ด็š„้ƒจ็ฝฒ่ฏดๆ˜Ž #### ๐Ÿ—๏ธ ๆœฌๅœฐๆž„ๅปบ้ƒจ็ฝฒ ```bash # 1. Configure environment variables cp .env.example .env # Edit .env file with your production settings # 2. Start production environment docker-compose up -d # 3. Check service status docker-compose ps ``` **Production URLs:** - **Frontend**: http://localhost:8082 - **Backend API**: http://localhost:8081 - **API Documentation**: http://localhost:8081/swagger/index.html - **Health Check**: http://localhost:8081/health ### ๐Ÿ’ป Local Development Setup
๐Ÿ“‹ Prerequisites - **Go** 1.21+ ([Download](https://golang.org/dl/)) - **Node.js** 18+ ([Download](https://nodejs.org/)) - **MySQL** 8.0+ ([Download](https://dev.mysql.com/downloads/)) - **Redis** 6.0+ ([Download](https://redis.io/download)) - **Python** 3.8+ (for MCP integration)
#### ๐Ÿ”ง Backend Setup ```bash # Navigate to backend directory cd backend # Install Go dependencies go mod download # Copy and edit configuration cp configs/dev.yaml.example configs/dev.yaml # Edit configs/dev.yaml with your database settings # Initialize database (creates admin user) go run scripts/init_admin.go # Start the backend server with hot reload go run cmd/main.go --config configs/dev.yaml # ๐Ÿš€ Backend running on http://localhost:8081 ``` #### ๐ŸŽจ Frontend Setup ```bash # Navigate to frontend directory cd frontend # Install Node.js dependencies npm install # Start development server with hot reload npm run serve # ๐ŸŽจ Frontend running on http://localhost:8080 ``` #### ๐Ÿค– MCP Server Setup (Optional) ```bash # Navigate to MCP example directory cd mcp-example # Install Python dependencies pip install -r requirements.txt # Start FastMCP HTTP server ./start_fastmcp_http_server.sh # ๐Ÿค– MCP Server running on http://localhost:8080 ``` ## ๐Ÿ“– Documentation ### ๐Ÿ”— API Documentation Interactive API documentation is available once the system is running: **๐Ÿ“š Swagger UI**: [http://localhost:8081/swagger/index.html](http://localhost:8081/swagger/index.html) ### ๐Ÿ”‘ Default Credentials ``` ๐Ÿ‘ค Username: admin ๐Ÿ”’ Password: admin ``` > โš ๏ธ **Security Note**: Please change the default password immediately after first login! ### ๐Ÿ“š Additional Resources - [๐Ÿ“š **ๆ–‡ๆกฃๆ€ป่งˆ**](DOCS_OVERVIEW.md) - **ๅฎŒๆ•ดๆ–‡ๆกฃๅฏผ่ˆชๅ’Œๅญฆไน ่ทฏๅพ„** - [๐Ÿš€ Quick Start Guide](QUICK_START.md) - **Start here for fastest setup!** - [๐Ÿ“‹ Complete Deployment Guide](DEPLOYMENT_GUIDE.md) - **Comprehensive deployment instructions** - [๐Ÿ—๏ธ System Architecture](APIๅคš็งŸๆˆทๆŽˆๆƒ็ฎก็†็ณป็ปŸๆžถๆž„ๆ–‡ๆกฃ.md) - [๐Ÿ—ƒ๏ธ Database Setup Guide](DATABASE_INIT.md) - [๐Ÿณ Docker Deployment Guide](DOCKER_DEPLOYMENT.md) - [๐Ÿข Department Management](ๆ–ฐๅขž้ƒจ้—จๆต็จ‹ๆ–‡ๆกฃ.md) - [๐Ÿค– MCP Integration Guide](mcp-example/FASTMCP_HTTP_CONFIG.md) ### ๐Ÿ”ง Deployment Options | ้ƒจ็ฝฒๆ–นๅผ | ้€‚็”จๅœบๆ™ฏ | ้šพๅบฆ | ๆŽจ่ๆŒ‡ๆ•ฐ | ๆ–‡ๆกฃ้“พๆŽฅ | |---------|---------|------|---------|----------| | [๐Ÿณ GitHub Container Registry](deploy/README.md) | ็”Ÿไบง็Žฏๅขƒใ€ๅฟซ้€Ÿ้ƒจ็ฝฒ | โญ | โญโญโญโญโญ | [้ƒจ็ฝฒๆŒ‡ๅ—](DEPLOY_QUICK_START.md) | | [๐Ÿณ Docker Compose](DEPLOYMENT_GUIDE.md#-docker-compose-ไธ€้”ฎ้ƒจ็ฝฒๆŽจ่) | ็”Ÿไบง็Žฏๅขƒใ€ๅ›ข้˜Ÿๅไฝœ | โญโญ | โญโญโญโญ | [ๅฎŒๆ•ดๆŒ‡ๅ—](DEPLOYMENT_GUIDE.md) | | [๐Ÿ’ป ๆ‰‹ๅŠจ้ƒจ็ฝฒ](DEPLOYMENT_GUIDE.md#-ๆ‰‹ๅŠจ้ƒจ็ฝฒ) | ๅญฆไน ็ ”็ฉถใ€ๆทฑๅบฆๅฎšๅˆถ | โญโญโญโญ | โญโญโญ | [ๆ‰‹ๅŠจ้ƒจ็ฝฒ](DEPLOYMENT_GUIDE.md) | | [โ˜๏ธ ไบ‘ๅŽŸ็”Ÿ้ƒจ็ฝฒ](DEPLOYMENT_GUIDE.md#-็›‘ๆŽงไธŽๆ—ฅๅฟ—) | ๅคง่ง„ๆจก็”Ÿไบง็Žฏๅขƒ | โญโญโญ | โญโญโญโญ | [ไบ‘ๅŽŸ็”ŸๆŒ‡ๅ—](DEPLOYMENT_GUIDE.md) | **๐ŸŽฏ ้€‰ๆ‹ฉๅปบ่ฎฎ๏ผš** - **ๆ–ฐๆ‰‹็”จๆˆท**: ๆŽจ่ไฝฟ็”จ [GitHub Container Registry ้ƒจ็ฝฒ](DEPLOY_QUICK_START.md) - ๆœ€ๅฟซๆœ€็ฎ€ๅ• - **ๅผ€ๅ‘่€…**: ๆŽจ่ๆŸฅ็œ‹ [ๅฎŒๆ•ด้ƒจ็ฝฒๆŒ‡ๅ—](DEPLOYMENT_GUIDE.md) ไบ†่งฃๆ‰€ๆœ‰้€‰้กน - **่ฟ็ปดๅ›ข้˜Ÿ**: ๆŽจ่้˜…่ฏป [ๆ€ง่ƒฝไผ˜ๅŒ–](DEPLOYMENT_GUIDE.md#-ๆ€ง่ƒฝไผ˜ๅŒ–) ๅ’Œ [ๅฎ‰ๅ…จ้…็ฝฎ](DEPLOYMENT_GUIDE.md#-ๅฎ‰ๅ…จ้…็ฝฎ) ็ซ ่Š‚ **๐Ÿ“‹ ็›ธๅ…ณๅทฅๅ…ท๏ผš** - [๐Ÿ”‘ GitHub Token ๆƒ้™ๆฃ€ๆŸฅ](deploy/check-token-permissions.sh) - ้ชŒ่ฏ้ƒจ็ฝฒๆƒ้™ - [๐Ÿ“Š ๆž„ๅปบ็Šถๆ€ๆŸฅ็œ‹](deploy/BUILD_STATUS.md) - ๆŸฅ็œ‹ๆœ€ๆ–ฐๆž„ๅปบไฟกๆฏ - [๐Ÿ› ๏ธ ๆ•…้šœๆŽ’้™คๆŒ‡ๅ—](deploy/GITHUB_PACKAGES_TROUBLESHOOTING.md) - ่งฃๅ†ณๅธธ่ง้—ฎ้ข˜ ## ๐ŸŒŸ Key Capabilities ### ๐Ÿ” Permission Management - **Fine-grained Control**: API-level permission management - **Role-based Access**: Hierarchical role system - **Dynamic Updates**: Real-time permission changes - **Audit Trail**: Complete permission history ### ๐Ÿข Multi-tenant Architecture - **Organization Isolation**: Complete data separation - **Department Hierarchy**: Multi-level organizational structure - **Business Line Support**: Cross-department collaboration - **Scalable Design**: Supports thousands of users ### ๐Ÿค– MCP Integration - **Native Support**: Built-in MCP protocol compatibility - **AI-Ready**: Perfect for LLM and AI applications - **Context Management**: Intelligent context handling - **Protocol Compliance**: Full MCP specification support ## ๐Ÿค Contributing We welcome contributions from the community! Here's how you can help make MCP RAPI even better: ### ๐Ÿ› Bug Reports Found a bug? Please create an issue with: - **Clear Description**: What went wrong? - **Reproduction Steps**: How can we reproduce it? - **Expected Behavior**: What should have happened? - **Environment**: OS, browser, versions, etc. ### ๐Ÿ’ก Feature Requests Have a great idea? We'd love to hear it! Please include: - **Use Case**: Why is this feature needed? - **Proposed Solution**: How should it work? - **Examples**: Any relevant examples or mockups ### ๐Ÿ”ง Development Workflow 1. **Fork** the repository 2. **Create** a feature branch (`git checkout -b feature/amazing-feature`) 3. **Commit** your changes (`git commit -m 'feat: add amazing feature'`) 4. **Push** to the branch (`git push origin feature/amazing-feature`) 5. **Open** a Pull Request ### ๐Ÿ“ Code Standards - **Go**: Follow [Go Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments) - **Vue.js**: Follow [Vue.js Style Guide](https://vuejs.org/style-guide/) - **Commits**: Use [Conventional Commits](https://www.conventionalcommits.org/) - **Testing**: Include tests for new features - **Documentation**: Update docs for API changes ## ๐ŸŒŸ Star History [![Star History Chart](https://api.star-history.com/svg?repos=chuangyeshuo/mcprapi&type=Date)](https://star-history.com/#chuangyeshuo/mcprapi&Date) ## ๐Ÿš€ Roadmap - [ ] **GraphQL API Support** - Alternative to REST APIs - [ ] **Advanced Analytics** - Permission usage insights - [ ] **SSO Integration** - SAML, OAuth2, OIDC support - [ ] **Mobile App** - Native mobile management app - [ ] **Kubernetes Operator** - K8s native deployment - [ ] **Advanced MCP Features** - Enhanced protocol support ## ๐Ÿ“„ License This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details. ## ๐Ÿ™ Acknowledgments Special thanks to these amazing projects that make MCP RAPI possible: - [๐Ÿ” Casbin](https://casbin.org/) - Authorization library that powers our RBAC - [๐ŸŒ Gin](https://gin-gonic.com/) - High-performance HTTP web framework - [๐ŸŽจ Vue.js](https://vuejs.org/) - Progressive JavaScript framework - [๐Ÿงฉ Element UI](https://element.eleme.io/) - Beautiful Vue.js component library - [๐Ÿค– Model Context Protocol](https://modelcontextprotocol.io/) - AI context management standard ## ๐Ÿ’ฌ Community & Support - **๐Ÿ’ฌ Discussions**: [GitHub Issues](https://github.com/chuangyeshuo/mcprapi/issues) - **๐Ÿ› Issues**: [GitHub Issues](https://github.com/chuangyeshuo/mcprapi/issues) - **๐Ÿ“ง Email**: support@mcp-rapi.com - **๐Ÿ“ฑ Discord**: [Join our Discord](https://discord.gg/DmyRA3Nj) ---
**Made with โค๏ธ by the MCP RAPI Community** [โญ Star us on GitHub](https://github.com/chuangyeshuo/mcprapi) โ€ข [๐Ÿ› Report Bug](https://github.com/chuangyeshuo/mcprapi/issues) โ€ข [๐Ÿ’ก Request Feature](https://github.com/chuangyeshuo/mcprapi/issues) โ€ข [๐Ÿ’ฌ Join Discussion](https://github.com/chuangyeshuo/mcprapi/issues) **๐Ÿš€ Ready to revolutionize your API permission management? Get started now!**