Skip to content

Commit 6879923

Browse files
committed
fix: rename server to ActorsMcpServer
1 parent 8735e8f commit 6879923

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"engines": {
77
"node": ">=18.0.0"
88
},
9-
"main": "dist/stdio.js",
9+
"main": "dist/index.js",
1010
"bin": {
1111
"actors-mcp-server": "./dist/stdio.js"
1212
},

src/actor/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import express from 'express';
99
import log from '@apify/log';
1010

1111
import { HEADER_READINESS_PROBE, Routes } from './const.js';
12-
import { type ApifyMcpServer } from '../mcp-server.js';
12+
import { type ActorsMcpServer } from '../mcp-server.js';
1313
import { getActorRunData, processParamsGetTools } from './utils.js';
1414

1515
export function createExpressApp(
1616
host: string,
17-
mcpServer: ApifyMcpServer,
17+
mcpServer: ActorsMcpServer,
1818
): express.Express {
1919
const HELP_MESSAGE = `Connect to the server with GET request to ${host}/sse?token=YOUR-APIFY-TOKEN`
2020
+ ` and then send POST requests to ${host}/message?token=YOUR-APIFY-TOKEN`;

src/examples/clientSse.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ async function main(): Promise<void> {
106106
} catch (error: unknown) {
107107
if (error instanceof Error) {
108108
console.error('Error:', error.message);
109-
console.error(error.stack);
110109
} else {
111110
console.error('An unknown error occurred:', error);
112111
}

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
This file provides essential functions and tools for MCP servers, serving as a library.
3-
It should be the only file that is exported from the package.
3+
The ActorsMcpServer should be the only class exported from the package
44
*/
55

6-
export { ApifyMcpServer } from './mcp-server.js';
6+
import { ActorsMcpServer } from './mcp-server.js';
7+
export default ActorsMcpServer;

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import log from '@apify/log';
1111
import { processInput } from './actor/input.js';
1212
import { createExpressApp } from './actor/server.js';
1313
import type { Input } from './actor/types';
14-
import { ApifyMcpServer } from './mcp-server.js';
14+
import { ActorsMcpServer } from './mcp-server.js';
1515
import { actorDefinitionTool, addTool, removeTool, searchTool, callActorGetDataset } from './tools/index.js';
1616

1717
const STANDBY_MODE = Actor.getEnv().metaOrigin === 'STANDBY';
@@ -26,7 +26,7 @@ if (!process.env.APIFY_TOKEN) {
2626
process.exit(1);
2727
}
2828

29-
const mcpServer = new ApifyMcpServer();
29+
const mcpServer = new ActorsMcpServer();
3030

3131
const input = processInput((await Actor.getInput<Partial<Input>>()) ?? ({} as Input));
3232
log.info(`Loaded input: ${JSON.stringify(input)} `);

src/mcp-server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import type { ActorTool, HelperTool, ToolWrap } from './types.js';
2121
/**
2222
* Create Apify MCP server
2323
*/
24-
export class ApifyMcpServer {
24+
export class ActorsMcpServer {
2525
public server: Server;
2626
public tools: Map<string, ToolWrap>;
2727

src/stdio.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import minimist from 'minimist';
1818
import log from '@apify/log';
1919

2020
import { defaults } from './actor/const.js';
21-
import { ApifyMcpServer } from './mcp-server.js';
21+
import { ActorsMcpServer } from './mcp-server.js';
2222
import { addTool, removeTool, getActorsAsTools } from './tools/index.js';
2323

2424
// Configure logging, set to ERROR
@@ -35,7 +35,7 @@ if (!process.env.APIFY_TOKEN) {
3535
}
3636

3737
async function main() {
38-
const mcpServer = new ApifyMcpServer();
38+
const mcpServer = new ActorsMcpServer();
3939
// Initialize tools
4040
const tools = await getActorsAsTools(actorList.length ? actorList : defaults.actors);
4141
if (enableActorAutoLoading) {

src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
22
import type { ValidateFunction } from 'ajv';
33
import type { ActorDefaultRunOptions, ActorDefinition } from 'apify-client';
44

5-
import type { ApifyMcpServer } from './mcp-server.js';
5+
import type { ActorsMcpServer } from './mcp-server.js';
66

77
export interface ISchemaProperties {
88
type: string;
@@ -80,7 +80,7 @@ export type InternalToolArgs = {
8080
/** Arguments passed to the tool */
8181
args: Record<string, unknown>;
8282
/** Reference to the Apify MCP server instance */
83-
apifyMcpServer: ApifyMcpServer;
83+
apifyMcpServer: ActorsMcpServer;
8484
/** Reference to the MCP server instance */
8585
mcpServer: Server;
8686
}

tests/actor-server-test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ import log from '@apify/log';
77

88
import { createExpressApp } from '../src/actor/server.js';
99
import { HelperTools } from '../src/const.js';
10-
import { ApifyMcpServer } from '../src/mcp-server.js';
10+
import { ActorsMcpServer } from '../src/mcp-server.js';
1111

1212
describe('ApifyMcpServer initialization', () => {
1313
let app: Express;
14-
let server: ApifyMcpServer;
14+
let server: ActorsMcpServer;
1515
let httpServer: HttpServer;
1616
const testPort = 7357;
1717
const testHost = `http://localhost:${testPort}`;
1818

1919
beforeEach(async () => {
20-
server = new ApifyMcpServer();
20+
server = new ActorsMcpServer();
2121
log.setLevel(log.LEVELS.OFF);
2222

2323
// Create express app using the proper server setup

0 commit comments

Comments
 (0)