Skip to content

feat: update Node.js samples to MCP V2 per-audience token model#271

Open
biswapm wants to merge 3 commits intomainfrom
mcp-v1-v2-changes-node
Open

feat: update Node.js samples to MCP V2 per-audience token model#271
biswapm wants to merge 3 commits intomainfrom
mcp-v1-v2-changes-node

Conversation

@biswapm
Copy link
Copy Markdown
Contributor

@biswapm biswapm commented Apr 12, 2026

  • Update ToolingManifest.json for openai, claude, langchain samples:
    • V2 URLs (test.agent365.svc.cloud.dev.microsoft)
    • Unified scope: Tools.ListInvoke.All
    • Per-server audience GUIDs (Mail: 24b71c94, Calendar: 19ec8e8a)
    • Add publisher field
    • Replace mcp_WordServer with mcp_CalendarTools (claude)
    • Add mcp_CalendarTools entry (langchain)
  • Add BEARER_TOKEN_MCP_MAILTOOLS and BEARER_TOKEN_MCP_CALENDARTOOLS to all three .env.template/.env.example files for V2 dev-mode token acquisition
  • Add app_logs.zip, app_logs/, manifest/ to .gitignore

- Update ToolingManifest.json for openai, claude, langchain samples:
  - V2 URLs (test.agent365.svc.cloud.dev.microsoft)
  - Unified scope: Tools.ListInvoke.All
  - Per-server audience GUIDs (Mail: 24b71c94, Calendar: 19ec8e8a)
  - Add publisher field
  - Replace mcp_WordServer with mcp_CalendarTools (claude)
  - Add mcp_CalendarTools entry (langchain)
- Add BEARER_TOKEN_MCP_MAILTOOLS and BEARER_TOKEN_MCP_CALENDARTOOLS to
  all three .env.template/.env.example files for V2 dev-mode token acquisition
- Add app_logs.zip, app_logs/, manifest/ to .gitignore

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 12, 2026

⚠️ Deprecation Warning: The deny-licenses option is deprecated for possible removal in the next major release. For more information, see issue 997.

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@biswapm biswapm marked this pull request as ready for review April 16, 2026 17:30
@biswapm biswapm requested a review from a team as a code owner April 16, 2026 17:30
Copilot AI review requested due to automatic review settings April 16, 2026 17:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Node.js sample agents’ MCP configuration to align with an MCP V2 per-audience token model by adjusting tooling manifests, environment templates, and repo ignore rules.

Changes:

  • Update MCP ToolingManifest.json entries in the OpenAI/Claude/LangChain Node.js samples (scope/audience/publisher/server selection).
  • Add per-server bearer token environment variables to the samples’ .env.template / .env.example files.
  • Ignore generated logs/artifacts (app_logs*, manifest/) in .gitignore.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
nodejs/openai/sample-agent/ToolingManifest.json Updates MCP server configuration (now only CalendarTools, new scope/audience/publisher).
nodejs/openai/sample-agent/.env.template Adds per-server bearer token env vars for V2 dev-mode.
nodejs/langchain/sample-agent/ToolingManifest.json Updates MCP server configuration (now only CalendarTools, new scope/audience/publisher).
nodejs/langchain/sample-agent/.env.example Adds per-server bearer token env vars for V2 dev-mode.
nodejs/claude/sample-agent/ToolingManifest.json Updates MCP server configuration (now only CalendarTools, new scope/audience/publisher).
nodejs/claude/sample-agent/.env.template Adds per-server bearer token env vars for V2 dev-mode.
.gitignore Ignores generated logs and manifest output folders/zips.

Comment on lines 6 to +8
"url": "https://agent365.svc.cloud.microsoft/agents/servers/mcp_CalendarTools",
"scope": "McpServers.Calendar.All",
"audience": "ea9ffc3e-8a23-4a7d-836d-234d7c7565c1"
"scope": "Tools.ListInvoke.All",
"audience": "910333d2-47e9-43ca-981f-6df2f4531ef4",
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

