A tool for deploying STDIO-based MCP (Model Context Protocol) servers to a hosted environment while publishing proxy packages to npm.
When you create a STDIO-based MCP server as an npm package, your source code becomes publicly visible. This tool solves that problem by:
- Hosting your MCP server privately on a secure server infrastructure
- Publishing a proxy package to npm that calls your hosted server
- Keeping your source code private while maintaining npm package compatibility
- Upload: Your MCP server source code is uploaded to a private hosting service
- Build & Deploy: The server builds and deploys your MCP server in a secure environment
- Proxy Generation: A proxy npm package is automatically generated and published
- Client Connection: Users install your npm package, which proxies requests to your hosted server
- 🔒 Private Source Code: Keep your MCP server implementation private
- 📦 NPM Compatibility: Publish as a standard npm package
- 🚀 Automatic Deployment: Seamless build and deployment process
- ✅ NPM Validation: Validates package permissions and version compatibility
- 📋 Smart File Detection: Automatically detects necessary files for deployment
- 🧹 Clean Process: Handles temporary files and cleanup automatically
Run init command in your project root.
npx @deploxy/cli initGo to Deploxy new project, generate environment values.
Then copy values in your project root .deploxy.json file.
Create a .npmrc file in your project root:
//registry.npmjs.org/:_authToken=YOUR_NPM_TOKEN_HEREYour project must have:
- A valid
package.jsonwith abinfield (required for MCP servers) - A
tsconfig.jsonortsconfig.build.jsonfile - Source code in directories specified by your TypeScript configuration
After Setup done, you can run deploy command to publish your NPM package.
npx @deploxy/cli deploy- 🔍 Environment Validation: Reads authentication tokens from
.deploxy.json - 📦 Package Analysis: Parses
package.jsonand TypeScript configuration - ✅ NPM Validation:
- Checks if package exists on npm registry
- Validates version is higher than existing versions
- Verifies publish permissions
- 📋 File Collection: Automatically detects files needed for deployment
- 📦 Compression: Creates a zip archive of necessary files
- 📤 Upload: Securely uploads to the hosting service
- 🧹 Cleanup: Removes temporary files
The tool automatically includes:
package.jsontsconfig.jsonortsconfig.build.json
- Files matching
includepatterns (default:src/**/*) - Excludes files matching
excludepatterns
README.md,LICENSE,CHANGELOG.md.npmignore,.gitignore- Build configuration files:
jest.config.js/ts,webpack.config.js,rollup.config.jsvite.config.js/ts,babel.config.js/json,.babelrceslint.config.js,.eslintrc.js/jsonprettier.config.js,.prettierrc
dist/**/*(build artifacts)node_modules/**/*(dependencies).git/**/*(git history)- Other temporary files and build outputs
my-mcp-server/
├── package.json # Must include "bin" field
├── tsconfig.json
├── .deploxy.json # Deploy configs
├── .npmrc # NPM authentication
├── src/
│ ├── index.ts # Your MCP server entry point
│ └── lib/
│ └── example.ts # Your MCP server biz logic
└── README.md
Your package.json must include a bin field for MCP servers:
{
"name": "my-mcp-server",
"version": "1.0.0",
"bin": {
"my-mcp-server": "./dist/index.js"
},
"main": "./dist/index.js",
"files": ["dist/**/*"],
"scripts": {
"build": "tsc",
"prepublishOnly": "npm run build"
}
}The tool provides comprehensive error messages for common issues:
- Missing authentication tokens or wrong configs in
.deploxy.json - Invalid package.json or TypeScript configuration
- NPM permission issues
- Version conflicts
- Network connectivity problems