Versioning
How versioned endpoints work on mctx. URL format, semantic versioning, version lifecycle, routing, and multiple concurrent versions.
Ready to ship an update? Bump the version in package.json, push to GitHub, and mctx deploys it automatically. Your existing versions keep running -- subscribers upgrade when they're ready.
The Simple Case
{
"version": "1.0.0"
}Change it to 1.1.0, push, and mctx deploys a new version. Both 1.0.0 and 1.1.0 are live at the same time:
https://weather-api.mctx.ai/v1.0.0 (still running)
https://weather-api.mctx.ai/v1.1.0 (just deployed)Every version gets its own URL, its own worker, and its own environment variables. Subscribers on v1.0.0 are completely unaffected by your v1.1.0 deploy.
How mctx Detects New Versions
mctx watches your repository. When you push:
- GitHub sends a webhook to mctx
- mctx reads the
versionfield from yourpackage.json - If the version is new, deployment starts automatically
- If the version already exists, nothing happens
The key rule: no version bump, no deployment. You can push code changes all day, but if package.json still says 1.0.0, mctx won't redeploy.
Semantic Versioning
mctx uses semver. Here's when to bump each number:
| Bump | When | Example | Subscribers should... |
|---|---|---|---|
| PATCH | Bug fix, no API changes | 1.0.0 to 1.0.1 | Update immediately |
| MINOR | New feature, backward compatible | 1.0.0 to 1.1.0 | Review, generally safe |
| MAJOR | Breaking change, incompatible API | 1.0.0 to 2.0.0 | Check carefully |
Pre-release Versions
Testing something before a full release? Use pre-release tags:
{
"version": "2.0.0-beta.1"
}Pre-release versions deploy and get their own URL just like any other version. They're useful for letting a few subscribers test breaking changes before you commit to them.
Valid pre-release examples: 1.0.0-alpha, 1.0.0-beta.1, 1.0.0-rc.2
What Makes a Valid Version
| Format | Valid | Why |
|---|---|---|
1.0.0 | Yes | Standard release |
2.1.3 | Yes | Standard release |
1.0.0-beta.1 | Yes | Pre-release |
1.0.0-rc.2+build.456 | Yes | Pre-release + build metadata |
1.0 | No | Missing PATCH number |
v1.0.0 | No | No v prefix allowed |
1.0.0.0 | No | Too many components |
Running Multiple Versions
All your deployed versions run at the same time. Each one is an independent Cloudflare Worker with its own URL, environment variables, and isolated state.
A typical server might look like this:
| Version | Status | What it's for |
|---|---|---|
1.0.0 | Live | Stable, most subscribers |
1.1.0 | Live | Early adopters |
2.0.0-beta.1 | Live | Beta testers |
Subscribers pick their version when they subscribe. By default, they use the versionless URL and always connect to your latest deployed version automatically.
Version Modes
mctx supports four URL patterns, giving subscribers control over how much auto-upgrade risk they accept.
| URL Pattern | Example | Resolution | Auto-upgrade scope |
|---|---|---|---|
| Versionless | https://weather-api.mctx.ai | Latest deployed version | Every deploy — always on latest |
| Major | https://weather-api.mctx.ai/v1 | Latest 1.x.x version | Minor and patch releases |
| Minor | https://weather-api.mctx.ai/v1.2 | Latest 1.2.x version | Patch releases only |
| Exact | https://weather-api.mctx.ai/v1.2.3 | Version 1.2.3 exactly | Never — pinned |
Versionless URL (recommended default)
The versionless URL has no version segment at all:
https://weather-api.mctx.aiWhen a subscriber connects, the dispatch worker resolves to the latest version you have deployed and routes the session there. If you deploy a new version later, new sessions connect to the new version automatically. Existing sessions stay on the version they resolved to when they connected.
This is the recommended default for most subscribers. It removes the need to update configuration after every deploy.
Partial version specifiers
Partial specifiers let subscribers pin to a compatibility tier while still receiving updates within that tier.
https://weather-api.mctx.ai/v1 # Latest 1.x.x
https://weather-api.mctx.ai/v1.2 # Latest 1.2.xThese are useful when a subscriber wants patch fixes automatically but wants to review minor or major releases first.
Exact version URL
The exact URL (/v1.2.3) is the most conservative option. The session always connects to that specific version, regardless of what you deploy afterward.
https://weather-api.mctx.ai/v1.2.3 # Always version 1.2.3Session behavior
Once a session is established, the connection stays on the resolved version for the lifetime of that session. If you deploy a new version while a subscriber is connected, their current session is unaffected.
To connect to a newer version, the subscriber must start a new session. With most MCP clients, this means removing and re-adding the server, or using the client's reconnect option.
Mid-session deploys with partial specifiers: If a subscriber uses /v1 and you deploy 1.3.0 while they have an active session, their current session remains on whatever version it resolved to when it connected. The new version becomes available on the next new session.
Deprecating a Version
When you want subscribers to move off an old version:
- Go to your server detail page
- Select the version from Version History
- Click Mark as Deprecated
- Optionally add a message explaining why
The version keeps working, but subscribers see a deprecation notice on your server info page. This is the polite way to signal "please upgrade" without breaking anyone.
Removing a Version
When a version has served its purpose:
- Go to your server detail page
- Select the version
- Click Delete Version
The version's worker gets deleted, its endpoint returns 404, and subscribers on that version lose access. Always deprecate first to give people time to migrate.
Checking Available Versions
Your server info page at {slug}.mctx.ai lists all live versions, their endpoints, and any deprecation notices.
The version dropdown on the server info page lets visitors select a version and copy the installation instructions for it.
The MCP initialize response includes the version, so clients always know what they're connected to:
{
"jsonrpc": "2.0",
"result": {
"serverInfo": {
"name": "Weather API",
"version": "1.0.0"
},
"capabilities": {}
},
"id": 1
}Troubleshooting
I pushed code but nothing deployed
mctx only deploys when the version number changes. Bump the version field in package.json and push again.
Version Not Found (404)
{
"error": {
"code": -32001,
"message": "Version not found",
"data": {
"requestedVersion": "1.0.0",
"availableVersions": ["1.1.0", "2.0.0"]
}
}
}The version was never deployed, was already removed, or has a typo. Check your server info page for available versions.
Deployment failed
Check the deploy logs in your dashboard. Common causes:
- Invalid
package.json(run validation locally first) - Main file doesn't exist at the specified path
- Syntax error in your worker code
- Missing required environment variable
Limits
| Limit | Value |
|---|---|
| Version string length | 50 characters |
| Minimum time between deployments | 1 second |
Reasonable limits on concurrent live versions apply. If you need to discuss specific scale requirements, contact support.
See Also
- package.json Configuration - Where the version field lives
See something wrong? Report it or suggest an improvement — your feedback helps make these docs better.