ConnectPX MCP OAuth Demo
Enables fetching authenticated user-specific data (profile, orders, invoices, subscriptions, and usage stats) from a Laravel backend API.
Click on "Deploy 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., "@ConnectPX MCP OAuth DemoShow me my recent orders and current subscription"
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.
ConnectPX MCP OAuth Demo
MCP server with OAuth 2.1 + PKCE that binds an AI client to an existing app user.
Stack: Node.js · Vercel serverless · Stateless JWT tokens (no DB needed)
Product flow (what this demo implements)
User already exists / is signed into ConnectPX (dashboard sets an app session cookie — in production this is your Laravel session)
User clicks Connect Claude
AI client starts OAuth 2.1 + PKCE
User approves on the consent page (no password re-entry when app session is present)
System associates the AI client with that user (
user_idin auth code + access token)MCP receives a Bearer JWT
Tools read
token.sub/usernameand return only that user’s data
Related MCP server: architecture-map MCP server
Deploy to Vercel (free, 2 minutes)
Option A — Vercel CLI (fastest)
npm i -g vercel
cd connectpx-mcp-demo
vercel # follow prompts, get instant HTTPS URLOption B — GitHub + Vercel Dashboard
Push this folder to a GitHub repo
Go to vercel.com → New Project → import the repo
Framework: Other · Root:
/· No build command neededClick Deploy → get your URL (e.g.
https://connectpx-mcp.vercel.app)
Optional: Set JWT secret (more secure)
In Vercel Dashboard → Project → Settings → Environment Variables:
JWT_SECRET = any-random-32-char-string-you-generate
MCP_BASE_URL = https://your-project.vercel.appTry the Connect flow in the browser
Important: Claude reaches your MCP server from Anthropic’s cloud. Use a public HTTPS URL (Vercel). localhost will not work.
Deploy and open
https://your-project.vercel.app/Pick Ahmad or Sara (establishes app session)
Click Connect Claude → Open Claude to Connect
In Claude: Add the connector, then click Connect
Browser opens ConnectPX consent → Allow Access
You’re redirected to
claude.ai— connector shows as Connected
Deep link used by the button:
https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=ConnectPX&connectorUrl=https%3A%2F%2Fyour-project.vercel.app%2FmcpUse Try locally only to simulate OAuth without Claude (stays on this site).
Test it live (API)
BASE=https://your-project.vercel.app
# 1. Protected Resource Metadata (RFC9728)
curl $BASE/.well-known/oauth-protected-resource
# 2. AS Metadata — check PKCE is S256
curl $BASE/.well-known/oauth-authorization-server
# 3. Register a client
curl -X POST $BASE/oauth/register \
-H "Content-Type: application/json" \
-d '{"client_name":"Test","redirect_uris":["http://localhost:3000/callback"]}'
# 4. MCP without token → 401 + WWW-Authenticate
curl -si -X POST $BASE/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'Add to Claude Desktop / Claude with remote MCP
Point the client at your MCP URL (OAuth discovery does the rest):
https://your-project.vercel.app/mcpOptional explicit config:
{
"mcpServers": {
"connectpx": {
"url": "https://your-project.vercel.app/mcp"
}
}
}When Claude opens the authorize URL on your domain, if the user already has a ConnectPX session cookie, they only approve — then Claude receives a token for that user.
Demo credentials (consent page fallback)
User | Username | Password | Sample data |
Ahmad Raza (Premium) |
|
| 9 orders, invoices 2024–2026, 4 subscriptions, usage stats |
Sara Khan (Standard) |
|
| 7 orders, invoices 2024–2026, 3 subscriptions, usage stats |
If the dashboard (or Laravel) already set the app session cookie, password fields are hidden.
Available MCP Tools
Tool | Description |
| Profile of the authenticated user |
| Orders (filter by status, limit) |
| Invoices by year with totals |
| Active software subscriptions |
| Usage stats by period |
Replace demo data with real Laravel
App session: Replace
/app/logincookie with your real Laravel session validation ingetAppSession()(lib/store.js).Tools: In
lib/tools.js, call your Laravel API with the JWTsub(user id):
async function getOrders(userId, args) {
const resp = await fetch(`${process.env.LARAVEL_API}/users/${userId}/orders`, {
headers: { Authorization: `Bearer ${process.env.INTERNAL_KEY}` }
});
const orders = await resp.json();
return textResult(JSON.stringify(orders, null, 2));
}Architecture
User (already logged into ConnectPX / Laravel)
│
│ Click "Connect Claude"
│
AI Client (Claude)
│ POST /mcp → 401 + WWW-Authenticate: resource_metadata=...
│ GET /.well-known/oauth-protected-resource (RFC9728)
│ GET /.well-known/oauth-authorization-server (RFC8414 + PKCE S256)
│ POST /oauth/register (RFC7591 Dynamic Registration) [optional]
│ GET /oauth/authorize → Consent (uses app session if present)
│ POST /oauth/token (PKCE verifier → JWT with user_id)
│ POST /mcp + Bearer JWT → user-scoped tool results
▼
ConnectPX MCP Server (Vercel)
→ Tools return only THIS user's data (user_id from JWT sub claim)This server cannot be deployed
Maintenance
Related MCP Connectors
Create, publish and measure SparkleTree marketing campaigns from an AI client. OAuth 2.1 with PKCE.
OAuth 2.1 short-link tools for AI agents with scoped tokens, approvals, audit logs, and revocation.
Document sharing, invoicing, and personal finance platform. 15+ AI tools via OAuth 2.1.
Connect AI agents to Filepad workspaces through OAuth MCP.
Related MCP Servers
AlicenseNot gradedqualityAmaintenanceConnects AI clients to the Matih data platform, enabling SQL queries, table profiling, analytics, chart creation, and file uploads through MCP tools with OAuth/PKCE authentication.33 npmApache 2.0- 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.6 npm1ISC
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely access MyMLH user profiles, education, employment history, and other data via OAuth-authenticated HTTP.10-

HumanDesign.ai MCPofficial
AlicenseNot gradedqualityBmaintenanceEnables AI assistants to generate and render individual and composite Human Design charts, explore authorized chart and library data, and manage account usage and Website Builder projects with secure OAuth and entitlement filtering.1MIT