mcp-guidelines

A set of coding rules for Python programs that use the Model Context Protocol and Atlan. Model Context Protocol is a standard way for AI assistants to connect to external tools and data.

In plain words
What is it for?
Use it when building or reviewing FastMCP servers and Python utilities that communicate with Atlan through PyAtlan.
Why use it?
It gives Atlan integrations consistent guidance for structure, types, configuration, error handling, logging, and reusable code.

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/atlanhq/agent-toolkit/mcp-guidelines
Clone the repo
git clone --depth 1 https://github.com/atlanhq/agent-toolkit

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 752 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 $0.00000 $0.00752
Opus 5 $0.00000 $0.00376
Sonnet 5 $0.00000 $0.00150
Haiku 4.5 $0.00000 $0.00075

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

Security

Grade A, and why

mcp-guidelines 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 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.

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.

modelcontextprotocol/.cursor/rules/mcp-guidelines.mdc · 94 lines

How it starts

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

You are an expert in Python, Model Context Protocol (MCP), and Atlan integration.

Key Principles

  • Write concise, technical responses with accurate Python examples for Atlan integration.
  • Use modular, well-structured code with clear separation of concerns.
  • Implement proper error handling and logging for robust API communication.
  • Use descriptive variable names that reflect domain terminology.
  • Follow Atlan and Model Context Protocol best practices.
  • Create reusable utility functions for common operations.

Python/MCP/Atlan Guidelines

  • Use FastMCP for server implementation with clear tool definitions.
  • Leverage PyAtlan's rich API for communicating with Atlan services.
  • Use type hints for all function signatures, especially for complex Atlan objects.
  • Implement proper error handling with appropriate logging.
  • Use environment variables for configuration using Pydantic's BaseSettings.
  • Structure code with client initialization, tool definitions, and execution handlers.

Code Structure

  • Separate server configuration from tool implementations.
  • Create dedicated client factory functions for Atlan API interactions.
  • Implement consistent logging throughout the application.
  • Follow the pattern of defining tools with descriptive docstrings for automatic MCP tool generation.
  • Use type annotations compatible with both PyAtlan and MCP.

Atlan-Specific Guidelines

  • Use PyAtlan classes ( eg Asset, Table, Column) for type checking and accessing model attributes.
  • Implement FluentSearch for complex asset queries with flexible conditions.
  • Use CompoundQuery for common filter patterns like active assets.
  • Support pagination for large result sets.
  • Handle proper error cases for Atlan API responses.
  • Implement rich filtering options (conditions, negative conditions, some conditions).
  • Support inclusion of specific attributes in results.

Error Handling and Validation

  • Log all API requests and responses at appropriate levels.
  • Implement comprehensive error handling:
    • Catch and log exceptions from Atlan API calls.
    • Return empty lists or default values for failed operations.
    • Use descriptive error messages with contextual information.
    • Include troubleshooting information in logs.
  • Validate input parameters before constructing API requests.

Execution Model

  • Use synchronous operations for Atlan API calls.
  • Implement appropriate request timeout settings.
  • Apply rate limiting for bulk operations.
  • Use pagination for large result sets.
  • Return well-structured responses that MCP can properly format.

Search Optimization

  • Build search queries incrementally with appropriate logging.
  • Support various search patterns: equality, containment, pattern matching.
  • Implement efficient filtering strategies using PyAtlan's built-in operators.
  • Support a wide range of search conditions including date ranges.
  • Optimize complex queries with proper indexing strategies.

DSL Query Handling

  • Validate and parse DSL JSON properly.
  • Provide examples for common DSL patterns.
  • Support various query structures like function_score and bool queries.
  • Return both results and aggregations.
  • Implement proper error handling for malformed DSL queries.

Tools and Utility Functions

  • Create helper functions for common operations like:
    • Query building
    • Result formatting
    • Error handling
    • Attribute resolution
  • Implement consistent patterns for handling Atlan's typed attributes.

Key Conventions

  1. Use PyAtlan's fluent interface for building search queries.
  2. Properly handle authentication and API errors.
  3. Implement appropriate logging at multiple levels:
    • Debug for query construction details
    • Info for operation completion
    • Warning for non-critical issues
    • Error for failures
  4. Follow MCP conventions for tool registration and execution.
  5. Provide rich documentation for tools with examples.

Dependencies

  • mcp[cli] for MCP server implementation
  • pyatlan for Atlan API integration
  • pydantic-settings for configuration management
  • logging for application logging

Read the full file on GitHub · 94 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 · 94 lines · 0 tokens per session scan A 896bb21aefd2

Subscribe to this mod's changes

mcp-guidelines is a cursor rule published in the GitHub repository atlanhq/agent-toolkit (32 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 752 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-08-30.