We welcome contributions to MetaMCP! This guide will help you get started.
-
Clone the repository:
git clone https://github.com/metatool-ai/metamcp.git cd metamcp -
Install dependencies:
pnpm install
-
Set up environment:
cp example.env .env
-
Start development:
pnpm dev
For development with Docker that includes hot reloading for both frontend and backend:
# Start development environment with hot reload
pnpm run dev:docker
# Stop development environment
pnpm run dev:docker:down
# Clean up development environment (removes volumes)
pnpm run dev:docker:cleanFeatures:
- 🔄 Hot Reload: Both frontend (Next.js) and backend (Express) automatically reload on code changes
- 🐳 Containerized: Full development environment in Docker with PostgreSQL
- 📊 Ports: Frontend on 12008, Backend on 12009, PostgreSQL on 9433
- 🛠️ Development Tools: Includes all necessary development dependencies and tools
Requirements:
- Docker and Docker Compose installed
.envfile configured (copy fromexample.env)
Note: The first run may take longer as it builds the development image. Subsequent runs will be faster.
MetaMCP supports OpenID Connect authentication for enterprise SSO integration. This is optional and can be configured alongside the default email/password authentication.
To enable OIDC authentication, add the following environment variables to your .env file:
OIDC_CLIENT_ID=your-oidc-client-id
OIDC_CLIENT_SECRET=your-oidc-client-secret
OIDC_DISCOVERY_URL=https://your-provider.com/.well-known/openid-configurationFor now full endpoints discovery is not supported, so you'll need to provide the authorization endpoint:
OIDC_AUTHORIZATION_URL=https://your-provider.com/auth/authorizeOIDC_PROVIDER_ID=oidc # Default: "oidc"
OIDC_SCOPES=openid email profile # Default: "openid email profile"
OIDC_PKCE=true # Default: true (recommended for security)Once configured, users will see a "Login with OIDC" button on the login page. The authentication flow follows the OpenID Connect Authorization Code flow with PKCE for enhanced security.
- PKCE (Proof Key for Code Exchange) is enabled by default for enhanced security
- The redirect URI is automatically configured as
${APP_URL}/api/auth/oauth2/callback/oidc - Ensure your OIDC provider is configured to allow this redirect URI
Common Issues:
- Invalid Redirect URI: Ensure your OIDC provider allows
${APP_URL}/api/auth/oauth2/callback/oidc - Scope Issues: Some providers require specific scopes beyond the default
openid email profile - User Creation: Users are automatically created on first login. Ensure your provider returns email and name claims
Debug Mode:
Enable debug logging by setting the auth logger level in apps/backend/src/auth.ts to see detailed OIDC flow information.
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Test your changes
- Commit your changes:
git commit -m "Description of changes" - Push to your fork:
git push origin feature/your-feature-name - Open a Pull Request
- Provide a clear description of the changes
- Explain how to test (human test is fine)
- Use GitHub Issues to report bugs or request features
- Search existing issues before creating new ones
- Provide detailed information and reproduction steps for bugs
By contributing to MetaMCP, you agree that your contributions will be licensed under the MIT License.