Skip to content

๐Ÿ” MCP RAPI - ไผไธš็บงๅคš็งŸๆˆทAPIๆƒ้™็ฎก็†็ณป็ปŸ | Enterprise Multi-tenant API Permission Management System with MCP Protocol Support

License

Notifications You must be signed in to change notification settings

chuangyeshuo/mcprapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
MCP RAPI Logo

๐Ÿ”ง MCP RAPI

Modern API Permission Management System with MCP Integration

Go Version Vue Version License Docker MCP

๐ŸŽฏ Features โ€ข ๐Ÿš€ Quick Start โ€ข ๐Ÿ“– Documentation โ€ข ๐Ÿค Contributing โ€ข ๐ŸŒŸ 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 Gin GORM Casbin JWT MySQL Redis

Frontend

Vue.js Element UI Axios Vue Router Vuex

DevOps & Infrastructure

Docker Docker Compose Nginx GitHub Actions

๐Ÿ“ 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:

# 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:

๐Ÿ”‘ Default Login:

Username: admin
Password: admin

โš ๏ธ Security Note: Please change the default password immediately after first login!

๐Ÿญ Production Deployment

๐Ÿณ GitHub Container Registry (ๆŽจ่)

ไฝฟ็”จ้ข„ๆž„ๅปบ็š„Docker้•œๅƒๅฟซ้€Ÿ้ƒจ็ฝฒ๏ผš

# 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 ่Žทๅ–ๅฎŒๆ•ด็š„้ƒจ็ฝฒ่ฏดๆ˜Ž

๐Ÿ—๏ธ ๆœฌๅœฐๆž„ๅปบ้ƒจ็ฝฒ

# 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:

๐Ÿ’ป Local Development Setup

๐Ÿ“‹ Prerequisites

๐Ÿ”ง Backend Setup

# 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

# 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)

# 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

๐Ÿ”‘ Default Credentials

๐Ÿ‘ค Username: admin
๐Ÿ”’ Password: admin

โš ๏ธ Security Note: Please change the default password immediately after first login!

๐Ÿ“š Additional Resources

๐Ÿ”ง Deployment Options

้ƒจ็ฝฒๆ–นๅผ ้€‚็”จๅœบๆ™ฏ ้šพๅบฆ ๆŽจ่ๆŒ‡ๆ•ฐ ๆ–‡ๆกฃ้“พๆŽฅ
๐Ÿณ GitHub Container Registry ็”Ÿไบง็Žฏๅขƒใ€ๅฟซ้€Ÿ้ƒจ็ฝฒ โญ โญโญโญโญโญ ้ƒจ็ฝฒๆŒ‡ๅ—
๐Ÿณ Docker Compose ็”Ÿไบง็Žฏๅขƒใ€ๅ›ข้˜Ÿๅไฝœ โญโญ โญโญโญโญ ๅฎŒๆ•ดๆŒ‡ๅ—
๐Ÿ’ป ๆ‰‹ๅŠจ้ƒจ็ฝฒ ๅญฆไน ็ ”็ฉถใ€ๆทฑๅบฆๅฎšๅˆถ โญโญโญโญ โญโญโญ ๆ‰‹ๅŠจ้ƒจ็ฝฒ
โ˜๏ธ ไบ‘ๅŽŸ็”Ÿ้ƒจ็ฝฒ ๅคง่ง„ๆจก็”Ÿไบง็Žฏๅขƒ โญโญโญ โญโญโญโญ ไบ‘ๅŽŸ็”ŸๆŒ‡ๅ—

๐ŸŽฏ ้€‰ๆ‹ฉๅปบ่ฎฎ๏ผš

๐Ÿ“‹ ็›ธๅ…ณๅทฅๅ…ท๏ผš

๐ŸŒŸ 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

๐ŸŒŸ Star History

Star History Chart

๐Ÿš€ 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 file for details.

๐Ÿ™ Acknowledgments

Special thanks to these amazing projects that make MCP RAPI possible:

๐Ÿ’ฌ Community & Support


Made with โค๏ธ by the MCP RAPI Community

โญ Star us on GitHub โ€ข ๐Ÿ› Report Bug โ€ข ๐Ÿ’ก Request Feature โ€ข ๐Ÿ’ฌ Join Discussion

๐Ÿš€ Ready to revolutionize your API permission management? Get started now!

About

๐Ÿ” MCP RAPI - ไผไธš็บงๅคš็งŸๆˆทAPIๆƒ้™็ฎก็†็ณป็ปŸ | Enterprise Multi-tenant API Permission Management System with MCP Protocol Support

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages