decentralgabe/world-id-mcp
3.3
If you are the rightful owner of world-id-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This document provides a comprehensive overview of a minimal MCP HTTP server that integrates World ID proofs to secure tool access.
Tools
3
Resources
0
Prompts
0
World ID MCP
Minimal MCP HTTP server that gates tools behind World ID proofs. Baseline verification defaults to device; privileged operations (demo) skip step-up for simplicity. Includes a tiny IDKit web page to fetch a proof and swap it for a JWT.
Flow
flowchart TD
A[User opens web demo] --> B[IDKit shows QR]
B --> C[User approves in World App]
C --> D[session endpoint world-id.verify]
D --> E[JWT issued token scopes exp]
E --> F[Client calls tools with token]
F --> G[Tool verifies JWT scopes enforced]
G --> H[Audit log and response]
Setup
- Node 18+, pnpm.
- Install deps:
pnpm install -r - Env:
cp server/.env.example server/.envand setWORLD_APP_ID,WORLD_ACTION_ID,WORLD_VERIFICATION_LEVEL(defaultdevice),SESSION_JWT_SECRET(andPORTif desired). The server will exit if app/action IDs are missing. The web demo reads these from the server via/config, so you only set them once inserver/.env. - Run server:
pnpm start(serves/health,/mcp,/sessionon port 3000). - Build all (optional):
pnpm build - Tests (server):
pnpm test
MCP tools
world-id.verify→ validates proof, returns{token, scopes, expiresAt}echo→ requires scopetools.echo(send JWT)advanced-operation→ requires scopetools.advanced(send JWT); step-up disabled in demo
REST helper
POST /sessionwith a World ID proof mirrorsworld-id.verify(handy for the web demo or custom clients).POST /demo/echoandPOST /demo/advancedare simple REST shortcuts used by the web demo.
IDKit Web Demo
cd demo/idkit-web
cp .env.example .env # set app/action/verification + server URL
pnpm install
pnpm dev # http://localhost:5173
Click “Verify with World ID”; it posts the proof to /session and shows the JWT to paste into your agent.
Using with Claude
- Start server:
pnpm start(setPORTif 3000 is busy). - Add MCP server to Claude:
- CLI:
claude mcp add --transport http world-id http://localhost:3000/mcp - Config:
"world-id": { "type": "http", "url": "http://localhost:3000/mcp" }
- CLI:
- Get a token (human proof):
- Run the web demo (
pnpm devorpnpm dev:web) at http://localhost:5173 - Scan the QR, approve in World App, copy the
token.
- Run the web demo (
- Call tools from Claude:
echo:{ "token": "<jwt>", "message": "hi" }advanced-operation:{ "token": "<jwt>", "operation": "something" }
- If you see errors:
- Token invalid/expired → get a fresh proof.
- “Missing required scope: tools.advanced” → request that scope when verifying.
- (If step-up is re-enabled later) advanced will ask for a fresh proof; provide
stepUpProof.
File map
server/src/mcp-server.ts– MCP server + tools +/sessionserver/src/auth/– World ID verification, JWT minting, policiesdemo/test-client.ts– sample MCP clientdemo/idkit-web/– Vite + IDKit proof collector