Concepts
Configuration Files
There are two required configuration files that tell Smithery how to build and run your server:- Dockerfile: Defines how to build your server’s container image
- smithery.yaml: Specifies how to start and run your server
Automatic Setup
Smithery will attempt to automatically generate a pull-request with these files when you trigger a deployment. However, in some cases, the setup can fail and you may need to set this up manually.Required Files
Dockerfile
The Dockerfile tells us how to build your server. It should be placed in the root of your project or in the subdirectory containing your MCP server.smithery.yaml
The smithery.yaml file tells us how to deploy your server. It should be placed alongside your Dockerfile.Project Structure
Subdirectories
If your package is not in the root directory of your repository (in the case of a monorepo), you should place your Dockerfile andsmithery.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:
- 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. Please ensure your Dockerfile builds locally first before deploying.
- 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