This is a TypeScript template project that demonstrates how to build and deploy custom MCP servers on Smithery using Express and Docker containers. It supports both STDIO and HTTP transports via an environment variable, includes CORS headers for browser clients, and shows how to handle Smithery's session configuration system. The example implements basic character counting functionality, but the real value is as a starting point for your own server. You get request logging middleware, interactive testing through Smithery's playground CLI, and a complete deployment setup with smithery.yaml configuration. Reach for this when you want to build a production MCP server with HTTP support rather than STDIO only, or when you need custom container deployment on Smithery's infrastructure.
A simple TypeScript MCP server built using the official MCP TypeScript SDK, Express, and custom Docker container. This example demonstrates how you can host HTTP servers on Smithery using custom containers, with STDIO support for backwards compatibility.
See the complete guide: https://smithery.ai/docs/migrations/typescript-custom-container
TRANSPORT env variablesrc/index.ts - Main Express server with MCP HTTP transportpackage.json - Node.js dependencies and scriptssmithery.yaml - Smithery deployment and session configurationDockerfile - Dockerfile to host server in SmitheryInstall dependencies:
npm install
Run the development server:
HTTP Mode:
npm run dev
This will start the server on port 8081.
Test interactively: Once your server is running in HTTP mode, you can test it interactively using the Smithery playground:
npx -y @smithery/cli playground --port 8081
Deploy your own version: To deploy your own MCP server: