Configuration
Required Files
There are two files required in your repository in order to deploy:
The Dockerfile tells us how to build your server. The smithery.yaml file tells us how to start your server.
Automatic Setup
Smithery automatically generates a pull-request with these files for you based on your repository structure.
To obtain an automated pull-request:
- Go to your deployments tab on your server page
- Click "Deploy"
You will see a dialog show up with the option to generate a pull-request. Click "Generate Pull Request" and Smithery will generate a pull-request for you.
Manual Setup
Dockerfile
Create a Dockerfile
in your repository root that defines how to build your MCP server. Your Dockerfile should be created such that running your Docker image will start your STDIO server.
Here's an example Dockerfile that builds a Node-based MCP server:
We only support Linux Docker images on major distros (Alpine/Debian-based) and expect sh
to run in your container. Other distros are untested and may not deploy.
You can find more examples of Dockerfiles in MCP's official reference implementations.
smithery.yaml
Create a smithery.yaml
file in your repository root. This file defines how your MCP server should be started.
Here's a minimal example of a server with no configuration options:
The startCommand
object consists of:
type: stdio
: Specifies that your repository is a standard I/O based MCP serverconfigSchema
: Defines the JSON Schema for your server's configuration options. Users will configure this your server using this schema. We will reject invalid configurations.commandFunction
: A JavaScript function that returns the command, arguments and environment variables required to start your server. This function is run within your server's sandbox during runtime to parse the config specified by clients. You can trust thatconfig
input argument conforms to yourconfigSchema
.
Optional configuration:
build
: Object containing build configuration:dockerfile
(optional): Path to Dockerfile, relative to this config filedockerBuildPath
(optional): Path to docker build context, relative to this config file
Subdirectories
If your package is not in the root directory of your repository (in the case of a monorepo), you should place your Dockerfile and smithery.yaml
in the subdirectory that contains your package. You will need to specify the base directory in your server settings on Smithery.
For example, if your MCP server is in the packages/mcp-server
directory, you would:
- Place your
Dockerfile
andsmithery.yaml
in thepackages/mcp-server
directory - Set the base directory to
packages/mcp-server
in your server settings under Github integration
Best Practices
- Testing: Test your MCP server locally before deploying using MCP Inspector.
- Configuration: Use the
configSchema
to properly define and validate your server's configuration options - Docker Optimization: Keep your Docker image size minimal by using appropriate base images and multi-stage builds