OAuth-to-x402 bridge MCP server that enables Manus to call Sally AI
This server acts as a bridge between:
- Manus (OAuth-based MCP client)
- Sally AI (x402 blockchain payment-based health assistant)
It solves the authentication incompatibility by:
- Providing OAuth endpoints that Manus expects
- Handling x402 payment signing internally
- Exposing Sally's chat functionality as an MCP tool
✅ OAuth-compatible MCP server
✅ Automatic x402 payment handling
✅ Sally AI chat integration
✅ Server-Sent Events (SSE) support
✅ Docker containerized
✅ Ready for Fly.io, Railway, Render deployment
✅ Health checks and monitoring
- Install dependencies:
pnpm install- Configure environment:
cp .env.example .env
# Edit .env and add your PRIVATE_KEY- Build and run:
pnpm run build
pnpm startServer runs on http://localhost:3000
See DEPLOYMENT_GUIDE.md for complete deployment instructions for:
- Fly.io (recommended)
- Railway
- Render
Quick deploy to Fly.io:
fly launch --no-deploy
fly secrets set PRIVATE_KEY=0xYOUR_KEY
fly deploy| Variable | Required | Description |
|---|---|---|
PRIVATE_KEY |
Yes | Your wallet's private key (with 0x prefix) for x402 payments |
PORT |
No | Server port (default: 3000) |
SALLY_API_URL |
No | Sally API endpoint (default: https://api-x402.asksally.xyz) |
- Use a dedicated wallet for this service
- Never use your main wallet
- Keep only small amounts ($10-20) in the wallet
- Never commit
.envfile to git - Use secrets management in production
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Health check |
/.well-known/oauth-authorization-server |
GET | OAuth discovery |
/oauth/authorize |
GET | OAuth authorization (auto-approved) |
/oauth/token |
POST | OAuth token exchange |
/sse |
GET | MCP Server-Sent Events |
/message |
POST | MCP message handling |
Chat with Sally AI about metabolic health, A1C management, nutrition, and wellness.
Parameters:
message(string, required): Your question for Sally
Example:
{
"message": "What is A1C and how can I improve it?"
}Topics Sally can help with:
- Metabolic health and A1C management
- Blood sugar and insulin sensitivity
- Low-carb, high-protein nutrition
- Exercise for metabolic health
- Sleep optimization
- Lab result interpretation
- Supplement guidance
- Longevity science
-
Deploy the bridge (see DEPLOYMENT_GUIDE.md)
-
Add to Manus MCP configuration:
- Server URL:
https://your-deployment-url.fly.dev - No headers needed!
- Server URL:
-
Call Sally through Manus:
- The
chat-with-sallytool will be available - Use it like any other MCP tool
- The
curl https://your-deployment-url.fly.dev/curl -X POST https://your-deployment-url.fly.dev/message \
-H "Content-Type: application/json" \
-d '{
"method": "tools/call",
"params": {
"name": "chat-with-sally",
"arguments": {
"message": "What is A1C?"
}
}
}'┌─────────┐ ┌──────────────────┐ ┌──────────┐
│ Manus │ ◄─────► │ OAuth Bridge │ ◄─────► │ Sally │
│ (OAuth) │ │ (This Server) │ │ (x402) │
└─────────┘ └──────────────────┘ └──────────┘
│
▼
┌──────────────┐
│ Your Wallet │
│ (USDC/Base) │
└──────────────┘
Flow:
- Manus connects via OAuth (mock auth, auto-approved)
- Manus calls
chat-with-sallytool - Bridge signs x402 payment using your private key
- Bridge calls Sally API with payment
- Sally responds
- Response returned to Manus
- Fly.io: Free (within free tier)
- Railway: Free ($5 credit/month)
- Render: Free (750 hours/month)
- Per chat: ~$0.05 USDC
- 100 chats: ~$5 USDC
- Paid from your configured wallet on Base network
Fly.io:
fly logsRailway/Render:
- Check logs in dashboard
- Check USDC balance on Base network regularly
- Add funds when running low
| Issue | Solution |
|---|---|
| 402 Payment Required | Add USDC to your wallet on Base network |
| API client not initialized | Set PRIVATE_KEY environment variable |
| Deployment fails | Check logs, verify environment variables |
| Manus can't connect | Verify URL, check server logs |
sally-oauth-bridge/
├── src/
│ └── server.ts # Main server code
├── dist/ # Compiled JavaScript (generated)
├── package.json # Dependencies
├── tsconfig.json # TypeScript config
├── Dockerfile # Container config
├── fly.toml # Fly.io config
├── railway.json # Railway config
├── render.yaml # Render config
├── .env.example # Environment template
├── DEPLOYMENT_GUIDE.md # Deployment instructions
├── MANUS_CONFIG.md # Manus configuration
└── README.md # This file
- Runtime: Node.js 22
- Language: TypeScript
- Framework: Express.js
- MCP SDK: @modelcontextprotocol/sdk
- Payment: x402-axios, viem
- HTTP Client: axios
This is a bridge server for personal use. If you find issues:
- Check the logs
- Verify environment variables
- Test endpoints manually
- Check wallet balance
MIT
- Sally MCP - Original Sally MCP server
- Sally Agent - Sally AI backend
- Manus - AI agent platform
For issues:
- Sally API: https://github.com/sally-labs/sally-mcp
- Deployment: See DEPLOYMENT_GUIDE.md
- Manus: https://help.manus.im
Built with ❤️ to bridge OAuth and x402 authentication