mcpmanager/self-host base image, and the deployed container enrolls itself with MCP Manager. When enrollment succeeds the server appears as connected, with its tools learned, and it is assigned to gateways like any other server.
MCP Manager never runs your server on its own hardware and never holds a credential for your hosting account. The deployment lands in infrastructure you own, and you pay the provider for it. The result is a managed server instance with one instance inside it; MCP Manager reaches it over HTTPS with a per-server access token, exactly as it reaches any managed server.
Why the wizard deploys to Railway
The wizard targets Railway because it meets three requirements at once, and every other provider evaluated fell short on at least one of them:- A free way to start. Railway’s Free plan and no-card Free Trial mean the first deployment costs nothing until usage passes the free allowance, so you can prove the server works before committing to a plan.
- Cost that tracks actual use. Railway bills per second for the CPU, memory, volume, and egress a service consumes, so a small MCP server that sits idle between calls stays cheap; you pay for the compute you use rather than for a machine.
- A CLI an agent can drive end to end. Creating the project and service, setting environment variables, generating the public domain, deploying, reading logs, and later deleting the service are all
railwaycommands. That is what lets a coding agent do the whole setup, and the whole teardown, from one prompt without you touching a dashboard.
Where guided self-hosting starts
The Help me host my MCP server wizard opens from two places in MCP Servers:- Add server → the “Need your own MCP server?” callout. Beside the Remote, Managed, and Workstation choices, a callout reads “We’ll guide you through a quick setup.” Its Set up now button opens the wizard.
- Add a Remote server → the URL step. The link Help me connect and host my MCP server opens the wizard for someone who arrived expecting to paste a URL and has none yet.
How the wizard flow works
The wizard has five screens. Deployment itself happens outside MCP Manager, in your coding agent and on Railway; the wizard’s job is to hand your agent everything it needs and then wait for the server to connect.Choose how your server is built
Connect your repository
https:// URL with no username or password embedded in it. For a public repository, MCP Manager runs an advisory reachability check and shows an inline note if the repository looks private, missing, or unreachable. The note is advice only: Continue stays enabled whatever it says, because your agent clones from your machine with your credentials.Deploy your server
Connecting your server
Server connected
What the generated prompt makes your coding agent do
The prompt is a complete, self-contained instruction set for an autonomous coding agent. It authenticates to Railway as you, on your machine, so MCP Manager is never in the loop. In order, the agent:- Installs the Railway CLI if it is missing and logs in with
railway login, pausing to tell you when the login needs your approval in a browser. - Clones your repository. If the repository holds more than one MCP server, the agent must stop and ask you which to deploy rather than guess.
- Writes a Dockerfile whose final stage builds on
mcpmanager/self-host:0.1, copies your built server in, and setsMCPM_START_COMMANDto the command that starts your server over stdio. The base image’s entrypoint runs MCP Manager’s authentication and enrollment layer, so the agent never overrides it. - Creates a Railway project and service, and generates the public domain before the first deploy, because the container reads its own public URL from the domain Railway injects.
- Sets two environment variables:
MCPM_REGISTRATION_TOKEN, which the container redeems once to enroll, andMCPM_ACCESS_TOKEN, which MCP Manager sends on every request. - Deploys with
railway up. Railway builds the image, so Docker is not needed on your machine. - Confirms enrollment by reading the runtime logs for
Enrollment succeeded, then reports the domain to you.
How the deployed server enrolls and connects
Enrollment is what turns a running container into a connected MCP Manager server. The container does it on its own at boot, with no action from you. In prose: the wizard asks MCP Manager to provision the server, receiving a short-lived registration token and the long-lived access token, and builds the prompt around them. Your agent deploys to Railway. On boot, the container starts your MCP server, performs an MCPinitialize against it to confirm it answers and to capture its name and version, then posts the registration token, its public URL, and that server info to MCP Manager’s enroll endpoint. MCP Manager verifies the token, records the URL, adopts the name your server reported, and runs its own MCP initialize against the new URL with the access token. Only when that succeeds does the server become connected and its tools get learned.
The mcpmanager/self-host image is public on Docker Hub and provides three things around your server: an authentication layer on the container’s public port that requires the mcpm-access-token header on every request, a stdio-to-HTTP bridge that starts your server from MCPM_START_COMMAND and speaks Streamable HTTP on /mcp, and the enrollment step above. The access token authenticates callers to your container; it grants nothing on MCP Manager, which stores its copy encrypted at rest and sends it on every proxied request, the same model as the shared secret on any managed server.
Finishing or resuming an interrupted setup
A self-hosted server exists in MCP Manager from the moment you reach the Deploy step, before anything has been deployed. Until the container enrolls, its instance shows Awaiting enrollment as its credential status and Pending as its authentication type and URL, and it cannot be selected when a user connects a client through a gateway. If you closed the wizard before your agent finished, or the deployment never enrolled, MCP Manager offers the way back into the same instance rather than a second one:- On the server’s Overview tab, a Finish setting up this server callout explains the state. Its Finish setup button reopens the wizard on that exact instance; when the server has no instance at all, the button reads Setup instance.
- On the Instances tab, the header Setup instance button appears while nothing inside the server has enrolled, and each awaiting row has its own Finish setup action.
Deleting a self-hosted server
Deleting a self-hosted server in MCP Manager removes MCP Manager’s record of it and stops every gateway from reaching it. It does not stop the container on Railway, because MCP Manager holds no credential for your account. The delete confirmation says so, and once the delete has landed MCP Manager offers a teardown prompt for your coding agent that names the deployment’s URL, has the agent find exactly the matching Railway service, show you the list it is about to delete, wait for your explicit confirmation, delete only those services, and verify each URL no longer responds. If you tear down on Railway first, MCP Manager does not notice on its own; delete the server in MCP Manager too, or it keeps pointing at a URL that no longer answers.Troubleshooting
Most setups finish without touching any of this. When one does not, the symptom you see in MCP Manager or in Railway’s logs points at one of the cases below.The server stays on Awaiting enrollment
The server stays on Awaiting enrollment
Enrollment succeededmeans the container enrolled. If MCP Manager still shows the server as awaiting, wait for verification to finish or reopen the wizard from the server’s Overview tab.Enrollment is NOT configuredmeansMCPM_REGISTRATION_TOKENor the public domain is missing. The container reads its own public URL from the domain Railway injects, so a service whose domain was generated after the first deploy cannot enroll until it is redeployed.- No enrollment line at all usually means the build failed or the container is crashing before it reaches enrollment. Check the build logs and
MCPM_START_COMMAND.
The registration token expired
The registration token expired
Enrolled, but MCP Manager says the server didn't respond like an MCP server
Enrolled, but MCP Manager says the server didn't respond like an MCP server
MCPM_START_COMMAND starts the wrong thing, or when your server speaks a transport other than stdio. Fix the command or the repository, redeploy, and press Try again in the wizard.Requests to the container return 401 or 403
Requests to the container return 401 or 403
The logs show 410 on every restart
The logs show 410 on every restart
MCPM_ACCESS_TOKEN in the service’s environment is the copy that survives. The container serves authenticated traffic again as soon as it is back.The public URL was rejected
The public URL was rejected
https://, carry no embedded credentials, and must not be a loopback, private, link-local, or cloud-metadata address. A Railway-generated domain passes all of these; a custom domain that is not yet serving HTTPS does not. The MCP endpoint is the domain plus /mcp.The server needs Python, another runtime, or more memory
The server needs Python, another runtime, or more memory
FROM mcpmanager/self-host:0.1, and Railway’s builder rejects BuildKit cache mounts, so the prompt forbids them.Memory is the other thing to size for: the wrapper itself uses roughly 80 MB, each MCP session adds a child process of your server, and a server that loads a model or an embedding index can need 2 GB or more, which is beyond Railway’s smallest plans. Out-of-memory kills show up in Railway’s logs and as tools that stop responding.The image is pinned to a minor version tag (0.1), so a rebuild picks up patch fixes to the wrapper without changing your Dockerfile; the wizard never emits latest.A retry left a second Railway service, or the server was torn down on Railway first
A retry left a second Railway service, or the server was torn down on Railway first
mcpm- followed by an identifier derived from the server’s ID) before creating one, and stops to ask you if it finds more than one candidate. If a second service exists anyway, delete the extra one in Railway; only the one whose domain MCP Manager holds is reached.Deleting a self-hosted server in MCP Manager removes the instance inside it as well and offers a teardown prompt for every deployment that had a URL. If you tore down on Railway first, delete the server in MCP Manager too, or it keeps pointing at a URL that no longer answers. Once the instance is live there is nothing to add; replacing it means deleting it and setting up again.Tools stopped responding after the server was connected
Tools stopped responding after the server was connected
The repository check said the repository looks private or unreachable
The repository check said the repository looks private or unreachable

