mctx.json Reference
Complete schema reference for the mctx.json configuration file. Defines version, description, entrypoint, and optional metadata fields.
The mctx.json file configures your MCP server for deployment on mctx. It follows the official MCP server manifest specification with an additional entrypoint field.
File Location
Place mctx.json in your repository root or in a subdirectory for monorepos.
Single-package repository:
my-mcp-server/
├── src/
├── dist/
├── mctx.json # Root level
└── package.jsonMonorepo:
my-monorepo/
├── packages/
│ └── my-mcp-server/
│ ├── mctx.json # Package level
│ ├── src/
│ └── dist/
└── package.jsonWhen deploying from a monorepo, specify the package path in the deployment form (e.g., packages/my-mcp-server).
Schema Reference
Required Fields
| Field | Type | Description | Constraints |
|---|---|---|---|
version | string | Semantic version number | Must follow semver format |
description | string | What your server does | 1-500 characters |
entrypoint | string | Path to built JavaScript file from mctx.json | .js or .mjs file, must exist |
Optional Fields
| Field | Type | Description | Constraints |
|---|---|---|---|
name | string | Display name suggestion | Can be overridden |
instructions | string | Instructions for AI models using your server | Maximum 2000 chars |
capabilities | object | MCP protocol capability declarations | See below |
Version Field
Format: Semantic versioning (MAJOR.MINOR.PATCH[-PRERELEASE][+BUILD])
Examples:
1.0.0- Production release1.1.0- New feature, backward compatible1.0.1- Bug fix2.0.0- Breaking changes1.0.0-beta.1- Pre-release version1.0.0-rc.1+20130313144700- Release candidate with build metadata
Validation:
- Must be a valid semver string
- Must be unique per deployment (cannot redeploy same version)
- Case-sensitive
Version Detection:
mctx detects new versions by comparing the version field in mctx.json against deployed versions. Changes to your code without a version bump will not trigger deployment.
Description Field
Purpose: Displayed on server info pages and in the MCP Community Registry.
Best Practices:
- Start with a verb ("Get", "Search", "Query", "Generate")
- Be specific about what makes your server unique
- Keep under 200 characters for optimal display
- Avoid marketing language
Good Examples:
- "Query financial data from SEC filings with natural language"
- "Get real-time weather forecasts for any location worldwide"
- "Search documentation across 50+ programming languages"
Bad Examples:
- "A server that does things with data" (too vague)
- "The best, most amazing tool ever created!" (marketing fluff)
- "Server for stuff" (not descriptive)
Entrypoint Field
Path: Relative to the location of mctx.json.
Requirements:
- Must be a
.jsor.mjsfile - Must exist in the repository (committed or CI-generated)
- Must export a default handler compatible with Cloudflare Workers
Common Patterns:
| Build Tool | Typical Entrypoint |
|---|---|
| esbuild | dist/index.js |
| tsc | dist/index.js |
| Rollup | build/index.js |
| unbuild | .output/index.mjs |
| Webpack | dist/main.js |
Handler Format:
export default {
async fetch(request: Request, env: Env): Promise<Response> {
// Handle MCP JSON-RPC requests
},
};Name Field
Optional. Suggested display name shown in the dashboard when you first deploy. You can override this in the server settings.
If omitted, mctx derives a name from your repository name.
Instructions Field
Optional. Provides context to AI models about how to use your server effectively.
Purpose:
- Explain tool purposes briefly
- Mention expected input formats
- Note limitations or special behavior
Maximum Length: 2000 characters
Example:
{
"instructions": "Use 'search_docs' to find documentation pages. Use 'get_page' with a URL to retrieve specific content. Results are markdown-formatted. The search is case-insensitive and supports partial matches."
}Capabilities Field
Optional. Declares which MCP protocol features your server supports.
Important: This is protocol-level capability negotiation only. It does NOT define your tools, resources, or prompts. Those are discovered via tools/list, resources/list, and prompts/list handlers in your code.
Capability Schema
{
"capabilities": {
"tools": {
"listChanged": boolean
},
"resources": {
"subscribe": boolean,
"listChanged": boolean
},
"prompts": {
"listChanged": boolean
}
}
}Capability Flags
| Flag | Description |
|---|---|
tools.listChanged | Server may send notifications/tools/list_changed |
resources.subscribe | Server supports resource subscriptions |
resources.listChanged | Server may send notifications/resources/list_changed |
prompts.listChanged | Server may send notifications/prompts/list_changed |
Default Capabilities
If capabilities is omitted, defaults to:
{
"capabilities": {
"tools": {}
}
}Common Configurations
Tools-only server:
{
"capabilities": {
"tools": {}
}
}Static resources:
{
"capabilities": {
"resources": {}
}
}Dynamic resources with subscriptions:
{
"capabilities": {
"resources": {
"subscribe": true,
"listChanged": true
}
}
}Minimal Example
{
"version": "1.0.0",
"description": "Get real-time weather data for any location",
"entrypoint": "dist/index.js"
}Full Example
{
"name": "Weather API",
"version": "1.0.0",
"description": "Get real-time weather data for any location worldwide using OpenWeatherMap",
"entrypoint": "dist/index.js",
"instructions": "Use 'get_weather' for current conditions. Use 'get_forecast' for 5-day predictions. Provide city name or coordinates. All temperatures are in Celsius.",
"capabilities": {
"tools": {
"listChanged": false
}
}
}Validation Rules
mctx validates mctx.json when you:
- Select a repository in the deployment form
- Push changes to your branch (webhook triggers validation)
Common Validation Errors
| Error | Cause | Solution |
|---|---|---|
| "mctx.json not found" | File missing or wrong location | Add file to repository root or specified path |
| "Invalid version format" | Version doesn't follow semver | Use format MAJOR.MINOR.PATCH |
| "Version already deployed" | Version number not bumped | Increment version before pushing |
| "Entrypoint file not found" | File doesn't exist at specified path | Check path is relative to mctx.json |
| "Description too long" | Exceeds 500 characters | Shorten description |
| "Invalid JSON" | Syntax error in file | Validate JSON syntax |
Platform-Managed Initialization
mctx intercepts MCP initialize requests and responds using your mctx.json configuration. Your server code does NOT need to handle initialize.
Initialize Response Fields:
serverInfo.name- From dashboard server name (notmctx.jsonname)serverInfo.version- Frommctx.jsonversion fieldcapabilities- Frommctx.jsoncapabilities fieldinstructions- Frommctx.jsoninstructions field
What You Implement:
Your server only handles business logic:
tools/listtools/callresources/list(if applicable)resources/read(if applicable)prompts/list(if applicable)prompts/get(if applicable)
See Also
- Environment Variables - Secrets and configuration
- Versioning - How versions work
- Server Requirements - Server code structure
See something wrong? Report it or suggest an improvement — your feedback helps make these docs better.