How to set up and start a complete MCP Gateway development environment locally
This document describes how to set up and start a complete MCP Gateway development environment locally, including starting all necessary service components.
Before getting started, please ensure your system has the following software installed:
Version control tool
Go programming language environment
JavaScript runtime environment (includes npm)
The MCP Gateway project consists of the following core components:
apiserver
Provides API services for configuration management, user interfaces, etc.
mcp-gateway
Core gateway service that handles MCP protocol conversion
mock-server
Mock user service for development testing
web
Management interface frontend
Fork Project
Visit the MCP Gateway code repository, click the Fork
button to fork the project to your GitHub account
Clone Locally
Install Go Dependencies
Install Node.js Dependencies
Backend Configuration
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 Disk, DB storage methods.
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.
mcp-gateway will start by default on http://localhost:5235
for handling MCP protocol requests.
apiserver will start by default on http://localhost:5234
.
http://localhost:5236
http://localhost:5237
After running the command in the web terminal, it will display the access address.
After startup is complete, you can access the management interface in your browser using the address shown in the terminal.
SUPER_ADMIN_USERNAME
SUPER_ADMIN_PASSWORD
After logging in, you can modify the username and password in the management interface
Some services may require specific environment variables to work properly. You can set these variables in the .env
file:
If you encounter port conflicts, you can modify port configuration in environment variables:
If you encounter dependency installation issues:
Go Dependency Issues
Node.js Dependency Issues
Add Upstream Repository
Sync Upstream Code
Create Feature Branch
Push After Development
Create Pull Request
Create a Pull Request on GitHub to merge your branch into the main repository’s main branch
Use feat/
prefix, such as feat/add-auth-module
Use fix/
prefix, such as fix/memory-leak
Testing
Before submitting a PR, ensure your code passes all tests
Code Synchronization
Keep your fork repository synchronized with the upstream repository to avoid code conflicts
Code Standards
Follow the project’s code standards and commit message format
After successfully starting the local development environment, you can: