feat: Remove Actor deployment files and simplify to HTTP server#613
feat: Remove Actor deployment files and simplify to HTTP server#613jirispilka merged 8 commits intomasterfrom
Conversation
- Delete src/actor/ directory (server.ts, utils.ts, types.ts, const.ts, README.md) - Delete .actor/ directory (actor.json, input_schema.json, ACTOR.md, Dockerfile) - Create src/dev_server.ts from actor/server.ts with Actor-specific bits removed (no host param, no getHelpMessage, inline Routes/TransportType constants) - Rewrite src/main.ts as a simple Express server using HOST/PORT env vars - Change ApifyClientOptions import in src/apify_client.ts from 'apify' to 'apify-client' - Change ApifyClient import in src/utils/tools_loader.ts from 'apify' to 'apify-client' - Remove debugActor and debugActorInput fields from Input type in src/types.ts - Remove "apify" from package.json dependencies - Clean up start:standby script (remove APIFY_META_ORIGIN env var) - Update integration and unit test imports to use new paths Closes #526 https://claude.ai/code/session_01H5wf2UswqdY2HKNJ9r2uR6
main.ts no longer checks this variable after the Actor SDK removal. https://claude.ai/code/session_01H5wf2UswqdY2HKNJ9r2uR6
There was a problem hiding this comment.
No bugs found, but this is a significant architectural change (removing the entire Apify Actor deployment pathway and simplifying to a standalone HTTP server) that warrants a human review before merging.
Extended reasoning...
Overview
This PR removes the Apify Actor deployment infrastructure across 19 files: deletes .actor/ config (Dockerfile, actor.json, input_schema.json, ACTOR.md), removes src/actor/ source files, dramatically simplifies src/main.ts (no more Actor.init(), Actor.getInput(), standby mode detection, or debug actor path), renames/moves src/actor/server.ts → src/dev_server.ts, removes the apify npm dependency (keeping apify-client), and updates all imports and tests accordingly.
Security Risks
No new security-sensitive code is introduced. The core HTTP server logic in dev_server.ts appears structurally identical to what was in src/actor/server.ts — only the import paths and the removed host parameter for the 404 message differ. The APIFY_TOKEN check remains in main.ts.
Level of Scrutiny
While the individual changes are mechanically clean (mostly deletions and import updates), this is a significant architectural decision: permanently removing the Actor deployment pathway that the project previously supported. A human should confirm the team intends to fully abandon Actor deployment mode and that no downstream consumers (npm package users, production deployments) depend on the removed behavior before this lands.
Other Factors
The PR is labeled tested. No bugs were found. The package-lock.json diff shows a large reduction in transitive dependencies (crawlee, got-scraping, header-generator, etc.) by removing the apify SDK. This is all expected given the stated goal.
Inline tsx src/main.ts directly in the start script and remove the start:standby alias which was an Actor-era naming artifact. https://claude.ai/code/session_01H5wf2UswqdY2HKNJ9r2uR6
There was a problem hiding this comment.
Hey @jirispilka, reviewing this architectural change.
While dropping the heavy dependencies and Standby mode is great, this PR completely removes the .actor/ scaffolding and src/main.ts. The issue is that the apify/actors-mcp-server actor is heavily hardcoded as a test target in our integration suites.
Specifically, it's used in these exact places:
Public Repo (apify-mcp-server)
tests/const.ts(definesACTOR_MCP_SERVER_ACTOR_NAME)tests/integration/suite.ts(used foraddActor(), keyword searches,fetch-actor-details,actor:toolexecution syntax, structured output parsing, andcall-actorvalidation)
Internal Repo (apify-mcp-server-internal)
test/integration/src/server-suite.ts(used to test adding/calling an Actorized MCP server and as a search keyword)
It will actually not break the tests right now as the Actor is still deployed on staging and prod. However, if we ever remove that Actor (or need to update its schema/behavior for tests in the future), we would not be able to easily re-deploy since the source code will no longer exist in this repo.
A total test suite rework across both repos isn't really feasible right now. To unblock this, we should either create a new, minimal dummy Actor MCP server (perhaps a small separate dummy Actor in this repo) strictly for the tests to target, or keep the existing setup.
Thoughts on the dummy Actor approach?
|
@MQ37 oh, thanks! I forgot about the actors-mcp-server Actor again :( What I will do is to move it to a different repository so that we have it somewhere. I planned to suggest Robert or Vojta to implement a single super-Actor that we will use for all the tests. |
Yes, I agree - let's YOLO and merge this PR and then we can give it to the guys as a first task, I think it will be cool first task. Feel free to merge but please first let's create an issue for this so we do not forget. |
MQ37
left a comment
There was a problem hiding this comment.
⏫ Please see my comment above - pre-approving.
No worries, I will create a new repo first |
|
Copy of the repo is here: https://github.com/apify/actor-old-mcp-server |
This PR removes the Apify Actor deployment infrastructure and simplifies the codebase to focus on the HTTP server implementation for local development and testing.
Summary
The project is transitioning away from being deployed as an Apify Actor. All Actor-specific files, configurations, and deployment logic have been removed, and the codebase has been refactored to be a standalone HTTP server.
Key Changes
Removed Actor deployment files:
.actor/directory containingACTOR.md,Dockerfile,actor.json, andinput_schema.jsonsrc/actor/server.ts,src/actor/const.ts,src/actor/types.ts,src/actor/utils.ts, andsrc/actor/README.mdSimplified main entry point (
src/main.ts):Actor.init(),Actor.getInput(), etc.)Renamed and refactored server file:
src/actor/server.ts→src/dev_server.tswith updated comment to reflect local development purposeTransportTypeandRoutesenums fromsrc/actor/const.tsdirectly into the filehostparameter fromcreateExpressApp()functionUpdated dependencies:
apifypackage dependency (keptapify-clientfor API interactions)Updated imports:
ApifyClientOptionsimport fromapifytoapify-clientsrc/dev_server.jsinstead ofsrc/actor/server.jsCleaned up type definitions:
debugActoranddebugActorInputfrom theInputtypeImplementation Details
The server now operates purely as an HTTP server without any Actor-specific lifecycle management. Environment variables are simplified to just
APIFY_TOKEN,HOST, andPORT. The application is designed for local development and testing scenarios rather than deployment on the Apify platform.https://claude.ai/code/session_01H5wf2UswqdY2HKNJ9r2uR6