翻篇收录说明
翻篇网页快照

Hosted MCP servers | Kadmo Docs

https://docs.kadmo.ai/mcp/hosted-servers

最近抓取:2026-12-03 14:30:27(北京时间)

最近内容变化:2026-12-03 14:30:27(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

Documentation for Kadmo: the app at app.kadmo.ai, agents, workflows, skill packs, integrations, MCP and the Kadmo provider

正文摘录

Hosted MCP servers ​Kadmo can run an MCP server of your own. Put the server and a manifest, kadmo-mcp.json, in a repository of a workspace project, attach it, and Kadmo builds it, runs it and redeploys it on every push. It answers at its own address, behind the same sign-in as Kadmo's MCP server:texthttps://mcp.kadmo.ai/<account slug>/<server slug>An Admin attaches a server and sets its environment. The members of your account connect to it from their clients; nobody outside the account can. Your server is told who is calling in every request, and never receives the member's Kadmo token. It can ask Kadmo for a GitHub token narrowed to one repository its manifest names, so it holds no GitHub credential of its own.The Kadmo admin MCP, which writes and publishes Kadmo's own blog, is such a server, and runs exactly as this page describes.What to put in the repository ​A Node.js 22 project with the manifest at the repository's root:textyour-repository/ ├── kadmo-mcp.json the manifest (below) ├── package.json ├── package-lock.json npm ci installs from it ├── src/ your server's source └── dist/ what the build writes and the start command runs (not committed)The server Kadmo can run:It mustWhySpeak MCP's Streamable HTTP transport on the manifest's path (default /mcp)The address forwards to that path. Nothing below the address is servedBe stateless: answer every POST on its own, with no session to resumeA redeploy replaces the running copy. A stateless server answers GET and DELETE with 405Listen on the port in PORT (default 8000) on every interfaceThe address reaches the server over the cluster's network, never over loopbackAnswer 200 on the manifest's health path once it can take callsA new copy takes traffic only when it is ready; without health, an open port counts as readyStop when it receives SIGTERMA redeploy stops the old copy that wayRead the caller from the identity headersSee What your server receivesKeep nothing it needs on diskOnly the app directory (your built code) and /tmp are writable, and nothing written there at run time reaches another copyThe MCP TypeScript SDK has a stateless Streamable HTTP mode that does all of this. The runtime is Node.js 22, with npm.The manifest ​kadmo-mcp.json says how to build and start the server and what it needs. An example, with the schema line most editors use for completion and checking:json{ "$schema": "https://docs.kadmo.ai/schemas/kadmo-mcp.json", "name": "content", "runtime": "node22", "install": "npm ci", "build": "npm run build", "start": "node dist/server.js", "port": 8000, "path": "/mcp", "health": "/healthz", "repositories": [ { "repo": "acme/website", "permissions": { "contents": "write" } } ], "env": ["CMS_API_KEY"] }FieldRequiredWhat it saysDefault$schemanoThe schema's address, for your editor—namenoA name for people, 1 to 64 characters—runtimeyesnode22, the one runtime—rootnoThe directory inside the repository to build and run fromthe project's app dir, else the repository's rootinstallnoThe install command, one linenonebuildnoThe build command, one linenonestartyesThe command that starts the server, one line—portnoThe port the server listens on, 1024 to 655358000pathnoThe path MCP answers on, starting with //mcphealthnoA path that answers 200 once the server is readynonerepositoriesnoUp to 20 repositories the server works on, each owner/name with the permissions it needs: contents, pull_requests, issues, each read or writenoneenvnoUp to 64 names of environment variables the server reads; an Admin sets their valuesnoneCommands run from root, with the shell. Every copy fetches, installs and builds before start runs, and a copy that restarts does so again, so keep install and build repeatable.The JSON Schema is published at https://docs.kadmo.ai/schemas/kadmo-mcp.json. It catches an unknown key, a missing field and a wrong type in your editor. Kadmo checks the manifest again when you attach the server and on every deploy, with rules the schema cannot carry:RuleRefused asThe file is a JSON object of at most 64 KiB, named kadmo-mcp.json, at the repository's rootmanifest_invalidroot is a relative directory inside the repository, without . or .. segmentsmanifest_invalidinstall, build and start are one line each, at most 500 charactersmanifest_invalidAn env name is capitals, digits and _, starts with a capital, and is never PORT or a KADMO_ name (Kadmo sets those)manifest_invalidNo env name and no repository is listed twicemanifest_invalidEach repository asks for at least one permissionmanifest_invalidYour account's GitHub App installation covers every repository listedcredential_missing, naming the repositoriesA refusal names the field and the fault, for example kadmo-mcp.json is invalid: start: required — the command that starts the server or env.0: PORT and KADMO_ names are set by Kadmo itself.Attaching the server ​A server belongs to one project of a workspace: a GitHub repository the account can read, or the workspace's Kadmo Git repository. On the workspace's Code & files tab, an Admin opens the project's row and chooses MCP server:Attach: give the server a slug and choose who may use it. Kadmo reads kadmo-mcp.json at the head of the project's default branch (or the branch you name) and checks it and the repositories it lists. Nothing runs yet.Environment: set a value for every name in the manifest's env. Values are write-only: the page lists the names, who set each and when, never a value.Deploy now: Kadmo builds the branch's head and starts the server. Its address answers once the first deployment is live.SettingRuleSlug1 to 40 characters of a–z, 0–9 and -, starting with a letter or digit; one per server in the account. It is part of the address and of every client's sign-in, so it is locked while the server is live or a deployment is under way: Stop the server to change itWho may use itmembers (every member of the account) or admins (the account's Admins only)BranchThe project's default branch unless you name anotherEnvironment valuesAt most 32 KiB each and 512 KiB in allA member sees the row and the server's page read-only. A repository on GitHub needs the account's GitHub App installation to cover it, or the account's own token to read it (see Code hosting); every repository the manifest lists needs the installation.What your server receives ​Every request that reaches your server has passed Kadmo's sign-in. Kadmo removes the client's Authorization and Cookie headers and sets these:HeaderValueKadmo-User-IdThe member's id, a numberKadmo-User-EmailThe member's email addressKadmo-User-NameThe member's display name; may be emptyKadmo-Account-IdThe account's id, a numberKadmo-Account-SlugThe account's slugKadmo-Roleadmin or memberKadmo-ClientThe OAuth client's name, or personal_token, or login_token (the API token that kadmo login stores)Kadmo-ServerYour server's slugKadmo-AssertionThe same facts, signed (below)A name, an email address or a client's name outside printable ASCII arrives encoded as UTF-8'' followed by the percent-encoded UTF-8 bytes (RFC 8187). A client cannot set any Kadmo- header: a request that carries one is refused before it reaches you.Use Kadmo-Role to gate your tools: leave the admin tools out of a member's tools/list, and answer a member's direct call to one with a refusal of your own. Refuse with 401 a request that has no Kadmo-User-Id, Kadmo-Account-Id or Kadmo-Role.The assertion ​Kadmo-Assertion is a JWT signed with HS256 over your server's own secret, KADMO_GATEWAY_SECRET. Its claims, for a member Ada of the account acme calling the server content from Claude Code:json{ "iss": "https://app.kadmo.ai", "aud": "https://mcp.kadmo.ai/acme/content", "sub": "1042", "email": "ada@acme.example", "name": "Ada Lovelace", "account_id": "17", "account_slug": "acme", "role": "member", "client": "Claude Code", "server": "content", "iat": 1793000000, "exp": 1793000120, "jti": "5b0c9a6e-2f4d-4e1b-9a37-0c1d2e3f4a5b" }To trust it, check that:it is HS256 and its signature verifies with KADMO_GATEWAY_SECRET (the secret's UTF-8 bytes);aud is your address, KADMO_PUBLIC_URL;iss is the origin of KADMO_API_URL;it has not expired: an assertion holds for 120 seconds;it has a jti;sub, account_id and role match Kadmo-User-Id, Kadmo-Account-Id and Kadmo-Role.The headers alone can be trusted too: nothing but Kadmo's gateway can reach your server. The assertion is for a server that wants proof rather than the network's word.The environment ​NameWhatPORTThe port to listen on: the manifest's portKADMO_SERVERYour server's slugKADMO_ACCOUNTYour account's slugKADMO_PUBLIC_URLYour server's address, the assertion's audKADMO_API_URLKadmo's app, https://app.kadmo.ai: the doors' host, and its origin is the assertion's issKADMO_SERVER_TOKENYour server's token for the doors (below)KADMO_GATEWAY_SECRETThe assertion's secretKADMO_COMMITThe commit this copy runsyour env namesThe values an Admin setNODE_ENV is not set, so npm ci installs your devDependencies for the build. HOME is /tmp. Never print KADMO_SERVER_TOKEN, KADMO_GATEWAY_SECRET or a value of your own.The two doors ​Your server calls Kadmo with its server token, KADMO_SERVER_TOKEN, as the bearer. The token names your server and nothing else: it opens these two doors, and no other part of Kadmo accepts it.DoorWho calls itThe source door, GET $KADMO_API_URL/api/mcp-servers/<server>/source?commit=<sha>Kadmo's build step, to fetch your code at the commit it deploys. Your server never needs itThe GitHub-token door, GET $KADMO_API_URL/api/mcp-servers/<server>/github-token?repo=<owner/name>Your server, for a token to one repository its manifest lists<server> is your server's slug, KADMO_SERVER.A GitHub token for one repository ​bashcurl -s -H "Authorization: Bearer $KADMO_SERVER_TOKEN" \ "$KADMO_API_URL/api/mcp-servers/$KADMO_SERVER/github-token?repo=acme/website"The answer is an installation token of your account's GitHub App, narrowed to that repository and to the permissions the manifest gives it:json{ "token": "<an ins