Enable AI assistants like Cursor and Claude to integrate Turalogin authentication directly into your codebase.
The Turalogin MCP (Model Context Protocol) server allows AI coding assistants to interact with Turalogin's authentication API directly. Instead of just suggesting code, the AI can actually send magic links, verify tokens, and test your authentication flow. all from within your IDE.
AI sends actual emails and verifies tokens via Turalogin
Works with Express, Next.js, Django, Flask, Rails, and more
Test authentication without leaving your editor
Visit the Turalogin dashboard, create an app, and generate an API key.
Add the Turalogin MCP server to your AI assistant's configuration:
For Cursor:
Settings → MCP Servers → Add this configuration:
{
"mcpServers": {
"turalogin": {
"command": "npx",
"args": ["-y", "@turalogin/mcp-server"],
"env": {
"TURALOGIN_API_KEY": "your_api_key_here"
}
}
}
}For Claude Desktop:
Edit claude_desktop_config.json:
~/Library/Application Support/Claude/%APPDATA%\Claude\~/.config/Claude/Restart your AI assistant and ask it to integrate Turalogin:
"Add Turalogin magic link authentication to my Express app"
Start passwordless authentication for an email address. Sends a magic link or OTP code.
email (required) - User's email addressmethod (optional) - "one_time_login_link" or "otp" (default: one_time_login_link)validationUrl (required for one_time_login_link) - Callback URLsessionId - Use to verify authenticationexpiresAt - When the link/code expires (15 minutes)Verify an authentication session and get a JWT token.
sessionId (required) - Session ID from start_authcode (optional) - OTP code if using OTP methodtoken - JWT token for authenticated useruser - User object with id and emailexpiresIn - Token expiration (24 hours)Get current MCP server configuration (for debugging). Shows API URL and whether API key is configured.
Here's what the AI assistant generates when you ask it to add Turalogin authentication:
// POST /auth/login - Start authentication
app.post('/auth/login', async (req, res) => {
const { email } = req.body;
const response = await fetch('https://turalogin.com/api/v1/auth/start', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email,
method: 'one_time_login_link',
validationUrl: 'https://yourapp.com/auth/verify'
})
});
const data = await response.json();
res.json({ success: true, message: 'Check your email' });
});
// GET /auth/verify - Handle magic link callback
app.get('/auth/verify', async (req, res) => {
const { token } = req.query;
const response = await fetch('https://turalogin.com/api/v1/auth/verify', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ sessionId: token })
});
const data = await response.json();
req.session.jwt = data.token;
req.session.user = data.user;
res.redirect('/dashboard');
});Works with any MCP-compatible AI coding assistant
Once configured, test the MCP server by asking your AI assistant:
Test Configuration:
"Use turalogin_get_config to verify Turalogin is set up correctly"
Test Authentication:
"Send a test one time auth to test@turalogin.com"
Build Something:
"Add Turalogin authentication to my [framework] app"