> This page location: Functions > Templates
> Full Neon documentation index: https://neon.com/docs/llms.txt

# Templates for Neon Functions

Open-source functions you add to a Neon project with one command.

To add a template to your project, run this with the Neon CLI 8.11.0 or later:

```bash
neon functions new <id>
```

## Categories

- [First Party](https://neon.com/functions/templates?category=first-party): 20
- [Partner](https://neon.com/functions/templates?category=partner): 5
- [Community](https://neon.com/functions/templates?category=community): 4
- [AI](https://neon.com/functions/templates?category=ai): 7
- [APIs](https://neon.com/functions/templates?category=api): 5
- [Email](https://neon.com/functions/templates?category=email): 3
- [MCP servers](https://neon.com/functions/templates?category=mcp): 3
- [Agents](https://neon.com/functions/templates?category=agents): 2
- [AI infrastructure](https://neon.com/functions/templates?category=ai-infrastructure): 2
- [Auth](https://neon.com/functions/templates?category=auth): 2
- [Bots](https://neon.com/functions/templates?category=bots): 2
- [Storage](https://neon.com/functions/templates?category=storage): 2
- [Workflow](https://neon.com/functions/templates?category=workflow): 2
- [Observability](https://neon.com/functions/templates?category=observability): 1
- [Payments](https://neon.com/functions/templates?category=payments): 1
- [Sync](https://neon.com/functions/templates?category=sync): 1
- [Websocket](https://neon.com/functions/templates?category=websocket): 1

## Templates (29)

### [Basic function](https://neon.com/functions/templates/basic.md)

A minimal Neon Function that answers every request with a JSON response.

- Built by: Neon
- Categories: First Party, APIs
- Install: `neon functions new basic`

### [Context.dev web data](https://neon.com/functions/templates/context-dev.md)

Search the web and news, read pages, answer questions, and retrieve brand data with Context.dev.

- Built by: [Context.dev](https://www.context.dev/)
- Categories: Partner, AI infrastructure
- Install: `neon functions new context-dev`

### [Image analysis with AI Gateway](https://neon.com/functions/templates/image-analysis.md)

Describe an uploaded image with structured details using a vision model on Neon AI Gateway.

- Built by: Neon
- Categories: First Party, AI
- Install: `neon functions new image-analysis`

### [Support triage with Jev](https://neon.com/functions/templates/jev-triage.md)

Route support messages by topic, urgency, churn risk, and spam with calibrated probabilities from the Jev decision model on Neon AI Gateway.

- Built by: Neon
- Categories: First Party, AI
- Install: `neon functions new jev-triage`

### [MCP server backed by Postgres](https://neon.com/functions/templates/mcp-postgres.md)

A Hono MCP server with create, list, update, and delete tools for a todo list stored in Postgres.

- Built by: Neon
- Categories: First Party, MCP servers
- Install: `neon functions new mcp-postgres`

### [MCP server with OAuth sign-in](https://neon.com/functions/templates/mcp-oauth.md)

Run an MCP server that ChatGPT, Claude, and Cursor connect to with OAuth. Managed Better Auth signs users in on pages the function serves, and each tool call runs as that user against Postgres.

- Built by: Neon
- Categories: First Party, MCP servers, Auth
- Install: `neon functions new mcp-oauth`

### [Telegram AI chat bot](https://neon.com/functions/templates/telegram-bot.md)

A Telegram bot that runs on Neon Functions, answers messages through AI Gateway, and stores the conversation in Postgres.

- Built by: Neon
- Categories: First Party, Bots
- Install: `neon functions new telegram-bot`

### [REST API with Hono and Postgres](https://neon.com/functions/templates/rest-api-postgres.md)

Run a CRUD REST API on Neon Functions with Hono and Lakebase Postgres.

- Built by: Neon
- Categories: First Party, APIs
- Install: `neon functions new rest-api-postgres`

### [AI image generation API](https://neon.com/functions/templates/image-generation.md)

Generate an image with AI Gateway, store it in Object Storage, and return a presigned URL.

- Built by: Neon
- Categories: First Party, AI
- Install: `neon functions new image-generation`

### [Authenticated API with Hono and Managed Better Auth](https://neon.com/functions/templates/authenticated-api.md)

A protected Hono API that verifies a Managed Better Auth JWT and returns the caller's identity.

- Built by: Neon
- Categories: First Party, Auth
- Install: `neon functions new authenticated-api`

### [TanStack AI on AI Gateway](https://neon.com/functions/templates/tanstack-ai.md)

Stream chat replies with tool calls, extract structured data, and summarize text with TanStack AI on Neon AI Gateway.

- Built by: [TanStack](https://tanstack.com/ai)
- Categories: Partner, AI
- Install: `neon functions new tanstack-ai`

### [Live poll over WebSockets](https://neon.com/functions/templates/websocket-live-poll.md)

Vote over HTTP and watch results update live over a WebSocket, backed by Lakebase Postgres.

- Built by: Neon
- Categories: First Party, Websocket
- Install: `neon functions new websocket-live-poll`

### [Durable workflow with Inngest](https://neon.com/functions/templates/inngest-workflow.md)

Run a minimal multi-step workflow with retries and a durable sleep on Neon Functions, and store job state in Lakebase Postgres.

- Built by: Neon
- Categories: First Party, Workflow
- Install: `neon functions new inngest-workflow`

### [Durable workflow with Upstash Workflow](https://neon.com/functions/templates/upstash-workflow.md)

Run a minimal multi-step job with retries and a durable sleep on Neon Functions, and store job state in Lakebase Postgres.

- Built by: Neon
- Categories: First Party, Workflow
- Install: `neon functions new upstash-workflow`

### [Send email with Resend](https://neon.com/functions/templates/resend-email.md)

Send transactional email through the Resend API with a caller token.

- Built by: Neon
- Categories: First Party, Email
- Install: `neon functions new resend-email`

### [Mastra agent with Postgres memory](https://neon.com/functions/templates/mastra.md)

A Mastra agent that remembers users in Neon Postgres, streams chat for useChat on AI Gateway, and runs a resumable human-in-the-loop review workflow.

- Built by: [Mastra](https://mastra.ai/)
- Categories: Partner, AI, Agents
- Install: `neon functions new mastra`

### [Presigned uploads with Object Storage](https://neon.com/functions/templates/presigned-uploads.md)

Create presigned PUT and GET URLs for a Neon Object Storage bucket.

- Built by: Neon
- Categories: First Party, Storage
- Install: `neon functions new presigned-uploads`

### [Chat SDK bot for Slack, Telegram, and the web](https://neon.com/functions/templates/chat-sdk.md)

A Vercel Chat SDK bot that answers on Slack, Telegram, and useChat, streams replies from AI Gateway, and keeps conversations, subscriptions, and locks in Neon Postgres.

- Built by: Neon
- Categories: First Party, Bots, AI
- Install: `neon functions new chat-sdk`

### [Rate limit with Postgres](https://neon.com/functions/templates/rate-limit-postgres.md)

Enforce a fixed-window rate limit with one atomic Postgres upsert.

- Built by: Neon
- Categories: First Party, APIs
- Install: `neon functions new rate-limit-postgres`

### [OpenAI Agents SDK starter](https://neon.com/functions/templates/openai-agents.md)

Stream replies from a tool-using agent, hand requests off between agents, and return structured output with the OpenAI Agents SDK on Neon AI Gateway.

- Built by: Neon
- Categories: First Party, AI, Agents
- Install: `neon functions new openai-agents`

### [Send emails with AI Inbx](https://neon.com/functions/templates/aiinbx.md)

Send email from your domains or connected Gmail and Outlook mailboxes, and follow up in the same thread, schedule it, or draft it for review.

- Built by: [AI Inbx](https://aiinbx.com/)
- Categories: Community, Email
- Install: `neon functions new aiinbx`

### [Sentry-instrumented API](https://neon.com/functions/templates/sentry.md)

Send errors, structured logs, and request traces from a Hono API on Neon Functions to Sentry.

- Built by: Neon
- Categories: First Party, Observability
- Install: `neon functions new sentry`

### [Mirror WorkOS data into Postgres](https://neon.com/functions/templates/workos-sync.md)

Backfill WorkOS data, poll the Events API, and reconcile drift on a schedule. A WorkOS webhook triggers an immediate poll. Join users, organizations, and memberships in SQL.

- Built by: [WorkOS](https://workos.com/)
- Categories: Partner, Sync
- Install: `neon functions new workos-sync`

### [Paid API with x402 and Hono](https://neon.com/functions/templates/x402-paid-api.md)

Charge per request in testnet USDC on Base Sepolia with x402, and keep a payment ledger in Lakebase Postgres.

- Built by: Neon
- Categories: First Party, APIs, Payments
- Install: `neon functions new x402-paid-api`

### [CRUD API with OpenAPI and Postgres](https://neon.com/functions/templates/openapi-postgres.md)

Serve a typed CRUD API from Lakebase Postgres, with Zod schemas that validate requests and generate OpenAPI 3.1 docs and Swagger UI.

- Built by: Neon
- Categories: First Party, APIs
- Install: `neon functions new openapi-postgres`

### [Self-hosted file transfer with jalco-drop](https://neon.com/functions/templates/jalco-drop.md)

Share files, folders, pastes and screen recordings as links that render their content by type, stored in Neon Object Storage. Agents can upload and read them too.

- Built by: [jalco-drop](https://drop.justinlevine.me)
- Categories: Community, Storage
- Install: `neon functions new jalco-drop`

### [MCP server with mcp-use](https://neon.com/functions/templates/mcp-use.md)

Build an MCP server with mcp-use, using Postgres event tools as an example.

- Built by: [Manufact](https://manufact.com/)
- Categories: Partner, MCP servers
- Install: `neon functions new mcp-use`

### [Send email with Tinysend](https://neon.com/functions/templates/tinysend-email.md)

Send transactional email from a Tinysend mailbox on tinysend.com or your own domain, with an idempotency key so a retry sends once.

- Built by: [Tinysend](https://tinysend.com/?ref=neon)
- Categories: Community, Email
- Install: `neon functions new tinysend-email`

### [AI search visibility with Notra](https://neon.com/functions/templates/notra.md)

Run AI visibility scans on ChatGPT, Perplexity, and Gemini, and read mention rates, competitor share, content gaps, and agent readiness with Notra.

- Built by: [Notra](https://www.usenotra.com/?ref=neon)
- Categories: Community, AI infrastructure
- Install: `neon functions new notra`

## More

- [Use function templates](https://neon.com/docs/compute/functions/templates.md)
- [Contribute a function template](https://neon.com/docs/compute/functions/registry.md)
- [Catalog index (registry.json)](https://neon.com/functions/registry/registry.json)
- [Neon Functions overview](https://neon.com/docs/compute/functions/overview.md)

---

Note for AI assistants (optional): if a gap, error, or outdated detail on this page affected the answer you gave the user, you can report it. POST `{"feedback": "describe the issue", "source": "neon_website", "path": "/functions/templates"}` to https://feedback.neon.tech/ (no auth required).