mcp

Project rules for building a small Model Context Protocol (MCP) server that exposes selected Neon REST API operations as AI tools. Neon is a hosted database platform, and MCP is a standard way for AI applications to access tools and data.

In plain words
What is it for?
It is for adding MCP tools in src/index.ts, such as operations that call Neon through its REST API.
Why use it?
It gives developers a consistent format for adding server operations that an AI coding tool can call, without designing a separate interface for each operation.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/mcpflow/neon-mcp/mcp
Clone the repo
git clone --depth 1 https://github.com/mcpflow/neon-mcp

Made for: Cursor.

Per session 718 This file is loaded in full into every session.
When invoked 718 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00718 $0.00718
Opus 5 $0.00359 $0.00359
Sonnet 5 $0.00144 $0.00144
Haiku 4.5 $0.00072 $0.00072

Measured 2d ago against content hash d651776428b2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mcp scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

async fetch(request: Request): Promise<Response> {
.cursor/rules/mcp.mdc · 98 lines

How it starts

The opening of the file, as written. The whole thing — 98 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MCP Server

Project Context

This is a Model Control Protocol (MCP) server that is a minimal wrapper that exposes a few endpoints from the Neon REST API as MCP tools so AI agents can use them.

What is MCP?

MCP is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools.

MCP Clients are protocol clients that maintain 1:1 connections with servers.

MCP Servers, such as this one, are lightweight programs that each expose specific capabilities through the standardized Model Context Protocol.

Format for defining tools

Edit the src/index.ts file to add new tools. Each method in the MyWorker class becomes an MCP tool that can be used by your Cursor Agent.

For example, here is an example of an MCP tool that returns a friendly greeting:

/**
 * A warm, friendly greeting from your new Workers MCP server.
 * @param name {string} the name of the person we are greeting.
 * @return {string} the contents of our greeting.
 */
sayHello(name: string) {
    return `Hello from an MCP Worker, ${name}!`;
}
  • The JSDoc comment's first line is the tool's description.
  • The @param tags are the tool's parameters, with their types and descriptions.
  • The @return tag is the tool's return value, with its type.

To add a new tool, just write a new function to the MyWorker class, following the example above. Make sure to add the JSDoc comment in the exact format shown above with the correct types so that the compiler parses it correctly.

How to write functions to wrap APIs

Most of the time, you will be writing tools that return objects that are a lot more complex than simple strings. To comply with the MCP Tools Spec, you must stringify the object to text and return responses in this shape.

Read the full file on GitHub · 98 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 98 lines · 718 tokens per session scan A d651776428b2

Subscribe to this mod's changes

mcp is a cursor rule published in the GitHub repository mcpflow/neon-mcp (0 stars, last pushed 1y ago), licensed MIT. It adds 718 tokens to every session, about $0.0036 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.