agentleFS
pandeussilvaepandeussilvae/mcp-odoo-panda/.cursor/rules/mcp-server-rules.mdc

mcp-odoo-panda / rules

Cursor rule8 starsChanged 19 months agoMITView on GitHub

  • Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.

    Of the Cursor rule files we read, the 4,183 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

The file

Show its rules and text

We split this mcp-server-rules.mdc into the rules it gives an agent

80 rules. About 0 are common, 79 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈79

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All MCP servers must inherit from the base Server class

    line 11
  2. Distinctive:

    Must implement all abstract methods defined in the base class

    line 12
  3. Distinctive:

    Must provide proper initialization with server name and version

    line 13
  4. Distinctive:

    Must maintain protocol version compatibility

    line 14
  5. Distinctive:

    Must follow MCP's client-server architecture where:

    line 15
  6. Distinctive:

    Must support at least one of the following protocols:

    line 23
  7. Distinctive:

    Must handle protocol-specific initialization and cleanup

    line 27
  8. Distinctive:

    Must implement JSON-RPC 2.0 message format

    line 28
  9. Distinctive:

    Must support stateful connections

    line 29
  10. Distinctive:

    Must implement server and client capability negotiation

    line 30
  11. Distinctive:

    Must declare server capabilities during initialization

    line 33
  12. Distinctive:

    Must maintain capability list consistency

    line 39
  13. Distinctive:

    Must support feature flags:

    line 40
  14. Distinctive:

    Must implement proper resource URI parsing

    line 50
  15. Distinctive:

    Must support resource listing and retrieval

    line 51
  16. Distinctive:

    Must handle resource updates and notifications

    line 52
  17. Distinctive:

    Must validate resource access permissions

    line 53
  18. Distinctive:

    Must follow MCP's resource primitives:

    line 54
  19. Distinctive:

    Must support standard resource types:

    line 60
  20. Distinctive:

    Must provide proper MIME type handling

    line 65
  21. Distinctive:

    Must implement resource caching when appropriate

    line 66
  22. Distinctive:

    Must support Odoo-specific resources:

    line 67
  23. Distinctive:

    Must implement tool registration and discovery

    line 76
  24. Distinctive:

    Must validate tool parameters

    line 77
  25. Distinctive:

    Must handle tool execution errors

    line 78
  26. Distinctive:

    Must provide proper tool documentation

    line 79
  27. Distinctive:

    Must follow MCP's tool primitives:

    line 80
  28. Distinctive:

    Must implement rate limiting

    line 86
  29. Distinctive:

    Must validate tool access permissions

    line 87
  30. Distinctive:

    Must sanitize tool inputs

    line 88
  31. Distinctive:

    Must handle sensitive data appropriately

    line 89
  32. Distinctive:

    Must implement Odoo-specific security:

    line 90
  33. Distinctive:

    Must implement prompt registration

    line 99
  34. Distinctive:

    Must support prompt templates

    line 100
  35. Distinctive:

    Must handle prompt arguments

    line 101
  36. Distinctive:

    Must provide prompt documentation

    line 102
  37. Distinctive:

    Must follow MCP's prompt primitives:

    line 103
  38. Distinctive:

    Must support standard prompt types:

    line 109
  39. Distinctive:

    Must support Odoo-specific prompts:

    line 115
  40. Distinctive:

    Must support configuration via:

    line 124
  41. Distinctive:

    Must validate configuration values

    line 129
  42. Distinctive:

    Must provide default values for optional settings

    line 130
  43. Distinctive:

    Must support Odoo configuration:

    line 131
  44. Distinctive:

    Must support Odoo-specific settings:

    line 145
  45. Distinctive:

    Must implement proper error handling for:

    line 155
  46. Distinctive:

    Must provide meaningful error messages

    line 161
  47. Distinctive:

    Must maintain error logging

    line 162
  48. Distinctive:

    Must handle Odoo-specific errors:

    line 163
  49. Distinctive:

    Must use standard error codes

    line 170
  50. Distinctive:

    Must implement custom error types when needed

    line 171
  51. Distinctive:

    Must handle both synchronous and asynchronous errors

    line 172
  52. Distinctive:

    Must support Odoo error types:

    line 173
  53. Distinctive:

    Must implement proper logging for:

    line 182
  54. Distinctive:

    Must support multiple logging handlers

    line 187
  55. Distinctive:

    Must allow log level configuration

    line 188
  56. Distinctive:

    Must log Odoo-specific events:

    line 189
  57. Distinctive:

    Must include Odoo-specific context:

    line 202
  58. Distinctive:

    Must implement connection pooling

    line 212
  59. Distinctive:

    Must handle connection timeouts

    line 213
  60. Distinctive:

    Must implement proper cleanup

    line 214
  61. Distinctive:

    Must support connection limits

    line 215
  62. Distinctive:

    Must optimize Odoo connections:

    line 216
  63. Distinctive:

    Must implement caching for:

    line 223
  64. Distinctive:

    Must handle cache invalidation

    line 227
  65. Distinctive:

    Must respect cache TTL settings

    line 228
  66. Distinctive:

    Must implement Odoo-specific caching:

    line 229
  67. Distinctive:

    Must implement proper authentication

    line 238
  68. Distinctive:

    Must handle session management

    line 239
  69. Distinctive:

    Must support multiple authentication methods

    line 240
  70. Distinctive:

    Must implement proper token handling

    line 241
  71. Distinctive:

    Must support Odoo authentication:

    line 242
  72. Distinctive:

    Must implement access control

    line 249
  73. Distinctive:

    Must handle role-based access

    line 251
  74. Distinctive:

    Must implement proper security headers

    line 252
  75. Distinctive:

    Must enforce Odoo security:

    line 253
  76. Distinctive:

    Must include tests for:

    line 262
  77. Distinctive:

    Must test Odoo integration:

    line 269
  78. Distinctive:

    Must include Odoo-specific tests:

    line 282
  79. Distinctive:

    Must document Odoo integration:

    line 297
  80. Distinctive:

    Must include Odoo-specific documentation:

    line 310

