mirror of
https://github.com/coder/coder.git
synced 2026-09-01 14:53:15 +08:00
73cd34cc5f
The MCP Registry rejects our `server.json` remote because the URL uses
`{coder_url}` as the entire base. Registry validation requires remote
URLs to literally begin with `https://`, and template variables are only
allowed after the scheme/host. The previous value
(`{coder_url}/api/experimental/mcp/http`) fails both the JSON schema
`^https?://[^\s]+$` pattern and the semantic remote-URL check.
## Changes
- Use `https://{coder_hostname}/api/experimental/mcp/http` with a
`coder_hostname` variable (users now enter a hostname like
`coder.example.com` instead of a full URL).
- Update the VS Code registry instructions in
`docs/ai-coder/mcp-server.md` to ask for the deployment hostname.
Verified with `mcp-publisher validate` against
`registry.modelcontextprotocol.io`:
```
Validating against https://registry.modelcontextprotocol.io...
✅ server.json is valid
```
This was caught by running the `Publish to MCP Registry` workflow in
validate-only mode (`publish: false`) before any real publish, so
nothing broken reached the public registry.
<details>
<summary>Root cause detail</summary>
The registry validator (`internal/validators`) substitutes known
template variables, then parses the URL. Because `{coder_url}` replaces
the whole scheme+host, the parsed URL has no scheme and is rejected as
an invalid remote URL. Hard-coding `https://` and scoping the variable
to the host satisfies both the schema pattern and `IsValidRemoteURL`
(which also requires `https`). The registry mandates `https` for remotes
regardless, so there is no loss of functionality.
</details>
---
_Generated with Coder Agents._
48 lines
1.3 KiB
JSON
48 lines
1.3 KiB
JSON
{
|
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
"name": "io.github.coder/coder",
|
|
"title": "Coder",
|
|
"description": "Manage Coder workspaces, templates, and cloud development environments",
|
|
"repository": {
|
|
"url": "https://github.com/coder/coder",
|
|
"source": "github"
|
|
},
|
|
"version": "0.0.0-dev",
|
|
"websiteUrl": "https://coder.com/docs",
|
|
"icons": [
|
|
{
|
|
"src": "https://raw.githubusercontent.com/coder/coder/main/docs/images/logo-black.png",
|
|
"mimeType": "image/png"
|
|
}
|
|
],
|
|
"remotes": [
|
|
{
|
|
"type": "streamable-http",
|
|
"url": "https://{coder_hostname}/api/experimental/mcp/http",
|
|
"variables": {
|
|
"coder_hostname": {
|
|
"description": "Hostname of your Coder deployment (e.g., coder.example.com)",
|
|
"isRequired": true,
|
|
"format": "string",
|
|
"placeholder": "coder.example.com"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"_meta": {
|
|
"io.modelcontextprotocol.registry/publisher-provided": {
|
|
"documentation": "https://coder.com/docs/ai-coder/mcp-server",
|
|
"keywords": [
|
|
"workspaces",
|
|
"cloud-development",
|
|
"templates",
|
|
"devcontainers",
|
|
"terraform",
|
|
"self-hosted"
|
|
],
|
|
"license": "AGPL-3.0",
|
|
"publisher": "Coder"
|
|
}
|
|
}
|
|
}
|