Skip to content

Mcp server best practices#32

Merged
kentcdodds merged 12 commits into
mainfrom
cursor/mcp-server-best-practices-2358
Feb 18, 2026
Merged

Mcp server best practices#32
kentcdodds merged 12 commits into
mainfrom
cursor/mcp-server-best-practices-2358

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Feb 18, 2026

Copy link
Copy Markdown
Member

Adds MCP Server Best Practices documentation and updates the example server to follow these guidelines for improved AI interaction and discoverability.


Open in Cursor Open in Web


Note

Low Risk
Primarily documentation and metadata/UX improvements for an example tool; behavior changes are small and covered by updated E2E assertions.

Overview
Adds docs/mcp-server-best-practices.md, capturing recommended MCP patterns (server instructions, tool descriptions/annotations, schemas, responses, etc.).

Refactors the example MCP server to consume centralized server-metadata.ts for server identity/instructions and do_math tool metadata/annotations, and upgrades do_math to return markdown content plus structuredContent, validate inputs (finite numbers, precision), and emit actionable error responses (e.g., division by zero/non-finite results). E2E tests are updated to assert presence of onboarding instructions and verify structuredContent.result alongside text output.

Written by Cursor Bugbot for commit 2ff2860. This will update automatically on new commits. Configure here.

cursoragent and others added 5 commits February 18, 2026 16:12
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@cursor

cursor Bot commented Feb 18, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@kentcdodds
kentcdodds marked this pull request as ready for review February 18, 2026 17:05
@github-actions

github-actions Bot commented Feb 18, 2026

Copy link
Copy Markdown

🔎 Preview deployed: https://epicflare-pr-32.kentcdodds.workers.dev

Worker: epicflare-pr-32
D1: epicflare-pr-32-db
KV: epicflare-pr-32-oauth-kv

Mocks:

Comment thread mcp/tools.ts
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@cursor

cursor Bot commented Feb 18, 2026

Copy link
Copy Markdown

Bugbot Autofix prepared fixes for 1 of the 1 bugs found in the latest run.

  • ✅ Fixed: Arithmetic overflow silently corrupts structured result to null
    • Added a non-finite result guard that returns an explicit error instead of emitting an unrepresentable value in structuredContent.

Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is ON. A Cloud Agent has been kicked off to fix the reported issue.

Comment thread mcp/server-best-practices-doc.ts Outdated
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Comment thread mcp/tools.ts Outdated
@kentcdodds
kentcdodds merged commit 4c72af1 into main Feb 18, 2026
2 of 3 checks passed
@kody-bot
kody-bot deleted the cursor/mcp-server-best-practices-2358 branch March 24, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants