Mirror of https://github.com/modelcontextprotocol/typescript-sdk — The official TypeScript SDK for Model Context Protocol servers and clients
  • TypeScript 97.3%
  • JavaScript 2.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
David Soria Parra d06853c5e8
Initial import
2024-09-24 21:41:22 +01:00
.github/workflows Initial import 2024-09-24 21:41:22 +01:00
docs Initial import 2024-09-24 21:41:22 +01:00
examples Initial import 2024-09-24 21:41:22 +01:00
schema Initial import 2024-09-24 21:41:22 +01:00
scripts Initial import 2024-09-24 21:41:22 +01:00
site Initial import 2024-09-24 21:41:22 +01:00
spec Initial import 2024-09-24 21:41:22 +01:00
.gitignore Initial import 2024-09-24 21:41:22 +01:00
.nvmrc Initial import 2024-09-24 21:41:22 +01:00
package.json Initial import 2024-09-24 21:41:22 +01:00
README.md Initial import 2024-09-24 21:41:22 +01:00
yarn.lock Initial import 2024-09-24 21:41:22 +01:00

Model Context Protocol spec

This repo contains the specification and protocol schema for the Model Context Protocol.

The schema is defined in TypeScript first, but made available as JSON Schema as well, for wider compatibility.

Prequisites

The following software is required to work on the spec:

  • Typescript
  • Node.JS 20 or above
  • Yarn
  • Typescript JSON Schema (for generating json schema)
  • Hugo (optionally, for serving the documentation)
  • Go (optionall, for serving the documentation)
  • nvm (optionally, for managing node versions)

Validating and building the spec

The following commands install the dependencies, validate the schema and generate the json schema.

$ nvn install # install the correct node version
$ yarn install # install dependencies
$ yarn validate:schema # validate the schema
$ yarn validate:examples # validate the examples
$ yarn generate:json # generate the json schema

Serving the documentation

The documentation lives in the docs folder. To serve the documentation, run the following commands:

$ yarn serve:docs # serve the documentation

Note that this reqires Hugo and Go to be installed.