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%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github/workflows | ||
| docs | ||
| examples | ||
| schema | ||
| scripts | ||
| site | ||
| spec | ||
| .gitignore | ||
| .nvmrc | ||
| package.json | ||
| README.md | ||
| yarn.lock | ||
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.