mcp

mcp is a cursor rule for Cursor from sunra-ai/sunra-clients. It costs 0 tokens per session (2,016 once invoked), scanned A, original, Apache-2.0.

A set of development rules for building MCP servers with TypeScript and FastMCP. MCP, or Model Context Protocol, is a way for an AI client to call tools and access resources provided by a server.

In plain words
What is it for?
Use it when developing a Sunra.ai MCP server, including its Node.js entry point, tool endpoints, model integrations, and supporting files.
Why use it?
It gives the server a consistent layout and defines how tools, resources, prompts, types, and service integrations should be organized. This reduces uncertainty when adding or maintaining server features.

Cursor rule for Cursor

Written for Cursor: installed under .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/sunra-ai/sunra-clients/mcp
Clone the repo
git clone --depth 1 https://github.com/sunra-ai/sunra-clients

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcp

README.md
[![agentmods](https://agentmods.dev/badge/rules/sunra-ai/sunra-clients/mcp.svg)](https://agentmods.dev/rules/sunra-ai/sunra-clients/mcp)
Your own site
<a href="https://agentmods.dev/rules/sunra-ai/sunra-clients/mcp"><img src="https://agentmods.dev/badge/rules/sunra-ai/sunra-clients/mcp.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,016 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.1 $0.00000 $0.02016
Opus 5 $0.00000 $0.01008
Sonnet 5 $0.00000 $0.00403
Haiku 4.5 $0.00000 $0.00202

Measured yesterday against content hash 44a315552805, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

mcp scanned grade A with 0 findings 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 yesterday.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/mcp.mdc · 311 lines

How it starts

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

MCP Server Development Rules

Overview

This file contains rules and guidelines for developing MCP (Model Context Protocol) servers using fast-mcp and TypeScript, specifically for integrating with Sunra.ai services.

Technology Stack

  • Runtime: Node.js with TypeScript
  • Framework: FastMCP (fast-mcp library)
  • Language: TypeScript with strict type checking
  • Package Manager: npm or pnpm
  • API Client: @sunra/client for Sunra.ai integration

Project Structure Standards

Directory Layout

mcp-server/
├── src/
│   ├── index.ts           # Main server entry point
│   ├── tools/             # MCP tools implementation
│   │   └── base.ts        # base functions such as submit, status, result, cancel
│   │   └── models
│   │     └── provider1    # group tools by provider name
│   │       └── model1.ts  # add each endpoint as a standalone tool in [model name].ts
│   │       └── model2.ts
│   │     └── provider2
│   ├── resources/         # MCP resources (if needed)
│   ├── prompts/           # MCP prompts (if needed)
│   ├── types/             # TypeScript type definitions
│   └── utils/             # Utility functions
├── dist/                  # Compiled JavaScript
├── package.json
├── tsconfig.json
├── README.md
└── .env.example

File Naming Conventions

  • Use kebab-case for file names: text-to-image.ts
  • Use PascalCase for class names: TextToImageTool
  • Use camelCase for function and variable names: generateImage
  • Use UPPER_SNAKE_CASE for constants: DEFAULT_TIMEOUT

Code Standards

TypeScript Configuration

  • Enable strict mode: "strict": true
  • Use ES2020 or later target
  • Enable experimental decorators if needed
  • Include proper type definitions for all dependencies
  • Use 2 space indent size

Error Handling

  • Always wrap async operations in try-catch blocks
  • Use specific error types for different failure modes
  • Provide meaningful error messages to users
  • Log errors appropriately for debugging

Documentation

  • Use JSDoc comments for all public functions and classes
  • Document parameter types and return values
  • Include usage examples in documentation
  • Explain complex business logic with inline comments

Read the full file on GitHub · 311 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. yesterday First seen · 311 lines · 0 tokens per session scan A 44a315552805

Subscribe to this mod's changes

mcp is a cursor rule published in the GitHub repository sunra-ai/sunra-clients (7 stars, last pushed 8d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,016 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.