Skip to content

Commit 630d0c5

Browse files
authored
removing tools mode from node js (#101)
1 parent 15659b7 commit 630d0c5

File tree

4 files changed

+3
-24
lines changed

4 files changed

+3
-24
lines changed

packages/agents-a365-tooling/src/Utility.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
export enum ToolsMode {
5-
MockMCPServer = 'MockMCPServer',
6-
MCPPlatform = 'MCPPlatform'
7-
}
8-
94
// Constant for MCP Platform base URL in production
105
const MCP_PLATFORM_PROD_BASE_URL = 'https://agent365.svc.cloud.microsoft';
116

@@ -90,10 +85,7 @@ export class Utility {
9085
const environment = this.getCurrentEnvironment().toLowerCase();
9186

9287
if (environment === 'development') {
93-
const toolsMode = this.GetToolsMode();
94-
if (toolsMode === ToolsMode.MockMCPServer) {
95-
return process.env.MOCK_MCP_SERVER_URL || 'http://localhost:5309/mcp-mock/agents/servers';
96-
}
88+
return process.env.MOCK_MCP_SERVER_URL || 'http://localhost:5309/mcp-mock/agents/servers';
9789
}
9890

9991
return `${this.getMcpPlatformBaseUrl()}/agents/servers`;
@@ -114,16 +106,6 @@ export class Utility {
114106
return `${baseUrl}/${serverName}`;
115107
}
116108

117-
public static GetToolsMode(): ToolsMode {
118-
const toolsMode = process.env.TOOLS_MODE || 'MCPPlatform';
119-
switch (toolsMode.toLowerCase()) {
120-
case 'mockmcpserver':
121-
return ToolsMode.MockMCPServer;
122-
default:
123-
return ToolsMode.MCPPlatform;
124-
}
125-
}
126-
127109
/**
128110
* Reads the current environment name from process.env.
129111
* Checks ASPNETCORE_ENVIRONMENT, DOTNET_ENVIRONMENT, and NODE_ENV in that order.

tests-agent/openai-agent-auto-instrument-sample/.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# rename to .env
22

33
# Mock MCP Server
4-
TOOLS_MODE=MockMCPServer
54
MCP_AUTH_TOKEN=
65

76
# Agent 365 Authentication Configuration

tests-agent/openai-agent-auto-instrument-sample/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ $ npm run test-tool
5757

5858
This should open a web browser with a chat interface. Send a message to your agent and you should see it reply back with a mocked response.
5959

60-
In the first terminal, where you are running the agent application with TOOLS_MODE=MockMCPServer and NODE_ENV=development in .env,
61-
you should see telemetry rendered starting similar as below when you invoke the agent e.g ask the agent to send email to someone.
60+
In the first terminal, where you are running the agent application with NODE_ENV=development in .env, you should see telemetry rendered starting similar as below when you invoke the agent e.g ask the agent to send email to someone.
6261

6362
```
6463

tests-agent/openai-agent-auto-instrument-sample/src/OpenAIClient.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ export async function getClient(authorization: Authorization | undefined, authHa
2222
});
2323

2424
try {
25-
const toolsMode = process.env.TOOLS_MODE || 'MockMCPServer';
2625
const isDevelopment = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'Development';
2726

28-
if (toolsMode === 'MockMCPServer' || (isDevelopment && toolsMode !== 'ProductionMCPServer')) {
27+
if (isDevelopment) {
2928
// Use local mock MCP servers
3029
await localMcpService.addMcpToolServers(
3130
agent,

0 commit comments

Comments
 (0)