Thank you for your interest in contributing to the Model Context Protocol specification, schemas, or docs! This document outlines how to contribute to this project.
Also see the overall MCP communication guidelines in our docs, which explain how and where discussions about changes happen.
The following software is required to work on the spec:
- Node.js 24 or above
- TypeScript
- TypeScript JSON Schema (for generating JSON schema)
- Mintlify (optional, for docs)
- nvm (optional, for managing Node versions)
-
Clone your fork:
git clone https://github.com/YOUR-USERNAME/modelcontextprotocol.git cd modelcontextprotocol -
Install dependencies:
nvm install # install correct Node version npm install # install dependencies
-
Create a new branch:
git checkout -b feature/your-feature-name
Schema changes go in schema/draft/schema.ts. To validate your changes, run:
npm run check:schema:tsschema/draft/schema.json and docs/specification/draft/schema.mdx are generated from schema/draft/schema.ts; do not edit them directly. To generate them, run:
npm run generate:schemaIf your branch conflicts with main in generated files (schema/*/schema.json, docs/specification/*/schema.mdx, docs/seps/*.mdx), do not resolve them by hand. Merge main, resolve any conflicts in the source files (e.g. schema/draft/schema.ts), then regenerate and commit:
git merge main
npm run generate
git add .
git commitThese files are marked with -merge in .gitattributes, so git keeps your branch's copy and flags them as conflicted instead of inserting conflict markers.
Documentation is written in MDX format and in the docs directory.
You can preview documentation changes locally by running:
npm run serve:docsAnd lint them with:
npm run check:docs
npm run formatNote
You can run all schema/documentation
changes at once with npm run prep.
The blog is built using Hugo and located in the blog directory.
To preview blog changes locally:
npm run serve:blogWhen contributing to the documentation:
- Keep content clear, concise, and technically accurate
- Follow the existing file structure and naming conventions
- Include code examples where appropriate
- Use proper MDX formatting and components
- Test all links and code samples
- You may run
npm run check:docs:linksto look for broken internal links.
- You may run
- Use appropriate headings: "When to use", "Steps", and "Tips" for tutorials
- Place new pages in appropriate sections (concepts, tutorials, etc.)
- Update
docs.jsonwhen adding new pages - Follow existing file naming conventions (
kebab-case.mdx) - Include proper frontmatter in MDX files
Specification changes follow the SEP process. Before drafting a proposal, review the MCP design principles — proposals that align with these principles move faster through review.
The shortest summary: explore the problem space and validate that others share the problem, build a prototype that demonstrates a solution, then write the SEP based on what the prototype taught you.
- Push your changes to your fork
- Submit a pull request to the main repository
- Follow the pull request template
- Wait for review
If you are using any kind of AI assistance to contribute to Model Context Protocol, it must be disclosed in the pull request or issue. See AI_POLICY.md for the full policy, including disclosure expectations and what we look for in AI-assisted contributions.
By contributing, you agree that your code or specification contributions will be licensed under the Apache License 2.0. Documentation contributions (excluding specifications) are licensed under CC-BY 4.0. See the LICENSE file for details.
Please review our Security Policy for reporting security issues.