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 explains how and where discussions about changes happen.
The following software is required to work on the spec:
- Node.js 20 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:schemaDocumentation 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
- Simple + Minimal: It is much easier to add things to a specification than it is to remove them. To maintain simplicity, we keep a high bar for adding new concepts and primitives as each addition requires maintenance and compatibility consideration.
- Concrete: Specification changes need to be based on specific implementation challenges and not on speculative ideas.
- Define: Explore the problem space, validate that other MCP users face a similar issue, and then clearly define the problem.
- Prototype: Build an example solution to the problem and demonstrate its practical application.
- Write: Based on the prototype, write a specification proposal.
- Push your changes to your fork
- Submit a pull request to the main repository
- Follow the pull request template
- Wait for review
Important
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.
We welcome and encourage the use of AI tools to help improve Model Context Protocol. Many valuable contributions have been enhanced with AI assistance for code generation, issue detection, and feature definition.
That being said, if you are using any kind of AI assistance (e.g., agents such as Claude Code, ChatGPT) while contributing to Model Context Protocol, this must be disclosed in the pull request or issue, along with the extent to which AI assistance was used (e.g., documentation comments vs. code generation).
If your PR responses or comments are being generated by an AI, disclose that as well.
As an exception, trivial spacing or typo fixes don't need to be disclosed, so long as the changes are limited to small parts of the code or short phrases.
An example disclosure:
This PR was written primarily by Claude Code.
Or a more detailed disclosure:
I consulted ChatGPT to understand the codebase but the solution was fully authored manually by myself.
Failure to disclose this is first and foremost rude to the human operators on the other end of the pull request, but it also makes it difficult to determine how much scrutiny to apply to the contribution.
In a perfect world, AI assistance would produce equal or higher quality work than any human. That isn't the world we live in today, and in most cases where human supervision or expertise is not in the loop, it's generating code or changes that cannot be reasonably maintained or evolved.
When submitting AI-assisted contributions, please ensure they include:
- Clear disclosure of AI use - You are transparent about AI use and degree to which you're using it for the contribution
- Human understanding - You personally understand what the changes do
- Clear rationale - You can explain why the change is needed and how it fits within Model Context Protocol goals
- Concrete evidence - Include test cases, scenarios, or examples that demonstrate the improvement
- Your own analysis - Share your thoughts on the end-to-end experience
We reserve the right to close submissions that appear to not follow the disclosure policy.
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.