Skip to content

Conversation

domdomegg
Copy link
Member

This PR improves the README documentation:

  • Wraps the table of contents in collapsible <details> tags to reduce initial scroll length
  • Updates the quick start example to use streamable HTTP transport instead of stdio (more practical for most users)
  • Reorders sections to emphasize tools over resources (more common use case)
  • Adds structured output examples to tool responses showing the structuredContent field
  • Includes direct links to popular MCP clients (Inspector, Claude Code, VS Code, Cursor)
  • Clarifies the distinction between tools (model-controlled) and resources (application-driven)
  • Simplifies code examples with better comments and formatting
  • Removes redundant sections

These changes make it easier for new users to get started with MCP and understand the key concepts.

- Wrap TOC in collapsible details/summary tags to reduce initial scroll
- Update quick start example to use streamable HTTP instead of stdio
- Reorder overview to emphasize servers over clients
- Move resources section after tools since tools are more commonly used
- Add structured output examples to tool responses
- Improve code examples with better formatting and comments
- Add direct links to MCP clients (Inspector, Claude Code, VS Code, Cursor)
- Clarify tool vs resource use cases
- Remove redundant 'What is MCP?' section
- Simplify stateless HTTP example with clearer comments
@domdomegg domdomegg requested review from a team and felixweinberger September 29, 2025 16:58
@domdomegg domdomegg marked this pull request as draft September 29, 2025 16:58
- Replace .tool() with .registerTool() in all example servers
- Add outputSchema to all tool definitions
- Add structuredContent to all tool responses
- Align text content with structured output using JSON.stringify
- Add title fields to all tools for better UI presentation
@domdomegg domdomegg force-pushed the adamj/collapsible-toc branch from 0098151 to 996fc0b Compare September 29, 2025 17:43
@domdomegg domdomegg changed the title docs: make table of contents collapsible and improve quick start docs: improve main README with better quick start, include examples of stateless HTTP, explain tools v resources v prompts Sep 29, 2025
@domdomegg domdomegg marked this pull request as ready for review September 29, 2025 17:44
@domdomegg
Copy link
Member Author

NB: failing CI is unrelated, see #981

@domdomegg domdomegg enabled auto-merge (squash) September 29, 2025 21:33
README.md Outdated
## Quick Start

Let's create a simple MCP server that exposes a calculator tool and some data:
Let's create a simple MCP server that exposes a calculator tool and some data. Save the following as `server.mjs`:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why .mjs and not .ts? Shouldn't we be giving TypeScript based examples in our Readme?

Copy link
Member Author

Choose a reason for hiding this comment

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

The SDK is written in TypeScript but works whether your underlying source code is standard JS or TypeScript.

For the sake of being able to get started very quickly (e.g. not have to set up a typescript toolchain) I suggested this. Happy to change and provide instructions for/link to getting set up with tsx or similar.

This is also valid TypeScript anyway, so people can copy paste from this directly into TypeScript anyway. It just doesn't use any type annotations as they're not needed here.

Copy link
Contributor

@felixweinberger felixweinberger Oct 1, 2025

Choose a reason for hiding this comment

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

Imo given it's a typescript SDK and people who'd want to work with it likely want to get up and running in a TS environment, I'd argue we should have the quickstart reflect that. Is it that much more complicated to provide a quick start with tsx?

We could optionally provide somewhere in the readme to set up with javascript, but I wouldn't make that the very first example here.

Change the quickstart example from JavaScript (.mjs) to TypeScript (.ts)
and use npx tsx to run it directly without requiring a build step.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@domdomegg domdomegg force-pushed the adamj/collapsible-toc branch from 1638750 to 220c6f8 Compare October 2, 2025 22:32
Resolved conflicts by:
- Keeping collapsible TOC from this branch
- Keeping TypeScript/tsx approach from this branch (npx -y tsx)
- Adopting main's stdio transport instead of HTTP for quickstart
- Adopting main's content organization and improvements
- Accepting all example server changes from main
Copy link
Contributor

@felixweinberger felixweinberger left a comment

Choose a reason for hiding this comment

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

Thanks for updating the quick start!

@domdomegg domdomegg merged commit e0de082 into main Oct 3, 2025
5 checks passed
@domdomegg domdomegg deleted the adamj/collapsible-toc branch October 3, 2025 12:17
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