Overview
Deploy TypeScript MCP servers using the official MCP SDK with two deployment options:- Remote deployment: Automatic containerization and infrastructure managed by Smithery
- Local servers (Beta): Distribute your server as MCP bundle allowing users to run it locally and one-click install it
Prerequisites
- TypeScript MCP server using the official MCP SDK that exports the MCP server object at entry point
- Node.js 18+ and npm installed locally
- Smithery CLI installed as a dev dependency (
npm i -D @smithery/cli)
New to MCP servers? See the Getting Started guide to learn how to build TypeScript MCP servers from scratch using the official SDK.
Project Structure
Your TypeScript project should look like this:Setup
1. Configure smithery.yaml
Create asmithery.yaml file in your repository root (usually where the package.json is): Remote Deployment (Default)
Local Server (Beta)
Local servers are in beta - When you set
target: "local", your server runs locally on user’s machine but is accessible through Smithery’s registry for easy discovery and connection by MCP clients.2. Configure package.json
Yourpackage.json must include the module field pointing to your server entry point: Install the CLI locally with:The Smithery CLI externalizes your SDKs during bundling so your runtime uses the versions you install. If you see a warning about missing SDKs, add them to your dependencies (most servers need
@modelcontextprotocol/sdk and @smithery/sdk).3. Ensure Proper Server Structure
Your TypeScript MCP server must export a defaultcreateServer function that returns the MCP server object. If you built your server following the Getting Started guide, it should already have this structure. configSchema: configSchema from the same file as your createServer function (typically src/index.ts). What it does: Automatically generates session configuration forms for users connecting to your server. OAuth
OAuth is designed only for remote servers and is in beta. OAuth is not available for local servers (
target: "local").oauth, Smithery CLI auto-mounts the required OAuth endpoints for you during remote deployment. Export an OAuth provider
oauth and injects the auth routes automatically. Local Development
Test your server locally using the Smithery CLI:- Test your MCP server tools in real-time
- See tool responses and debug issues
- Validate your configuration schema
- Experiment with different inputs
Advanced Build Configuration
For advanced use cases, you can customize the build process using asmithery.config.js file. This is useful for: - Marking packages as external (to avoid bundling issues)
- Configuring minification, targets, and other build options
- Adding custom esbuild plugins
Configuration File
Createsmithery.config.js in your project root: Common Use Cases
External Dependencies: If you encounter bundling issues with packages like Playwright or native modules:build and dev commands. Deploy
- Push your code (including
smithery.yaml) to GitHub - Connect your GitHub to Smithery (or claim your server if already listed)
- Navigate to the Deployments tab on your server page
- Click Deploy to build and host your server
Good to Know
What happens under the hood
What happens under the hood
Remote Deployment: When you deploy to Smithery’s infrastructure:
- Clone your repository
- Parse your
smithery.yamlto detect TypeScript runtime - Install dependencies with
npm ci - Build your TypeScript code using the
moduleentry point from yourpackage.json - Package your server into a containerized HTTP service
- Deploy the container to our hosting infrastructure
- Send MCP
initializeandlist_toolsmessages with a dummy configuration to discover your server’s capabilities - Make it available at
https://server.smithery.ai/your-server/mcp - Handle load balancing, scaling, and monitoring
target: "local":- Your server runs locally on user’s machine using
npm run dev - Smithery registers your server in the registry for discovery
- MCP clients can find and connect to your local server through Smithery
- Your server remains under your control while being accessible to others
Troubleshooting
Why does my deployment fail?
Why does my deployment fail?
Common issues and solutions:Remote Deployment Issues:
- Missing module field: Ensure your
package.jsonhas themodulefield pointing to your entry point - Dependencies not found: All dependencies must be listed in
dependenciesordevDependencies - Server doesn’t build locally: Before deploying, verify your server builds and runs locally: If this fails, fix any TypeScript compilation errors or missing dependencies first
- Server not discoverable: Ensure you have
target: "local"in yoursmithery.yaml - Local server won’t start: Verify your server runs with
npm run devbefore expecting registry integration - Connection issues: Make sure your local development environment allows the necessary network connections