The URL/audience values here don’t match the PR description (“V2 URLs” under test.agent365.svc.cloud.dev.microsoft and per-server audiences for Mail vs Calendar). Update the url to the V2 hostname and set the audience to the Calendar audience GUID intended for mcp_CalendarTools.

Copilot uses AI. Check for mistakes.
Comment on lines 2 to +6
"mcpServers": [
{
"mcpServerName": "mcp_MailTools",
"mcpServerUniqueName": "mcp_MailTools",
"url": "https://agent365.svc.cloud.microsoft/agents/servers/mcp_MailTools",
"scope": "McpServers.Mail.All",
"audience": "ea9ffc3e-8a23-4a7d-836d-234d7c7565c1"
"mcpServerName": "mcp_CalendarTools",
"mcpServerUniqueName": "mcp_CalendarTools",
"url": "https://agent365.svc.cloud.microsoft/agents/servers/mcp_CalendarTools",
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

ToolingManifest.json now defines only mcp_CalendarTools. This sample’s agent handles EmailNotification and attempts to retrieve message content, which depends on mcp_MailTools; with MailTools removed, that scenario will fail. Re-add mcp_MailTools alongside CalendarTools (with the appropriate V2 scope/audience).

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +9
"url": "https://agent365.svc.cloud.microsoft/agents/servers/mcp_CalendarTools",
"scope": "Tools.ListInvoke.All",
"audience": "910333d2-47e9-43ca-981f-6df2f4531ef4",
"publisher": "Microsoft"
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

The url/audience values shown here don’t align with the PR description’s V2 hostname and per-server audience GUIDs. Please update the CalendarTools entry to use the V2 endpoint and the Calendar audience GUID (and apply the Mail audience GUID on the MailTools entry once it’s restored).

Copilot uses AI. Check for mistakes.
Comment on lines 15 to +17
BEARER_TOKEN=
# V2 per-server bearer tokens (dev mode — SDK reads BEARER_TOKEN_<SERVER_NAME_UPPER>)
BEARER_TOKEN_MCP_MAILTOOLS=
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

This template adds per-server tokens for both MCP_MAILTOOLS and MCP_CALENDARTOOLS, but the updated ToolingManifest.json only defines CalendarTools. Either restore the MailTools server in the manifest or remove the MailTools token variable so the template matches the configured servers. Also consider clarifying that BEARER_TOKEN should be left empty when using per-server tokens for the V2 per-audience model.

Suggested change
BEARER_TOKEN=
# V2 per-server bearer tokens (dev mode — SDK reads BEARER_TOKEN_<SERVER_NAME_UPPER>)
BEARER_TOKEN_MCP_MAILTOOLS=
# Leave BEARER_TOKEN empty when using V2 per-server bearer tokens.
BEARER_TOKEN=
# V2 per-server bearer tokens (dev mode — SDK reads BEARER_TOKEN_<SERVER_NAME_UPPER>)

Copilot uses AI. Check for mistakes.
Comment on lines 14 to +16
BEARER_TOKEN=
# V2 per-server bearer tokens (dev mode — SDK reads BEARER_TOKEN_<SERVER_NAME_UPPER>)
BEARER_TOKEN_MCP_MAILTOOLS=
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

This file introduces per-server bearer tokens for MailTools and CalendarTools, but the sample’s ToolingManifest.json currently only contains CalendarTools. Please align the env template with the manifest (restore MailTools in the manifest or drop the unused MailTools token variable), and clarify whether BEARER_TOKEN is legacy vs. the preferred per-server tokens in the V2 per-audience model.

Suggested change
BEARER_TOKEN=
# V2 per-server bearer tokens (dev mode — SDK reads BEARER_TOKEN_<SERVER_NAME_UPPER>)
BEARER_TOKEN_MCP_MAILTOOLS=
# Legacy/global fallback token. Prefer per-server bearer tokens in the V2 per-audience model.
BEARER_TOKEN=
# Preferred V2 per-server bearer tokens (dev mode — SDK reads BEARER_TOKEN_<SERVER_NAME_UPPER>)

Copilot uses AI. Check for mistakes.
Comment on lines 5 to +7
BEARER_TOKEN=
# V2 per-server bearer tokens (dev mode — SDK reads BEARER_TOKEN_<SERVER_NAME_UPPER>)
BEARER_TOKEN_MCP_MAILTOOLS=
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

Per-server bearer tokens were added for MailTools and CalendarTools, but the updated ToolingManifest.json only lists CalendarTools. Please either add MailTools back to the manifest or remove the unused BEARER_TOKEN_MCP_MAILTOOLS variable. It would also help to document whether BEARER_TOKEN should be unset when using per-server tokens in the V2 per-audience model.

Suggested change
BEARER_TOKEN=
# V2 per-server bearer tokens (dev mode — SDK reads BEARER_TOKEN_<SERVER_NAME_UPPER>)
BEARER_TOKEN_MCP_MAILTOOLS=
# Shared/default bearer token. Leave unset when using V2 per-server bearer tokens below.
BEARER_TOKEN=
# V2 per-server bearer tokens (dev mode — SDK reads BEARER_TOKEN_<SERVER_NAME_UPPER>)
# For the V2 per-audience model, prefer server-specific tokens and leave BEARER_TOKEN unset.

Copilot uses AI. Check for mistakes.
"scope": "McpServers.Mail.All",
"audience": "ea9ffc3e-8a23-4a7d-836d-234d7c7565c1"
},
{
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

ToolingManifest.json now only includes mcp_CalendarTools. The Node.js samples’ agents handle EmailNotification and prompt the model to “retrieve this message”, which relies on mcp_MailTools; removing it will break that flow. Add back an mcp_MailTools entry (and keep mcp_CalendarTools) so email retrieval works again.

Suggested change
{
{
"mcpServerName": "mcp_MailTools",
"mcpServerUniqueName": "mcp_MailTools",
"url": "https://agent365.svc.cloud.microsoft/agents/servers/mcp_MailTools",
"scope": "Tools.ListInvoke.All",
"audience": "910333d2-47e9-43ca-981f-6df2f4531ef4",
"publisher": "Microsoft"
},
{

Copilot uses AI. Check for mistakes.
Comment on lines 2 to +6
"mcpServers": [
{
"mcpServerName": "mcp_MailTools",
"mcpServerUniqueName": "mcp_MailTools",
"url": "https://agent365.svc.cloud.microsoft/agents/servers/mcp_MailTools",
"scope": "McpServers.Mail.All",
"audience": "ea9ffc3e-8a23-4a7d-836d-234d7c7565c1"
},
{
"mcpServerName": "mcp_WordServer",
"mcpServerUniqueName": "mcp_WordServer",
"url": "https://agent365.svc.cloud.microsoft/agents/servers/mcp_WordServer",
"scope": "McpServers.Word.All",
"audience": "ea9ffc3e-8a23-4a7d-836d-234d7c7565c1"
"mcpServerName": "mcp_CalendarTools",
"mcpServerUniqueName": "mcp_CalendarTools",
"url": "https://agent365.svc.cloud.microsoft/agents/servers/mcp_CalendarTools",
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

This manifest drops mcp_MailTools (and other servers) and leaves only mcp_CalendarTools. The Claude Node.js sample still processes EmailNotification and asks the model to retrieve message content, which requires mcp_MailTools; without it, email notifications can’t be handled correctly. Add back mcp_MailTools (and any other required servers) with the new V2 scope/audience settings.

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +9
"url": "https://agent365.svc.cloud.microsoft/agents/servers/mcp_CalendarTools",
"scope": "Tools.ListInvoke.All",
"audience": "910333d2-47e9-43ca-981f-6df2f4531ef4",
"publisher": "Microsoft"
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

Per the PR description, these entries should be updated to the V2 service hostname and to per-server audiences (Mail vs Calendar). The current url is still on the legacy hostname and the audience is a single GUID; update the CalendarTools entry accordingly (and apply the Mail audience on the MailTools entry once restored).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants