Rightshold™ Sign up

Answers · code licenses

Which license should I choose for my open-source MCP server?

Last updated

TL;DR: Pick one on purpose, and add it before anyone uses the code: with no license file, default copyright applies and nobody may legally copy, change or redistribute your server, even though the repo is public. For most MCP servers the choice is MIT or Apache-2.0. Both let anyone use the server in commercial and closed products as long as they keep your notice; Apache-2.0 adds an express patent grant and is what the MCP project itself is moving to for new code. If you want people who run a modified copy of your server as a hosted service to share their changes, AGPL-3.0 is the license built for that, at the cost of many companies avoiding it. Check your dependencies first: a GPL or AGPL dependency limits what you can choose.

What should I check, step by step?

1. List your server's dependencies and their licenses before choosing; anything you bundle constrains your outbound license (npm sbom, pip-licenses, or Rightshold's check.mjs).

  1. Decide what you want: maximum adoption (MIT or Apache-2.0), patent protection for users and contributors (Apache-2.0), or changes to hosted copies coming back to you (AGPL-3.0).
  2. Add the full license text as LICENSE (or LICENSE.md / LICENSE.txt) at the repo root, with your name or organization and the year. GitHub detects it with Licensee and shows it on the repo page.
  3. Set the same SPDX id in your package metadata: "license": "Apache-2.0" in package.json, or license = "MIT" in pyproject.toml.
  4. Keep the license file in what you publish to npm, PyPI or a container registry, not only on GitHub.
  5. If you take outside contributions, say in CONTRIBUTING.md that contributions are under the project's license, so you never have to ask everyone later (the MCP project is doing exactly that to move from MIT to Apache-2.0).
  6. Write down why you chose it. Changing licenses later means getting agreement from every contributor whose code you keep, or rewriting their code.

Why a public repo with no license isn't open source

GitHub's licensing docs say that without a license, default copyright law applies: you keep all rights and no one may reproduce, distribute or create derivative works from your code.

MIT vs Apache-2.0 vs AGPL-3.0 for an MCP server

MIT: shortest, only asks users to keep the copyright and license notice. Fine for small servers and wrappers; it has no express patent grant.

What the MCP project itself does

The LICENSE in the modelcontextprotocol/modelcontextprotocol repo says the project is moving from MIT to Apache-2.0: new code and specification contributions are Apache-2.0, documentation is CC-BY-4.0, and older contributions stay MIT until their authors agree to relicense.

What can go wrong?

You bundle a GPL or AGPL dependency in an MIT server you ship. The combined copy you distribute has to follow the copyleft license; MIT on your own files doesn't change that.

What do the license checks say?

Yes means the license grants the use, on the duties listed. Duties such as source_disclosure, share_alike and network_source_offer are the ones that conflict with keeping a product closed-source.

UseAnswerWhy
Someone modifies your MIT server and ships it in a paid closed-source product (MIT)YesEvery use you described is granted by MIT, and nothing you described is prohibited. Duties: attribution, license_notice.
The same under Apache-2.0 (Apache-2.0)YesEvery use you described is granted by Apache 2.0, and nothing you described is prohibited. Duties: attribution, license_notice, state_changes.
The same under AGPL-3.0 (AGPL-3.0-only)YesEvery use you described is granted by AGPL 3.0, and nothing you described is prohibited. Duties: attribution, license_notice, state_changes, share_alike, source_disclosure, network_source_offer.

How do I ask Rightshold about this (free, no key)?

Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code, then ask: “My MCP server depends on packages under MIT, Apache-2.0 and ISC. Can I license it under Apache-2.0, and what do I have to keep?”

One-click setup

{
  "tool": "license_compatibility",
  "arguments": {
    "licenses": [
      "MIT",
      "Apache-2.0",
      "ISC"
    ],
    "intended_use": {
      "redistribution": true,
      "commercial_use": true
    }
  }
}

Rightshold checks the licenses you give it and the license a GitHub, npm or PyPI page declares. It doesn't choose a license for you, read your code, or know your goals, and it isn't legal advice.

What are the sources?

Related

Not legal advice. JSON · Markdown · All answers

Get a free API key in one call

No card and no email needed. 100 free credits; the license and policy checks stay free without a key.

curl -s -X POST https://www.rightshold.com/v1/accounts/signup -H "Content-Type: application/json" -d '{"accept_terms":true}'
export RIGHTSHOLD_API_KEY=rs_...   # the api_key from the reply (shown once)
curl -s https://www.rightshold.com/v1/licenses/check -H "Authorization: Bearer $RIGHTSHOLD_API_KEY" \
  -H "Content-Type: application/json" -d '{"license":"MIT","intended_use":{"commercial_use":true}}'