≈ “Common” is an estimate: at least 1 in 5 of the 6,668 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
mcp-server-rules.mdc
---
description: 
globs: 
alwaysApply: false
---
# MCP Server Implementation Rules

## Core Architecture Rules

1. **Server Base Class**
   - All MCP servers must inherit from the base `Server` class
   - Must implement all abstract methods defined in the base class
   - Must provide proper initialization with server name and version
   - Must maintain protocol version compatibility
   - Must follow MCP's client-server architecture where:
     - MCP Hosts: Programs that want to access data through MCP
     - MCP Clients: Protocol clients that maintain 1:1 connections with servers
     - MCP Servers: Lightweight programs exposing specific capabilities
     - Local Data Sources: Computer's files, databases, and services
     - Remote Services: External systems available over the internet

2. **Protocol Support**
   - Must support at least one of the following protocols:
     - Stdio Protocol (default)
     - Streamable HTTP Protocol
   - Protocol selection must be configurable
   - Must handle protocol-specific initialization and cleanup
   - Must implement JSON-RPC 2.0 message format
   - Must support stateful connections
   - Must implement server and client capability negotiation

3. **Capabilities Declaration**
   - Must declare server capabilities during initialization
   - Must include:
     - Resources support and templates
     - Tools support and list
     - Prompts support and list
     - Experimental features (if any)
   - Must maintain capability list consistency
   - Must support feature flags:
     - prompts.listChanged
     - resources.subscribelistChanged
     - tools.listChanged
     - logging
     - completion

## Resource Management Rules

1. **Resource Handling**
   - Must implement proper resource URI parsing
   - Must support resource listing and retrieval
   - Must handle resource updates and notifications
   - Must validate resource access permissions
   - Must follow MCP's resource primitives:
     - Application-controlled contextual data
     - Managed by the client application
     - Examples: File contents, API responses

2. **Resource Types**
   - Must support standard resource types:
     - Text resources
     - Binary resources
     - List resources
     - Record resources
   - Must provide proper MIME type handling
   - Must implement resource caching when appropriate
   - Must support Odoo-specific resources:
     - Model records
     - Binary fields
     - Related records
     - Computed fields

## Tool Management Rules

1. **Tool Implementation**
   - Must implement tool registration and discovery
   - Must validate tool parameters
   - Must handle tool execution errors
   - Must provide proper tool documentation
   - Must follow MCP's tool primitives:
     - Model-controlled functions
     - Exposed to the LLM for actions
     - Examples: API calls, data updates

2. **Tool Security**
   - Must implement rate limiting
   - Must validate tool access permissions
   - Must sanitize tool inputs
   - Must handle sensitive data appropriately
   - Must implement Odoo-specific security:
     - User authentication
     - Record access rights
     - Field access rights
     - Method access rights

## Prompt Management Rules

1. **Prompt Handling**
   - Must implement prompt registration
   - Must support prompt templates
   - Must handle prompt arguments
   - Must provide prompt documentation
   - Must follow MCP's prompt primitives:
     - User-controlled interactive templates
     - Invoked by user choice
     - Examples: Slash commands, menu options

