Skip to content

Commit 802a363

Browse files
committed
feat: dynamic actor loading is enabled by default
1 parent efa9e9c commit 802a363

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

.actor/input_schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"title": "Enable adding Actors based on context and use-case (experimental, check if it supported by your client)",
2626
"type": "boolean",
2727
"description": "When enabled, the server can dynamically add Actors as tools based on user requests and context. \n\nNote: MCP client must support notification on tool updates. To try it, you can use the [Tester MCP Client](https://apify.com/jiri.spilka/tester-mcp-client). This is an experimental feature and may require client-specific support.",
28-
"default": false
28+
"default": true
2929
},
3030
"maxActorMemoryBytes": {
3131
"title": "Limit the maximum memory used by an Actor",
@@ -48,7 +48,7 @@
4848
"description": "Specify the input for the Actor that will be used for debugging in normal mode",
4949
"editor": "json",
5050
"prefill": {
51-
"query": "hello world"
51+
"query": "hello world"
5252
}
5353
}
5454
}

src/input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function processInput(originalInput: Partial<Input>): Input {
2424
log.warning('enableActorAutoLoading is deprecated, use enableAddingActors instead');
2525
input.enableAddingActors = input.enableActorAutoLoading === true || input.enableActorAutoLoading === 'true';
2626
} else {
27-
input.enableAddingActors = false;
27+
input.enableAddingActors = true;
2828
}
2929
} else {
3030
input.enableAddingActors = input.enableAddingActors === true || input.enableAddingActors === 'true';

src/mcp/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class ActorsMcpServer {
5050

5151
constructor(options: ActorsMcpServerOptions = {}, setupSigintHandler = true) {
5252
this.options = {
53-
enableAddingActors: options.enableAddingActors ?? false,
53+
enableAddingActors: options.enableAddingActors ?? true,
5454
enableDefaultActors: options.enableDefaultActors ?? true, // Default to true for backward compatibility
5555
};
5656
this.server = new Server(

src/stdio.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ import { getActorsAsTools } from './tools/index.js';
3333
*/
3434
interface CliArgs {
3535
actors?: string;
36-
'enable-adding-actors'?: boolean;
37-
enableActorAutoLoading?: boolean;
36+
enableAddingActors: boolean;
37+
/** @deprecated */
38+
enableActorAutoLoading: boolean;
3839
}
3940

4041
// Configure logging, set to ERROR
@@ -50,12 +51,12 @@ const argv = yargs(hideBin(process.argv))
5051
})
5152
.option('enable-adding-actors', {
5253
type: 'boolean',
53-
default: false,
54+
default: true,
5455
describe: 'Enable dynamically adding Actors as tools based on user requests',
5556
})
5657
.option('enableActorAutoLoading', {
5758
type: 'boolean',
58-
default: false,
59+
default: true,
5960
hidden: true,
6061
describe: 'Deprecated: use enable-adding-actors instead',
6162
})
@@ -69,7 +70,7 @@ const argv = yargs(hideBin(process.argv))
6970
.epilogue('For more information, visit https://github.com/apify/actors-mcp-server')
7071
.parseSync() as CliArgs;
7172

72-
const enableAddingActors = argv['enable-adding-actors'] || argv.enableActorAutoLoading || false;
73+
const enableAddingActors = argv.enableAddingActors && argv.enableActorAutoLoading;
7374
const actors = argv.actors as string || '';
7475
const actorList = actors ? actors.split(',').map((a: string) => a.trim()) : [];
7576

tests/unit/input.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ describe('processInput', () => {
3939
expect(processed.enableAddingActors).toBe(false);
4040
});
4141

42-
it('should default enableAddingActors to false when not provided', async () => {
42+
it('should default enableAddingActors to true when not provided', async () => {
4343
const input: Partial<Input> = {
4444
actors: ['actor1'],
4545
};
4646
const processed = processInput(input);
47-
expect(processed.enableAddingActors).toBe(false);
47+
expect(processed.enableAddingActors).toBe(true);
4848
});
4949
});

0 commit comments

Comments
 (0)