Skip to content

feat: Remove Actor deployment files and simplify to HTTP server#613

Merged
jirispilka merged 8 commits intomasterfrom
claude/fix-issue-526-K0Ma8
Mar 31, 2026
Merged

feat: Remove Actor deployment files and simplify to HTTP server#613
jirispilka merged 8 commits intomasterfrom
claude/fix-issue-526-K0Ma8

Conversation

@jirispilka
Copy link
Copy Markdown
Collaborator

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 containing ACTOR.md, Dockerfile, actor.json, and input_schema.json
    • Actor-specific source files: src/actor/server.ts, src/actor/const.ts, src/actor/types.ts, src/actor/utils.ts, and src/actor/README.md
  • Simplified main entry point (src/main.ts):

    • Removed all Apify Actor SDK imports and initialization (Actor.init(), Actor.getInput(), etc.)
    • Removed standby mode detection and conditional logic
    • Removed debug actor execution path
    • Now simply creates and starts the Express HTTP server
    • Removed async/await from SIGINT handler since no Actor cleanup is needed
  • Renamed and refactored server file:

    • src/actor/server.tssrc/dev_server.ts with updated comment to reflect local development purpose
    • Moved TransportType and Routes enums from src/actor/const.ts directly into the file
    • Removed host parameter from createExpressApp() function
    • Simplified 404 error message (removed help message that referenced the host)
  • Updated dependencies:

    • Removed apify package dependency (kept apify-client for API interactions)
  • Updated imports:

    • Changed ApifyClientOptions import from apify to apify-client
    • Updated test files to import from src/dev_server.js instead of src/actor/server.js
  • Cleaned up type definitions:

    • Removed debugActor and debugActorInput from the Input type

Implementation 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, and PORT. The application is designed for local development and testing scenarios rather than deployment on the Apify platform.

https://claude.ai/code/session_01H5wf2UswqdY2HKNJ9r2uR6

claude added 3 commits March 26, 2026 21:54
- 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
@github-actions github-actions bot added t-ai Issues owned by the AI team. tested Temporary label used only programatically for some analytics. labels Mar 26, 2026
@jirispilka jirispilka changed the title Remove Actor deployment files and simplify to HTTP server feat: Remove Actor deployment files and simplify to HTTP server Mar 26, 2026
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.tssrc/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.

@jirispilka jirispilka changed the title feat: Remove Actor deployment files and simplify to HTTP server WIP: feat: Remove Actor deployment files and simplify to HTTP server Mar 26, 2026
@jirispilka jirispilka marked this pull request as draft March 26, 2026 22:25
@jirispilka jirispilka changed the title WIP: feat: Remove Actor deployment files and simplify to HTTP server feat: Remove Actor deployment files and simplify to HTTP server Mar 26, 2026
@jirispilka jirispilka marked this pull request as ready for review March 27, 2026 14:06
@jirispilka jirispilka requested a review from MQ37 March 27, 2026 14:06
Comment thread src/dev_server.ts Outdated
Comment thread DEVELOPMENT.md
Comment thread src/dev_server.ts Outdated
Copy link
Copy Markdown
Contributor

@MQ37 MQ37 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (defines ACTOR_MCP_SERVER_ACTOR_NAME)
  • tests/integration/suite.ts (used for addActor(), keyword searches, fetch-actor-details, actor:tool execution syntax, structured output parsing, and call-actor validation)

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?

@jirispilka
Copy link
Copy Markdown
Collaborator Author

jirispilka commented Mar 27, 2026

@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.
Here it just complicates the codebase and looks messy.

I planned to suggest Robert or Vojta to implement a single super-Actor that we will use for all the tests.
It should have normal mode, mcp server. timeouts. Then we will just need one signle Actor for all the tests

@MQ37
Copy link
Copy Markdown
Contributor

MQ37 commented Mar 27, 2026

@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. Here it just complicates the codebase and looks messy.

I planned to suggest Robert or Vojta to implement a single super-Actor that we will use for all the tests. It should have normal mode, mcp server. timeouts. Then we will just need one signle Actor 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.

Copy link
Copy Markdown
Contributor

@MQ37 MQ37 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⏫ Please see my comment above - pre-approving.

@jirispilka
Copy link
Copy Markdown
Collaborator Author

⏫ Please see my comment above - pre-approving.

No worries, I will create a new repo first

@jirispilka
Copy link
Copy Markdown
Collaborator Author

Copy of the repo is here: https://github.com/apify/actor-old-mcp-server

@jirispilka jirispilka merged commit 4feb11f into master Mar 31, 2026
13 checks passed
@jirispilka jirispilka deleted the claude/fix-issue-526-K0Ma8 branch March 31, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-ai Issues owned by the AI team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants