Prerequisites
Before getting started, please ensure your system has the following software installed:Git
Version control tool
Go 1.24.1+
Go programming language environment
Node.js v20.18.0+
JavaScript runtime environment (includes npm)
Project Architecture Overview
The MCP Gateway project consists of the following core components:apiserver
apiserver
Provides API services for configuration management, user interfaces, etc.
mcp-gateway
mcp-gateway
Core gateway service that handles MCP protocol conversion
mock-server
mock-server
Mock user service for development testing
web
web
Management interface frontend
Environment Setup Steps
1. Get Source Code
1
Fork Project
Visit the MCP Gateway code repository, click the
Fork button to fork the project to your GitHub account2
Clone Locally
2. Install Dependencies
1
Install Go Dependencies
2
Install Node.js Dependencies
3. Configure Environment
1
Backend Configuration
2
Frontend Configuration
You can start development without modifying anything, using the default configuration. You can also modify configuration files to meet your environment or development needs, such as switching between DB and API storage methods.
Start Development Services
You need 4 terminal windows to run all services. This approach of running multiple services on the host machine allows for easy restart and debugging during development.Terminal 1: Start mcp-gateway
http://localhost:5235 for handling MCP protocol requests.
Terminal 2: Start apiserver
http://localhost:5234.
Terminal 3: Start mock-server
- mock-server will start by default on
http://localhost:5236 - mock-server-sse will start by default on
http://localhost:5237
Terminal 4: Start web frontend
Access Management Interface
After startup is complete, you can access the management interface in your browser using the address shown in the terminal.Default Login Information
- Username: Determined by environment variable
SUPER_ADMIN_USERNAME - Password: Determined by environment variable
SUPER_ADMIN_PASSWORD
First Login
After logging in, you can modify the username and password in the management interface
Common Issues
Environment Variable Settings
Some services may require specific environment variables to work properly. You can set these variables in the.env file:
Port Conflicts
If you encounter port conflicts, you can modify port configuration in environment variables:Dependency Issues
If you encounter dependency installation issues:Go Dependency Issues
Go Dependency Issues
Node.js Dependency Issues
Node.js Dependency Issues
Development Workflow
Code Contribution Process
1
Add Upstream Repository
2
Sync Upstream Code
3
Create Feature Branch
4
Push After Development
5
Create Pull Request
Create a Pull Request on GitHub to merge your branch into the main repository’s main branch
Branch Naming Conventions
New Features
Use
feat/ prefix, such as feat/add-auth-moduleBug Fixes
Use
fix/ prefix, such as fix/memory-leakDevelopment Considerations
Testing
Testing
Before submitting a PR, ensure your code passes all tests
Code Synchronization
Code Synchronization
Keep your fork repository synchronized with the upstream repository to avoid code conflicts
Code Standards
Code Standards
Follow the project’s code standards and commit message format