mcp-devtools / rules
Cursor rule13 starsChanged 21 months agoMITArchived repositoryView on GitHub
Core Libraries Usage Guidelines
- Reads credentials
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 1,533 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.
In this repository9 other files it gives its agents.
- .cursor/rules/ai-assisted-development.mdcCursor rule
- .cursor/rules/mcp-server-implementation.mdcCursor rule
- .cursor/rules/mcp-tool-implementation.mdcCursor rule
- .cursor/rules/new-package-creation.mdcCursor rule
- .cursor/rules/package-documentation.mdcCursor rule
- .cursor/rules/repository-structure.mdcCursor rule
- .cursor/rules/rules-for-cursor.mdcCursor rule
- .cursor/rules/testing-standards.mdcCursor rule
- .cursor/rules/typescript-style.mdcCursor rule
The file
We split this core-libraries-usage.mdc into the rules it gives an agent
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
When developing MCP DevTools packages, prefer using shared core libraries over custom implementations to ensure consistency and …
- Distinctive: line 38
Use the shared configuration management from core:
- Distinctive: line 55
Use the shared HTTP client with standard error handling:
- Distinctive: line 68
Use the standardized logging system:
- Distinctive: line 80
Use shared authentication utilities:
- Distinctive: line 91
Always check core libraries first: before implementing new functionality
- Distinctive: line 95
Follow versioning guidelines: when updating core library dependencies
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 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.
Files
---
description: Core Libraries Usage Guidelines
globs: packages/*/src/**/*.ts
alwaysApply: true
---
# Core Libraries Usage Guidelines
When developing MCP DevTools packages, prefer using shared core libraries over custom implementations to ensure consistency and maintainability.
@file packages/jira/src/index.ts
@file .cursor/rules/mcp-server-implementation.mdc
## Required Core Libraries
| Library | Package | Purpose | Import Statement |
| ------------- | --------------------------------- | ------------------------- | ------------------------------------------------------------------------ |
| MCP Server | `@modelcontextprotocol/server` | Core server functionality | `import { createMcpServer } from '@modelcontextprotocol/server';` |
| MCP Inspector | `@modelcontextprotocol/inspector` | Debugging tools | `import { inspector } from '@modelcontextprotocol/inspector';` |
| MCP Types | `@modelcontextprotocol/types` | Shared type definitions | `import { McpRequest, McpResponse } from '@modelcontextprotocol/types';` |
## Common Utilities
The MCP DevTools core utilities should be used instead of reimplementing common functionality:
```typescript
// PREFERRED: Import from core utilities
import { validateEnvVars, formatErrorResponse } from "@mcp-devtools/core/utils";
// AVOID: Custom implementation of utilities
const validateEnvVars = (required) => {
/* ... */
}; // Don't do this
```
## Configuration Management
Use the shared configuration management from core:
```typescript
import { loadConfig } from "@mcp-devtools/core/config";
// Load configuration with standard validation
const config = loadConfig({
requiredVars: ["API_KEY", "API_URL"],
optionalVars: {
TIMEOUT: "30000",
DEBUG: "false",
},
});
```
## HTTP Client
Use the shared HTTP client with standard error handling:
```typescript
import { httpClient } from "@mcp-devtools/core/http";
// Make HTTP requests with standard error handling
const response = await httpClient.get("https://api.example.com/data", {
headers: { Authorization: `Bearer ${config.API_KEY}` },
});
```
## Logging
Use the standardized logging system:
```typescript
import { logger } from "@mcp-devtools/core/logger";
// Log with standard levels and formatting
logger.info("Operation successful", { operationId: "123" });
logger.error("API call failed", { error, statusCode: 500 });
```
## Authentication Helpers
Use shared authentication utilities:
```typescript
import { createAuthHeaders, validateToken } from "@mcp-devtools/core/auth";
// Create standard auth headers
const headers = createAuthHeaders(config.API_KEY, config.API_SECRET);
```
## Guidelines
1. **Always check core libraries first** before implementing new functionality
2. **Keep dependencies updated** to ensure security and compatibility
3. **Contribute improvements** back to core libraries instead of creating package-specific versions
4. **Document usage** of core libraries in your package's README
5. **Follow versioning guidelines** when updating core library dependencies
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
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.

