Mirror of https://github.com/modelcontextprotocol/quickstart-resources — A repository of servers and clients from the Model Context Protocol tutorials
  • JavaScript 19.6%
  • Rust 17.3%
  • Go 16.6%
  • TypeScript 13.2%
  • Ruby 11.8%
  • Other 21.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
olaservo 84ffd2d7d2 Add structured output to the Go weather server and client
Both tools declare an OutputSchema and return StructuredContent alongside the
text.

get_alerts returns []Alert, so it answers with a top-level JSON array rather
than an array nested in an object, which protocol revision 2026-07-28 is the
first to allow. "No alerts" is simply []. get_forecast returns an object, for
contrast. The declared schema narrows the inferred ["null","array"] root to
"array": jsonschema-go infers the nullable form because a nil slice is valid
Go, but the handler always builds a slice.

Error paths return an error: a tool declaring an OutputSchema MUST return
conforming structured content, so a path with no data has to fail.

The client compiles every declared OutputSchema at connect time and validates
results against it, using jsonschema-go - already an SDK dependency, so no new
one. Each channel goes to its stated reader: Content is forwarded to the
model, StructuredContent is used as data, reporting how many items came back.

The client no longer treats a missing .env as fatal and checks for
ANTHROPIC_API_KEY after connecting rather than before, matching the Python and
TypeScript clients, so the connection can be exercised without credentials.

Requires go-sdk v1.7.0-pre.3: non-object output schema support (SEP-2106)
landed after v1.6.1 and is in no stable release. Model identifier moves to
claude-sonnet-5; the second call in the tool loop used a hardcoded
ModelClaude3_7SonnetLatest while the first used the package variable, so both
now use the same one.

Note that the SDK sends an array-rooted schema as written on every connection
rather than projecting it down, so an older client rejects the tool list.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09 15:36:32 -07:00
.github/workflows Assert on structured output in the smoke tests and update to v2 (#163) 2026-08-03 19:42:57 +02:00
mcp-client-go Add structured output to the Go weather server and client 2026-08-09 15:36:32 -07:00
mcp-client-python Add structured content to the Python weather server and client and update to v2 (#164) 2026-08-09 14:46:03 +02:00
mcp-client-ruby Update quickstart URLs (#140) 2026-05-16 08:59:02 -07:00
mcp-client-rust Update quickstart URLs (#140) 2026-05-16 08:59:02 -07:00
mcp-client-typescript Bump the npm_and_yarn group across 3 directories with 2 updates 2026-07-23 15:14:04 +00:00
tests Assert on structured output in the smoke tests and update to v2 (#163) 2026-08-03 19:42:57 +02:00
weather-server-go Add structured output to the Go weather server and client 2026-08-09 15:36:32 -07:00
weather-server-python Add structured content to the Python weather server and client and update to v2 (#164) 2026-08-09 14:46:03 +02:00
weather-server-ruby Update quickstart URLs (#140) 2026-05-16 08:59:02 -07:00
weather-server-rust Update quickstart URLs (#140) 2026-05-16 08:59:02 -07:00
weather-server-typescript Bump the npm_and_yarn group across 3 directories with 2 updates 2026-07-23 15:14:04 +00:00
.gitattributes Add .gitattributes to mark lock files as generated 2025-12-12 09:52:25 -06:00
.gitignore Assert on structured output in the smoke tests and update to v2 (#163) 2026-08-03 19:42:57 +02:00
LICENSE chore: update licensing to Apache 2.0 for new contributions 2026-01-12 22:49:32 +00:00
README.md Update quickstart URLs (#140) 2026-05-16 08:59:02 -07:00
SECURITY.md docs: add security notes for network-exposed MCP servers 2026-02-07 12:55:02 +01:00

Quickstart Resources

A repository of servers and clients from the following Model Context Protocol tutorials:

Security Note

These examples are intentionally minimal. If you expose an MCP server over a network (HTTP/SSE/WebSocket), add authentication and basic hardening (CORS allowlist, request size limits, timeouts, rate limits, and log redaction). See SECURITY.md.