Boost Your Coding with Cursor: Rules, MCPs, and Structured Thinking
After four months of using the AI code assistant Cursor, the author shares a practical methodology that combines clear requirement articulation, pre‑planning, custom rules, and various Model Context Protocol (MCP) tools—such as feedback‑enhanced, sequential‑thinking, and better‑tapd—to streamline development, reduce token waste, and improve collaboration.
Preface: Why Choose Cursor?
In recent months the author was assigned to develop large‑model‑related applications. Initial exposure to OpenAI Agent SDK and concepts like FunctionCall, ReAct, and Agent felt confusing, but discovering Cursor helped quickly understand project code and improve efficiency, leading to a paid subscription and a set of AI‑paired programming practices.
Two deep insights emerged: (1) Precise, concrete requirements are essential for Cursor to provide accurate assistance; vague descriptions lead to poor results. (2) Planning before asking Cursor to write code—breaking down tasks, defining steps, and using documentation collaboration—greatly improves quality and speed.
Establishing Collaboration Rules
Rules act like a “family code” for AI, constraining its behavior to avoid uncontrolled output. By defining what the model can and cannot do, rules reduce ineffective communication, lower operational risk through minimal‑change principles, and ensure consistent code style across a team.
Rules are stored in .cursor/rules/*.mdc and managed via Git, allowing global and project‑specific rule sets.
Sample Rules
## General Etiquette
- Keep code simple and readable.
- Avoid over‑design; prioritize practicality.
- Minimize cyclomatic complexity; keep functions small and reusable.
- Use design patterns where appropriate.
- Explain code in plain language, preferably with Mermaid diagrams.
- When implementing, provide principles and step‑by‑step execution, with diagrams.
- Review all relevant code before modifying or explaining.
- Apply minimal changes; avoid touching unrelated modules.
- After changes, provide at least ten test cases with expected results.
- Mermaid diagrams must be syntax‑checked and render clearly in dark mode.
# Experimental Rule
When fixing a bug, follow these steps:
1. **Understand**: Restate the problem.
2. **Analyze**: Propose at least two root causes.
3. **Plan**: Describe verification and fix strategy.
4. **Confirm**: Ask for approval before modifying.
5. **Execute**: Apply the fix.
6. **Review**: Check the modification.
7. **Explain**: Detail what was changed and why.MCP (Model Context Protocol)
MCP is a toolbox that lets Cursor connect to external tools, turning it from a pure code parser into a full‑process development partner.
mcp-feedback-enhanced
Git link: https://github.com/Minidoracat/mcp-feedback-enhanced
This MCP prompts the model for feedback after each request, preventing wasted token quota caused by unclear instructions or repeated interactions.
Comparing usage with and without this MCP shows reduced token consumption when handling error messages.
sequential-thinking
A tool that gives the model a structured thinking process, breaking complex problems into steps such as Understand → Analyze → Plan → Confirm → Execute → Review → Explain.
mcp_better_tapd_server
Generates TAPD tickets automatically from the interaction history, filling in requirement background, execution steps, and linking to the appropriate iteration, eliminating repetitive manual entry.
Other Useful MCPs
context7 : Keeps real‑time documentation of components to prevent Cursor from “hallucinating” code.
mcp-git-ingest : Allows Cursor to read GitHub repositories directly without local checkout.
tRPCMCPServer : Provides assistance for TRPC scaffolding and documentation.
MCP Configuration Example
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp@latest"]
},
"mcp-git-ingest": {
"command": "uvx",
"args": ["--from", "git+https://github.com/adhikasp/mcp-git-ingest", "mcp-git-ingest"]
},
"mcp_better_tapd_server": {
"command": "uvx",
"args": ["--index-url", "https://mirrors.tencent.com/repository/pypi/tencent_pypi/simple", "--extra-index-url", "https://pypi.org/simple", "mcp_better_tapd_server"],
"env": {
"TAPD_API_USER": "feed_mcp",
"TAPD_API_PASSWORD": "",
"TAPD_API_BASE_URL": "xxxx",
"TAPD_BASE_URL": "xxx",
"TAPD_DEFAULT_OWNER": "xxxx",
"TAPD_WORKSPACE_ID": "xxx"
}
},
"mcp-feedback-enhanced": {
"command": "uvx",
"args": ["mcp-feedback-enhanced@latest"],
"timeout": 600,
"env": {
"MCP_DESKTOP_MODE": "true",
"MCP_WEB_PORT": "8765",
"MCP_DEBUG": "false"
},
"autoApprove": ["interactive_feedback"]
},
"tRPCMCPServer": {
"type": "sse",
"url": "http://trpc-mcp-server.woa.com/sse"
},
"sequential-thinking": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
}
}
}Practical Walkthrough
Step 1: Cursor’s Autonomous Decomposition
Cursor indexes core files, respecting the rule “review all related code before modification,” then invokes the sequential‑thinking tool to break the request into eight steps, linking each step to specific code modules.
Step 2: Visualization and Feedback Loop
Cursor generates a Mermaid diagram of the process, then calls mcp-feedback-enhanced to ask the user for additional details, efficiently using the token quota.
Step 3: Deep Iteration Based on Feedback
Cursor pinpoints the entry point Runner.run() (src/agents/run.py:166) and explains the subsequent AgentRunner.run() flow, the context handling, loop count, and hook invocations, then details how RunImpl.process_model_response parses LLM output.
This iterative process continues until the request reaches the MCP call limit (25 calls).
Conclusion
The experience shows that a well‑defined set of rules and a suite of MCP tools turn an AI assistant from a passive responder into an active collaborator, forcing developers to clarify requirements, adopt structured planning, and ultimately boost productivity.
Tencent Technical Engineering
Official account of Tencent Technology. A platform for publishing and analyzing Tencent's technological innovations and cutting-edge developments.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
