Local Utilities MCP Server
by arjshiv
Verified
# Cursor Rules for localutils-mcp-server
This document defines the coding standards and rules for the localutils-mcp-server project.
All rules are enforced through the Cursor IDE and are documented in detail in the `.cursor/rules/` directory.
## MCP Workflow Diagrams
All MCP implementations must include workflow diagrams using Mermaid. Below is the standard MCP workflow:
```mermaid
graph TD
A[Client Request] --> B[MCP Server]
B --> C{Protocol Handler}
C --> D[Execute Command]
C --> E[Process Data]
C --> F[Handle Error]
D --> G[Return Result]
E --> G
F --> G
G --> B
B --> H[Client Response]
style A fill:#f9f,stroke:#333,stroke-width:2px
style B fill:#bbf,stroke:#333,stroke-width:2px
style C fill:#dfd,stroke:#333,stroke-width:2px
```
### Required Workflow Documentation
Each MCP implementation must document:
```mermaid
graph LR
A[Protocol Definition] --> B[Handler Implementation]
B --> C[Error Handling]
B --> D[Data Processing]
B --> E[Command Execution]
style A fill:#f96,stroke:#333,stroke-width:2px
style B fill:#9cf,stroke:#333,stroke-width:2px
```
## Core TypeScript Files
| Pattern | Rule File | Description |
|---------|-----------|-------------|
| `*.ts` | typescript.mdc | Core TypeScript source files |
| `*.tsx` | typescript.mdc | TypeScript React components |
| `src/**/*.ts` | typescript.mdc | All TypeScript files in src |
| `src/utils/*.ts` | typescript.mdc | Utility TypeScript files |
| `src/types/*.ts` | typescript.mdc | Type definition files |
## Testing Files
| Pattern | Rule File | Description |
|---------|-----------|-------------|
| `*.test.ts` | testing.mdc | Unit test files |
| `*.spec.ts` | testing.mdc | Integration test files |
| `src/__tests__/**` | testing.mdc | Test directory and contents |
| `src/**/*.test.ts` | testing.mdc | Tests throughout source |
| `src/test-utils/*.ts` | testing.mdc | Test utilities |
## Configuration Files
| Pattern | Rule File | Description |
|---------|-----------|-------------|
| `*.config.js` | config.mdc | JavaScript config files |
| `*.config.ts` | config.mdc | TypeScript config files |
| `tsconfig.json` | typescript-config.mdc | TypeScript configuration |
| `jest.config.js` | config.mdc | Jest test configuration |
| `.env*` | config.mdc | Environment configurations |
## Package Management
| Pattern | Rule File | Description |
|---------|-----------|-------------|
| `package.json` | package.mdc | NPM package definition |
| `package-lock.json` | package-lock.mdc | NPM lock file |
| `yarn.lock` | package-lock.mdc | Yarn lock file |
| `pnpm-lock.yaml` | package-lock.mdc | PNPM lock file |
| `.npmrc` | package.mdc | NPM/PNPM configuration |
| `pnpm-workspace.yaml` | package.mdc | PNPM workspace configuration |
## Documentation
| Pattern | Rule File | Description |
|---------|-----------|-------------|
| `*.md` | documentation.mdc | Markdown documentation |
| `docs/**/*.md` | documentation.mdc | Documentation directory |
| `README.md` | documentation.mdc | Project readme |
| `CHANGELOG.md` | documentation.mdc | Change log |
| `CONTRIBUTING.md` | documentation.mdc | Contribution guide |
| `LICENSE` | documentation.mdc | License file |
## MCP Documentation
| Pattern | Rule File | Description |
|---------|-----------|-------------|
| `src/mcp/**/README.md` | mcp-docs.mdc | MCP implementation docs |
| `src/mcp/**/*.flow.md` | mcp-docs.mdc | MCP workflow diagrams |
| `src/protocols/**/README.md` | mcp-docs.mdc | Protocol documentation |
| `docs/mcp/*.md` | mcp-docs.mdc | General MCP documentation |
## Build Output
| Pattern | Rule File | Description |
|---------|-----------|-------------|
| `build/**` | ignore | Build output directory |
| `dist/**` | ignore | Distribution directory |
| `coverage/**` | ignore | Test coverage reports |
| `node_modules/**` | ignore | Dependencies directory |
| `.pnpm-store/**` | ignore | PNPM store directory |
## IDE and Tools
| Pattern | Rule File | Description |
|---------|-----------|-------------|
| `.vscode/**` | ignore | VSCode settings |
| `.idea/**` | ignore | IntelliJ settings |
| `.git/**` | ignore | Git directory |
| `.DS_Store` | ignore | macOS system files |
## MCP Specific
| Pattern | Rule File | Description |
|---------|-----------|-------------|
| `src/mcp/**/*.ts` | typescript.mdc | MCP implementation files |
| `src/protocols/**/*.ts` | typescript.mdc | Protocol definition files |
| `src/handlers/**/*.ts` | typescript.mdc | Protocol handlers |
## Scripts and Tools
| Pattern | Rule File | Description |
|---------|-----------|-------------|
| `scripts/**/*.ts` | typescript.mdc | Build and utility scripts |
| `tools/**/*.ts` | typescript.mdc | Development tools |
| `bin/**/*.ts` | typescript.mdc | Binary executables |
## Notes:
1. Rules are applied in order of specificity (more specific patterns take precedence)
2. The `ignore` rule means the files are excluded from Cursor's analysis
3. Custom rules can be added in `.cursor/rules/` directory
4. File patterns support glob syntax
5. Multiple rules can be applied to the same file
For detailed rule documentation, see the corresponding .mdc files in `.cursor/rules/`.