AI & Agents · Cloud, DevOps & LLMOps · Security & Compliance
AI Jobs MCP: Remote MCP Server with Google OAuth on AWS Lambda
By David Gadyan · Published
A production remote MCP server that lets Claude, Cursor and any other MCP client search live AI job leads stored in Supabase. Users sign in with Google through a branded consent page, every tool is read-only, and tool calls are limited to 2 per minute per IP. It runs serverless on AWS Lambda (arm64) behind a Function URL, keeps encrypted OAuth state in DynamoDB, deploys with one command through uv and AWS SAM, and costs cents per month. Python, FastMCP, Supabase REST, 24 automated tests.
The problem
Job leads collected from job boards and career pages are only useful if you can ask questions about them where you already work. An MCP server puts them inside Claude or Cursor, but a remote one has to answer three questions that a local demo skips: who may connect, what they may do, and what it costs to keep it running. AI Jobs MCP answers them with Google sign-in, read-only tools with a rate limit, and a serverless deployment that idles at almost no cost. It is a personal project built on my own lead data.
The product in use
What I built
Five read-only tools. search_leads combines keywords with filters for company, location, source, status, seniority, remote policy, skills, minimum score and the last N days, with sorting and paging. get_lead returns every field of one lead, including requirements, matched and missing skills and company research. lead_stats counts leads by any column, describe_leads_schema lists the columns and their types for custom filters, and whoami shows the signed-in Google account. Every column name is checked against the live schema and every value is quoted, so tool input cannot reshape the query.
Sign-in with Google. MCP clients expect to register themselves with the server they connect to, and Google does not offer that. The server therefore acts as an OAuth proxy: clients register with it, and users sign in at Google. Only the openid and email scopes are requested, so the Google app needs no review, and any account with a verified e-mail gets access. On the first connection a branded consent page with the logo, Terms and Privacy links asks for approval.
Answers in the client. After sign-in the client lists the tools and calls them. In the demo, the request for the most recent AI jobs in Barcelona becomes a search_leads call with a location, a keyword and newest-first sorting, and the leads come back with company, remote policy, seniority, score and the date found.
Architecture
The client calls /mcp over HTTPS on a Lambda Function URL. The Lambda Web Adapter runs uvicorn and the FastMCP app unchanged inside an arm64 Lambda, so the same code runs locally and in AWS. The function reads leads from Supabase over REST with GET requests only. DynamoDB, billed on demand, holds two things that must survive cold starts and be shared across instances: the OAuth state (client registrations and upstream tokens, encrypted with Fernet) and the per-IP rate-limit counters, both expired by TTL. Logs go to CloudWatch with 14-day retention. A Function URL replaces API Gateway, and a zip package on Graviton replaces Docker and a container registry, which keeps the bill inside the free tiers at personal traffic.
Security and limits
- Read-only by design. Only GET requests leave the server, every tool is annotated read-only, and a test enforces both.
- Rate limit. 2 tool calls per minute per IP. Handshake and sign-in requests do not count. The IP comes from the Function URL request context, which callers cannot spoof.
- Secrets stay on the server. The Supabase key, the Google client secret and the token-signing key live in Lambda environment variables and never reach a client.
- Spec fallbacks. Lambda renames the
WWW-Authenticateheader on 401 responses, so clients find the authorization server through/.well-known/oauth-protected-resource/mcp, as the MCP specification allows.
Deploy and test
One script builds the Linux arm64 wheels with uv, copies the code and the Lambda entrypoint, and deploys the SAM stack, then prints the server URL and the Google redirect URI. The stack is a DynamoDB table, a log group and the function with its Function URL. 24 pytest tests cover the leads client, the authentication and branding pages, and the rate limit, and ruff runs on every edit.
Related projects
Private AI Gateway: Secure, Self-Hosted LLM Access for Every Team
AI & Agents · Security & Compliance · Cloud, DevOps & LLMOps
CareLens: Clinical Document AI on Kubernetes and Azure (HIPAA-ready)
Cloud, DevOps & LLMOps · Security & Compliance · AI & Agents
Azure AI Automation: Document Intelligence, RAG & Governed Agents
AI & Agents · Cloud, DevOps & LLMOps · Security & Compliance