2. **Prompt Types**
   - Must support standard prompt types:
     - Analyze record prompts
     - Create record prompts
     - Update record prompts
     - Search prompts
     - Method call prompts
   - Must support Odoo-specific prompts:
     - Record creation workflows
     - Record update workflows
     - Record search workflows
     - Method execution workflows

## Configuration Rules

1. **Configuration Management**
   - Must support configuration via:
     - YAML files
     - JSON files
     - Environment variables
     - Command line arguments
   - Must validate configuration values
   - Must provide default values for optional settings
   - Must support Odoo configuration:
     - Database connection
     - Authentication credentials
     - API endpoints
     - Protocol selection (XML-RPC/JSON-RPC)

2. **Required Configuration**
   - Must include:
     - Server name and version
     - Protocol settings
     - Connection settings
     - Authentication settings
     - Rate limiting settings
     - Logging settings
   - Must support Odoo-specific settings:
     - Database name
     - User credentials
     - API version
     - Connection timeout
     - Retry policies

## Error Handling Rules

1. **Error Management**
   - Must implement proper error handling for:
     - Protocol errors
     - Authentication errors
     - Resource errors
     - Tool execution errors
     - Configuration errors
   - Must provide meaningful error messages
   - Must maintain error logging
   - Must handle Odoo-specific errors:
     - Connection errors
     - Authentication failures
     - Record access errors
     - Method execution errors

2. **Error Types**
   - Must use standard error codes
   - Must implement custom error types when needed
   - Must handle both synchronous and asynchronous errors
   - Must support Odoo error types:
     - AccessError
     - ValidationError
     - UserError
     - MissingError

## Logging Rules

1. **Logging Implementation**
   - Must implement proper logging for:
     - Server initialization
     - Request handling
     - Error conditions
     - Performance metrics
   - Must support multiple logging handlers
   - Must allow log level configuration
   - Must log Odoo-specific events:
     - API calls
     - Record operations
     - Method executions
     - Authentication events

2. **Log Format**
   - Must include:
     - Timestamp
     - Log level
     - Component name
     - Message
     - Context information when relevant
   - Must include Odoo-specific context:
     - User ID
     - Database name
     - Model name
     - Record ID
     - Method name

## Performance Rules

1. **Connection Management**
   - Must implement connection pooling
   - Must handle connection timeouts
   - Must implement proper cleanup
   - Must support connection limits
   - Must optimize Odoo connections:
     - Connection reuse
     - Batch operations
     - Caching strategies
     - Request batching

2. **Caching**
   - Must implement caching for:
     - Resources
     - Authentication tokens
     - Tool results
   - Must handle cache invalidation
   - Must respect cache TTL settings
   - Must implement Odoo-specific caching:
     - Record cache
     - Field cache
     - Method result cache
     - Permission cache

## Security Rules

1. **Authentication**
   - Must implement proper authentication
   - Must handle session management
   - Must support multiple authentication methods
   - Must implement proper token handling
   - Must support Odoo authentication:
     - User/password authentication
     - API key authentication
     - Session management
     - Token refresh

2. **Authorization**
   - Must implement access control
   - Must validate permissions
   - Must handle role-based access
   - Must implement proper security headers
   - Must enforce Odoo security:
     - Record access rules
     - Field access rules
     - Method access rules
     - User group permissions

## Testing Rules

1. **Test Coverage**
   - Must include tests for:
     - Core functionality
     - Protocol handling
     - Resource management
     - Tool execution
     - Error handling
     - Security features
   - Must test Odoo integration:
     - API connectivity
     - Record operations
     - Method execution
     - Error handling

2. **Test Types**
   - Must implement:
     - Unit tests
     - Integration tests
     - Protocol tests
     - Security tests
     - Performance tests
   - Must include Odoo-specific tests:
     - API integration tests
     - Record operation tests
     - Permission tests
     - Error handling tests

## Documentation Rules

1. **Code Documentation**
   - Must include:
     - Module documentation
     - Class documentation
     - Method documentation
     - Type hints
     - Examples
   - Must document Odoo integration:
     - API usage
     - Record operations
     - Method calls
     - Error handling

2. **API Documentation**
   - Must document:
     - Available resources
     - Available tools
     - Available prompts
     - Protocol specifications
     - Error codes
   - Must include Odoo-specific documentation:
     - Model descriptions
     - Field descriptions
     - Method descriptions
     - Permission requirements

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.