1. Conduid
  2. Developer Tools
  3. Gateway
MCP server ยท Developer Tools

Gateway

๐Ÿงฉ MCP Gateway - A lightweight gateway service that instantly transforms existing MCP Servers and APIs into MCP servers with zero code changes. Features Docker deployment and management UI, requiring no infrastructure modifications.

Unclaimed Apache-2.0 last commit 8 months ago gatewaymcpmcp-gatewaymcp-adapterllmmcp-serverdevtoolsauthrest-to-mcp
58Fair

Scored 3 months ago ยท breakdown

About Gateway

Gateway is an MCP server published by casbin in the Developer Tools category: ๐Ÿงฉ MCP Gateway - A lightweight gateway service that instantly transforms existing MCP Servers and APIs into MCP servers with zero code changes. Features Docker deployment and management UI, requiring no infrastructure modifications. It has been installed 0 times through Conduid.

The repository has 2 stars and 0 forks, with the last commit 8 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues (0) before depending on it in production.

Install

Install
npx mcp-gateway

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

Ask AI about Gateway

Powered by Claude · Grounded in docs

I know everything about Gateway. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ยทREADME presentNot checked yet.
  • ยทLicense declaredNot checked yet.
  • ยทTests presentNot checked yet.
  • ยทDependencies pinnedNot checked yet.
  • ยทNo dynamic code executionNot checked yet.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

README

mcp-gateway

Go Report Card Build Coverage Status Godoc Release License

A Golang HTTP gateway with OAuth authentication and Casbin authorization middleware, built with Beego web framework and a React frontend.

Features

  • HTTP Middleware System: Stackable middleware architecture
  • OAuth Authentication: JWT-based authentication middleware following MCP recommendations
  • Casbin Authorization: Role-based access control (RBAC) for fine-grained permission management
  • Modern Frontend: React + Tailwind CSS + shadcn/ui for a beautiful user interface
  • Dual Serving: Backend serves both APIs and frontend static files on port 9000
  • CI/CD: Automated testing and semantic versioning with GitHub Actions

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Client        โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚
         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  MCP Gateway (Port 9000)    โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  OAuth Middleware     โ”‚  โ”‚
โ”‚  โ”‚  (JWT Authentication) โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚             โ–ผ               โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  Casbin Middleware    โ”‚  โ”‚
โ”‚  โ”‚  (Authorization)      โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚             โ–ผ               โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  API Controllers      โ”‚  โ”‚
โ”‚  โ”‚  + Static Files       โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Prerequisites

  • Go 1.21.0 or later
  • Node.js 20 or later
  • npm or yarn

Quick Start

Backend Setup

  1. Clone the repository:
git clone https://github.com/casbin/mcp-gateway.git
cd mcp-gateway
  1. Install Go dependencies:
go mod download
  1. Build the backend:
go build -o mcp-gateway .
  1. Run the backend:
./mcp-gateway

The backend will start on port 9000.

Frontend Setup

  1. Navigate to the web directory:
cd web
  1. Install dependencies:
npm install
  1. For development mode (runs on port 8001):
npm run dev
  1. For production build:
npm run build

The built files will be in web/dist and automatically served by the backend on port 9000.

Usage

Demo Accounts

Two demo accounts are available for testing:

  • Admin: alice / password123 (has admin role with full access)
  • User: bob / password456 (has user role with limited access)

API Endpoints

Public Endpoints

  • GET /health - Health check endpoint
  • POST /login - Login endpoint

Protected Endpoints (require authentication)

  • GET /api/users - List all users (admin only)
  • GET /api/users/:id - Get specific user (admin only)
  • POST /api/users - Create new user (admin only)
  • GET /api/profile - Get current user profile
  • PUT /api/profile - Update current user profile

Authentication

All protected endpoints require a JWT token in the Authorization header:

Authorization: Bearer <token>

Example login request:

curl -X POST http://localhost:9000/login \
  -H "Content-Type: application/json" \
  -d '{"username":"alice","password":"password123"}'

Example authenticated request:

curl http://localhost:9000/api/users \
  -H "Authorization: Bearer <your-token>"

Configuration

OAuth Configuration

Edit conf/app.conf to configure OAuth settings:

[dev]
oauth.secret = your-secret-key-dev

[prod]
oauth.secret = ${OAUTH_SECRET||your-secret-key}

Casbin Policies

Edit conf/policy.csv to modify access control rules:

p, admin, /api/*, GET
p, admin, /api/*, POST
p, user, /api/profile, GET
g, alice, admin
g, bob, user

The format is: p, role, resource, action for permissions and g, user, role for role assignments.

Development

Running Tests

go test ./... -v

Running with Coverage

go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...

Frontend Development

cd web
npm run dev

This will start the development server on port 8001 with hot module replacement.

Deployment

Production Build

  1. Build the backend:
go build -ldflags="-s -w" -o mcp-gateway .
  1. Build the frontend:
cd web
npm run build
cd ..
  1. Run the application:
./mcp-gateway

The application will serve both backend APIs and frontend static files on port 9000.

Docker (Optional)

You can containerize the application:

FROM golang:1.21-alpine AS backend-builder
WORKDIR /app
COPY go.* ./
RUN go mod download
COPY . .
RUN go build -ldflags="-s -w" -o mcp-gateway .

FROM node:20-alpine AS frontend-builder
WORKDIR /app
COPY web/package*.json ./
RUN npm ci
COPY web/ ./
RUN npm run build

FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=backend-builder /app/mcp-gateway .
COPY --from=frontend-builder /app/dist ./web/dist
COPY conf ./conf
EXPOSE 9000
CMD ["./mcp-gateway"]

License

Apache-2.0 License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

README mirrored from the source repository 3 months ago. The original is authoritative.

Questions

About Gateway

How do I install Gateway?

Run npx mcp-gateway, then add the server to your MCP client's configuration. Conduid has recorded 0 installs, so the command is known to work with current clients.

Is Gateway safe to use with an AI agent?

Its trust score is 58 out of 100 (fair). It passes 0 of 1 static security checks; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Gateway still maintained?

The last commit was 8 months ago, with 0 open issues. That's long enough that you should check whether the maintainer is responding to issues before depending on it.