Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import fs from 'fs';
import path from 'path';
import axios from 'axios';
import { MCPServerConfig, McpClientTool, ToolOptions } from './contracts';
import { MCPServerConfig, MCPServerManifestEntry, McpClientTool, ToolOptions } from './contracts';
import { Utility } from './Utility';

import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
Expand Down Expand Up @@ -129,9 +129,17 @@ export class McpToolServerConfigurationService {
* {
* "mcpServerName": "sharePointMCPServerConfig",
* "mcpServerUniqueName": "mcp_SharePointTools"
* },
* {
* "mcpServerName": "customMCPServer",
* "url": "http://localhost:3000/mcp"
* }
* ]
* }
*
* Each server entry can optionally include a "url" field to specify a custom MCP server URL.
* If the "url" field is not provided, the URL will be automatically constructed using the server name.
* The server name is determined by using "mcpServerName" if present, otherwise "mcpServerUniqueName".
Copy link

@tmlsousa tmlsousa Dec 30, 2025

Choose a reason for hiding this comment

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

Should this be the other way around, i.e. use the unique name as default and if that does not exist then server name? Given that the unique name is usually used to construct the URL?
Actually, I'm wondering what is even the point of having a server name?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is the current behavior in the .NET SDK and how we have been parsing the tooling manifest files previously. The idea was to just have one property since mcpServerName and mcpServerUniqueName are supposed to be the same thing - so we were getting rid of mcpServerUniqueName and just used mcpServerName. We can revisit the contract later.

*/
private async getMCPServerConfigsFromManifest(): Promise<MCPServerConfig[]> {
let manifestPath = path.join(process.cwd(), 'ToolingManifest.json');
Expand All @@ -150,10 +158,16 @@ export class McpToolServerConfigurationService {
const manifestData = JSON.parse(jsonContent);
const mcpServers = manifestData.mcpServers || [];

return mcpServers.map((s: MCPServerConfig) => {
return mcpServers.map((s: MCPServerManifestEntry) => {
// Use mcpServerName if available, otherwise fall back to mcpServerUniqueName
const serverName = s.mcpServerName || s.mcpServerUniqueName;
if (!serverName) {
throw new Error('Either mcpServerName or mcpServerUniqueName must be provided in manifest entry');
}
return {
mcpServerName: s.mcpServerName,
url: Utility.BuildMcpServerUrl(s.mcpServerName)
mcpServerName: serverName,
url: s.url || Utility.BuildMcpServerUrl(serverName),
headers: s.headers
};
});
} catch (err: unknown) {
Expand Down
7 changes: 7 additions & 0 deletions packages/agents-a365-tooling/src/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ export interface MCPServerConfig {
headers?: Record<string, string>;
}

export interface MCPServerManifestEntry {
mcpServerName?: string;
mcpServerUniqueName?: string;
url?: string;
headers?: Record<string, string>;
}

export interface McpClientTool {
name: string;
description?: string;
Expand Down
15 changes: 15 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ catalog:
"@types/node": "^20.17.0"
"@typescript-eslint/eslint-plugin": "^8.47.0"
"@typescript-eslint/parser": "^8.47.0"
"cross-env": "^7.0.3"
"dotenv": "^17.2.2"
"eslint": "^9.39.1"
"jest": "^30.2.0"
Expand Down
11 changes: 6 additions & 5 deletions tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"test": "jest --config jest.config.cjs --passWithNoTests --testPathIgnorePatterns=/integration/",
"test:watch": "jest --config jest.config.cjs --watch --testPathIgnorePatterns=/integration/",
"test:coverage": "jest --config jest.config.cjs --coverage --passWithNoTests --testPathIgnorePatterns=/integration/",
"test:verbose": "jest --config jest.config.cjs --verbose --passWithNoTests --testPathIgnorePatterns=/integration/",
"test:ci": "jest --config jest.config.cjs --coverage --ci --maxWorkers=2 --passWithNoTests --testPathIgnorePatterns=/integration/"
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --config jest.config.cjs --passWithNoTests --testPathIgnorePatterns=/integration/",
"test:watch": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --config jest.config.cjs --watch --testPathIgnorePatterns=/integration/",
"test:coverage": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --config jest.config.cjs --coverage --passWithNoTests --testPathIgnorePatterns=/integration/",
"test:verbose": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --config jest.config.cjs --verbose --passWithNoTests --testPathIgnorePatterns=/integration/",
"test:ci": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --config jest.config.cjs --coverage --ci --maxWorkers=2 --passWithNoTests --testPathIgnorePatterns=/integration/"
},
"keywords": [
"agents",
Expand Down Expand Up @@ -50,6 +50,7 @@
"@types/node": "catalog:",
"@typescript-eslint/eslint-plugin": "catalog:",
"@typescript-eslint/parser": "catalog:",
"cross-env": "catalog:",
"eslint": "catalog:",
"jest": "catalog:",
"js-yaml": "catalog:",
Expand Down
Loading