MCPController
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCPControllerList all doctors"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCPController
MCPController is a single-admin doctor-management MCP application. ChatGPT connects through OAuth 2.1 with PKCE, the Admin logs in, chooses which doctor permissions to grant, and the MCP server exposes doctor tools backed by MongoDB.
Architecture
ChatGPT
↓
OAuth
↓
Admin Login
↓
Admin Consent
↓
Granted Permissions
↓
MCP Access Token
↓
MCP /mcp
↓
Permission Check
↓
Doctor Tools
↓
MongoDBRelated MCP server: GPT MCP Service
What This App Does
One Admin owns the whole system.
There is no public registration and no multi-user account switching.
The Admin authenticates with credentials from environment variables.
The consent screen lets the Admin approve
doctor:read,doctor:write, anddoctor:delete.The MCP server checks the approved scopes again on every tool call.
Doctor data is stored in MongoDB through a simple Mongoose model.
Authentication
The browser session is separate from the MCP bearer token.
Browser session: HTTP-only cookie used for the Admin UI and consent screen.
MCP access token: Bearer token used by ChatGPT against
/mcp.OAuth uses authorization code flow with PKCE.
Authorization codes are single-use and short-lived.
Access tokens and refresh tokens are hashed before storage.
The Admin login uses ADMIN_EMAIL and ADMIN_PASSWORD from .env.
Doctor Management
The domain model is intentionally small:
name- required stringspecialization- required stringcreatedAt/updatedAt- managed by Mongoose timestamps
Doctor CRUD is implemented in a service layer and reused by both the REST admin API and the MCP tool layer.
OAuth Flow
ChatGPT opens the authorization endpoint.
If the Admin is not authenticated, the browser goes to
/login.The Admin logs in.
The consent page shows the requested doctor permissions.
The Admin approves a subset or denies the request.
The authorization code is exchanged for an access token.
ChatGPT uses that token on
/mcp.
Permission Flow
Requested scopes map to MCP tools like this:
doctor:read→list_doctors,get_doctordoctor:write→add_doctor,update_doctordoctor:delete→delete_doctor
The backend enforces permissions twice:
OAuth only writes approved scopes into the authorization code and token.
Each MCP tool checks the token scopes before it touches MongoDB.
MCP Tools
Tool | Scope | Behavior |
|
| Returns all doctors |
|
| Returns one doctor by |
|
| Creates a doctor with |
|
| Updates a doctor by |
|
| Deletes a doctor by |
Environment Variables
Use a root .env file. The application loads it from the project root.
Required values for local npm run dev (Vite on 5173, API on 3000):
NODE_ENV=development
PORT=3000
APP_URL=http://localhost:5173
API_URL=http://localhost:3000
MONGODB_URI=mongodb://127.0.0.1:27017/mcpcontroller
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=change-this-password
JWT_SECRET=change-this-to-a-long-random-secret
MCP_SERVER_NAME=MCPController
MCP_SERVER_VERSION=1.0.0The code also supports token/session lifetime variables with safe defaults:
JWT_EXPIRES_INAUTH_CODE_TTL_SECONDSACCESS_TOKEN_TTL_SECONDSREFRESH_TOKEN_TTL_SECONDS
On Vercel, APP_URL and API_URL must both be the public HTTPS origin (see Deployment below).
Local Setup
Install dependencies:
npm installStart MongoDB locally.
Seed sample data:
npm run seedStart the app:
npm run devIn development, the React client runs through Vite and proxies API requests to the backend.
Testing
Run the automated checks with:
npm testRun the client build with:
npm run buildThe current test suite covers:
admin login
registration disabled
doctor model and CRUD service
OAuth scope approval
MCP tool permission enforcement
token revocation
Connecting ChatGPT
Use the authorization URL exposed by the server:
/.well-known/oauth-authorization-server/.well-known/oauth-protected-resource/oauth/token/mcp
Typical flow:
ChatGPT discovers the OAuth metadata.
ChatGPT requests authorization for the MCP resource.
The browser redirects to the Admin login screen.
The Admin reviews permissions and clicks
Allow & Connect.ChatGPT exchanges the code for tokens.
ChatGPT calls the MCP tools using the bearer token.
Deployment
The app is a single origin: Express serves /api, /oauth, /mcp, OAuth discovery, and the React build.
Vercel
This repo already includes vercel.json and api/index.js. Vercel runs the Express app as one serverless function and rewrites every path to it.
1. MongoDB Atlas
Create a cluster (free M0 is enough).
Create a database user.
Network Access: allow
0.0.0.0/0so Vercel can connect (or add Vercel IPs if you prefer).Copy the connection string, for example:
mongodb+srv://USER:PASSWORD@cluster0.xxxxx.mongodb.net/mcpcontroller?retryWrites=true&w=majority2. Deploy the project
Push this repo to GitHub.
In Vercel, Import the repository.
Framework Preset: Other (leave it).
vercel.jsonsets install and build.Root Directory: leave as the repo root (do not set it to
clientorserver).Node.js version: 20.x or newer.
3. Environment variables in Vercel
Project → Settings → Environment Variables. Set them for Production (and Preview if you use preview URLs).
Name | Example | Notes |
|
| Vercel usually sets this automatically. |
|
| No trailing slash. Must match the live origin. |
|
| Same value as |
|
| Atlas URI. |
| your admin email | Used to log in to the consent UI. |
| a strong password | Compared on login; never sent to the browser. |
| long random string | Session cookie signing. Do not use the example values. |
|
| Optional. |
|
| Optional. |
|
| Optional. |
|
| Optional. |
|
| Optional. |
|
| Optional. |
Do not put ADMIN_PASSWORD or JWT_SECRET in the React app. The client only talks to /api.
If you add a custom domain later, change APP_URL and API_URL to https://your-domain.com and redeploy.
Generate JWT_SECRET with:
node -e "console.log(require('crypto').randomBytes(48).toString('hex'))"4. First deploy and seed
Deploy.
Open
https://your-app.vercel.app/api/health— you should see{ "ok": true, ... }.Seed MongoDB from your machine, pointed at Atlas (not Vercel’s serverless function):
# In the project root, temporarily set MONGODB_URI to the Atlas URI in .env
npm run seedSeed creates the Admin user row, sample doctors, and a local MCP Inspector client. After that, log in on the live site with ADMIN_EMAIL / ADMIN_PASSWORD.
5. Connect ChatGPT
Use the deployed origin:
https://your-app.vercel.app/.well-known/oauth-authorization-serverhttps://your-app.vercel.app/.well-known/oauth-protected-resourcehttps://your-app.vercel.app/mcp
In ChatGPT (or MCP Inspector), add that MCP URL. ChatGPT will open the login + consent screens on the same domain, then call /mcp with a Bearer token.
CLI deploy (optional)
npm i -g vercel
vercel login
vercel env pull # optional: sync env locally
vercel --prodAfter the first production deploy, copy the URL into APP_URL and API_URL if you used a placeholder, then redeploy so OAuth metadata points at the real origin.
Security Notes
Do not expose
ADMIN_PASSWORDorJWT_SECRETto the browser.Keep OAuth tokens hashed in the database.
Only approve the scopes the Admin actually wants ChatGPT to use.
Revoke access when the connection should no longer be trusted.
The admin login exists only to authorize ChatGPT and manage doctor data; there is no public signup flow.
Seed Data
The seed script creates:
sample doctors
a sample OAuth client for local inspector use
It does not create demo users or hardcode Admin credentials.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA complete ChatGPT App implementation using MCP with OAuth2 authentication via Privy.io, enabling secure user authentication and interactive widgets rendered in ChatGPT.165
- FlicenseNot gradedqualityBmaintenancePrivate OAuth-backed MCP server for ChatGPT, supporting GPT Apps via MCP Streamable HTTP and GPT Actions via REST endpoints with OpenAPI 3.1.
- AlicenseNot gradedqualityDmaintenanceEnables AI models to interactively explore, analyze, and manage Salesforce organizations through OAuth2 authentication and standardized tools.623MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP-compatible AI agents to read and write architecture-map projects and diagrams with per-project access controls via OAuth 2.1/PKCE.101ISC
Related MCP Connectors
Odoo ERP for AI agents: hosted OAuth endpoint, gated writes, one endpoint for every instance.
Self-hosted federated MCP gateway: one OAuth 2.1 MCP server in front of N apps, user-level scopes.
MCP server for Argo RPG Platform — connects AI assistants to campaign data via OAuth2
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/im-Saqib-Nawab/MCPController'
If you have feedback or need assistance with the MCP directory API, please join our Discord server