With Smithery discontinuing STDIO support on September 7, 2025, developers need a stable platform for their MCP servers. Apify provides full STDIO support with no deprecation plans, allowing you to deploy existing servers without rewriting.
With Apify's MCP templates, you can transform any stdio or remote MCP server into a scalable, cloud-hosted service in minutes. There are currently two templates available: for Python and for TypeScript.
In this tutorial, we'll show you how to build an MCP server on Apify with TypeScript.
Understanding the architecture
When you deploy an MCP server on Apify, you can work with two types of MCP servers:
- stdio MCP servers: Local servers that communicate via standard input/output, which Apify converts to HTTP for remote access.
- Streamable HTTP MCP servers: Remote servers that already communicate via streamable HTTP, which Apify can proxy and enhance with monetization features.
This is particularly important as other platforms sunset STDIO support. Your existing STDIO-based MCP servers can run on Apify without modification, while platforms like Smithery require complete HTTP rewrites by September 7, 2025.
This flexible architecture allows you to turn any type of MCP server into an Apify Actor, whether it's a local stdio-based tool or a remote MCP endpoint, and expose it through a unified HTTP interface with built-in scaling and monetization.
Step-by-step implementation
Let’s walk through building an MCP server on Apify using the TypeScript template.
Step 1. Choose and create your Actor from the template
# Create the TypeScript MCP server from template
apify create my-mcp-server --template ts-mcp-server
cd my-mcp-server
If migrating from Smithery before their September 2025 STDIO sunset, copy your existing STDIO server code directly. No transport layer changes are needed. You can deploy as-is using the TypeScript template. Your STDIO configuration remains valid
Step 2. Configure your MCP server
Open src/main.ts
and set the MCP_COMMAND
:
// For stdio servers:
// Example: Everything MCP server
const MCP_COMMAND = [
'npx',
'@modelcontextprotocol/server-everything',
];
// For remote HTTP servers (requires mcp-remote package):
// Custom MCP endpoint
const MCP_COMMAND = [
'npx',
'mcp-remote',
'https://mcp.apify.com/',
'--header',
'Authorization: Bearer TOKEN',
];
Step 3. Install your MCP server dependencies
Update package.json
with the MCP server dependencies:
{
"dependencies": {
"@modelcontextprotocol/server-everything": "^2025.5.12",
"mcp-remote": "^0.1.16"
}
}
npm install
instead of editing package.json
directly.Step 4. Set up monetization (optional)
In .actor/pay_per_event.json
:
[
{
"tool-request": {
"eventTitle": "Tool Request",
"eventDescription": "Charge for each tool execution",
"eventPriceUsd": 0.05
}
}
]
Trigger charges in your code:
For TypeScript:
await Actor.charge({ eventName: 'tool-request' })
Step 5. Configure Actor settings
We need to configure the webServerMcpPath in .actor/actor.json so the Apify MCP recognizes the Actor as an MCP server. This is the path of the streamable HTTP MCP endpoint exposed by the standby Actor:
{
"actorSpecification": 1,
"name": "my-mcp-server",
"version": "1.0.0",
"usesStandbyMode": true,
"minMemoryMbytes": 512,
"maxMemoryMbytes": 4096,
"webServerMcpPath": "/mcp" // So the Actor is recognized as an MCP server
}
Step 6. Deploy to Apify
apify login
apify push
Step 7. Configure standby mode
In Apify Console:
- Go to your Actor’s settings
- Enable “Standby mode”
- Set idle timeout (e.g., 300 seconds)
- Adjust memory allocation as needed
Step 8. Connect your MCP client
Use this URL:
https://your-username--my-mcp-server.apify.actor/mcp
Configure your client by pointing your MCP client to the URL, and be sure to set the Authorization headers with the bearer auth token Authorization: Bearer your-token
.
Advanced configuration
Environment variables
To set non-sensitive environment variables, use actor.json
:
{
"environmentVariables": {
"RATE_LIMIT": "100"
}
}
actor.json
file. Instead, set sensitive environment variables in the Apify Console UI under your Actor's settings when doing the build. For more information on setting custom environment variables, see the documentation.Debugging and monitoring
Local development
To run the MCP server locally, use the following command:
APIFY_META_ORIGIN="STANDBY" ACTOR_WEB_SERVER_PORT=8080 apify run
You can use the MCP inspector on GitHub for debugging and testing locally.
Production monitoring
- View Actor logs in Apify Console
- Set up error/usage alerts
- Track monetization in Analytics
Troubleshooting common issues
- Memory errors: Increase memory or optimize code
- Auth failures: Check tokens
Conclusion
With Smithery discontinuing STDIO support in September 2025, Apify offers a direct path forward if you don’t want to spend time rewriting your servers. By deploying on Apify, you can migrate your existing STDIO-based MCP servers without modifying transport layers, while also gaining cloud scalability, monitoring, and optional monetization.
Whether you’re moving off Smithery or starting fresh, Apify’s MCP templates for TypeScript and Python give you production-ready deployments in minutes. Instead of re-architecting for HTTP, you can focus on improving your server’s logic while Apify handles stability and scaling.
If you’re migrating, the process is as simple as copying your current STDIO server code into the Apify template, deploying, and connecting your MCP client. From there, you can take advantage of Apify’s monetization features, analytics, and integrations with other Actors.