UNPKG

@microsoft/m365agentstoolkit-mcp

Version:
3 lines 17 kB
#!/usr/bin/env node (()=>{"use strict";var e={51:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SchemaTypeEnum=void 0,t.clearSchemaCache=function(){Object.keys(n).forEach((e=>{delete n[e]}))},t.fetchSchema=async function(e,t){const o=`${e}:${t}`;if(n[o])return n[o];const s=i[e];if(!s)return`Unknown schema name: ${e}`;try{"latest"===t&&(t=s.latestVersion);const e=s.baseUrl.replace("{{version}}",t),i=await fetch(e);if(!i.ok)throw new Error(`HTTP error with status: ${i.status}`);const r=await i.json(),a=JSON.stringify({schema_url:e,content:r});return n[o]=a,a}catch(e){return`Failed fetching schema at version: ${t}, error: ${e instanceof Error?e.message:String(e)}. Try different version.`}};const s=o(569);t.SchemaTypeEnum=s.z.enum(["app_manifest","declarative_agent_manifest","api_plugin_manifest","m365_agents_yaml"]);const i={app_manifest:{baseUrl:"https://developer.microsoft.com/json-schemas/teams/{{version}}/MicrosoftTeams.schema.json",latestVersion:"v1.25"},declarative_agent_manifest:{baseUrl:"https://developer.microsoft.com/json-schemas/copilot/declarative-agent/{{version}}/schema.json",latestVersion:"v1.6"},api_plugin_manifest:{baseUrl:"https://developer.microsoft.com/json-schemas/copilot/plugin/{{version}}/schema.json",latestVersion:"v2.4"},m365_agents_yaml:{baseUrl:"https://developer.microsoft.com/json-schemas/teams-toolkit/teamsapp-yaml/{{version}}/yaml.schema.json",latestVersion:"v1.11"}},n={}},569:e=>{e.exports=require("zod")},589:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createServer=function(){const e=new s.McpServer({name:"m365agentstoolkit-mcp",version:"0.1.0"});return e.registerTool("get_schema",{description:'Get the schema for "App manifest", "Declarative agent manifest", "API plugin manifest", "M365 agents yaml", use it everytime before understanding, modifying or creating any of these manifest files.',inputSchema:{schema_name:n.SchemaTypeEnum.describe("name of schema"),schema_version:i.z.string().describe('version of schema in semantic versioning format vX.Y, where X is the major version and Y is the minor version (e.g. v1.0, v1.19, v2.1). Use "latest" if unsure.')}},(async({schema_name:e,schema_version:t})=>({content:[{type:"text",text:await(0,n.fetchSchema)(e,t)}]}))),e.registerTool("get_knowledge",{description:"Get documentation and guidance for Microsoft 365 agents and apps development, including Copilot extensibility, Teams platform, Agents Toolkit, and Agents SDK. Use this tool for any questions related to Microsoft 365 and Microsoft 365 Copilot development.",inputSchema:{question:i.z.string().describe("Question to use for knowledge retrieval")}},(({question:e})=>({content:[{type:"text",text:(0,r.retrieveResource)("documents",e)}]}))),e.registerTool("get_code_snippets",{description:"Get code snippets, templates, and sample repositories for Microsoft 365 agents and apps development. Covers SDKs including **@microsoft/teams-ai**, **@microsoft/teams-js**, **botbuilder**, **@microsoft/agents-hosting**, **@microsoft/agents-activity**, and **@microsoft/teamsfx**. Use this tool when looking for implementation examples, starter templates, or SDK usage patterns.",inputSchema:{question:i.z.string().describe("Query to find relevant code snippets related to Microsoft 365 app or agent SDKs")}},(({question:e})=>({content:[{type:"text",text:(0,r.retrieveResource)("code",e)}]}))),e.registerTool("troubleshoot",{description:"Find troubleshooting solutions and related issues for Microsoft 365 agents and apps development. Searches across Agents Toolkit, Teams SDK, Teams Samples, and documentation repositories. Use this tool when encountering errors, unexpected behaviors, or implementation challenges.",inputSchema:{question:i.z.string().describe("Description of the issue or error you're experiencing")}},(({question:e})=>({content:[{type:"text",text:(0,r.retrieveResource)("issues",e)}]}))),e};const s=o(737),i=o(569),n=o(51),r=o(806)},737:e=>{e.exports=require("@modelcontextprotocol/sdk/server/mcp.js")},802:e=>{e.exports=require("@modelcontextprotocol/sdk/server/stdio.js")},806:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ResourceTypeEnum=void 0,t.retrieveResource=function(e,t){const o=i[e];return`User question: "${t}"\n\n${o}`};const s=o(569);t.ResourceTypeEnum=s.z.enum(["documents","samples","issues","code"]);const i={documents:'To find Microsoft 365 agents and apps development documentation, use the Learn MCP server (https://learn.microsoft.com/api/mcp).\n\nRecommended workflow:\n1. Use the "microsoft_docs_search" tool to search for relevant Microsoft 365 and Copilot development documentation.\n2. Use the "microsoft_docs_fetch" tool to fetch full content from specific documentation URLs when you need deeper details.\n\nKey documentation areas:\n\n## Microsoft 365 Copilot Extensibility\nBuild agents for Microsoft 365 Copilot including declarative agents, API plugins, MCP plugins, and custom engine agents.\n- Overview: https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview\n- Agents overview: https://learn.microsoft.com/microsoft-365-copilot/extensibility/agents-overview\n- Planning guide: https://learn.microsoft.com/microsoft-365-copilot/extensibility/planning-guide\n- Declarative agents: https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview-declarative-agent\n- Build declarative agents: https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents\n- Declarative agent instructions: https://learn.microsoft.com/microsoft-365-copilot/extensibility/declarative-agent-instructions\n- API plugins: https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview-plugins\n- Build API plugins: https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-api-plugins-new-api\n- MCP plugins: https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-mcp-plugins\n- Custom engine agents: https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview-custom-engine-agent\n- Copilot connectors: https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview-copilot-connector\n- Copilot APIs: https://learn.microsoft.com/microsoft-365-copilot/extensibility/copilot-apis-overview\n\n### Agent Manifest References\n- Declarative agent manifest v1.6: https://learn.microsoft.com/microsoft-365-copilot/extensibility/declarative-agent-manifest-1.6\n- Plugin manifest v2.4: https://learn.microsoft.com/microsoft-365-copilot/extensibility/plugin-manifest-2.4\n- OpenAPI spec guidance: https://learn.microsoft.com/microsoft-365-copilot/extensibility/openapi-document-guidance\n- API plugin authentication: https://learn.microsoft.com/microsoft-365-copilot/extensibility/api-plugin-authentication\n\n## Microsoft Teams Platform (Apps & Bots)\nBuild Teams apps with tabs, bots, message extensions, webhooks, and meeting extensions.\n- Overview: https://learn.microsoft.com/microsoftteams/platform/overview\n- Build agents with Teams SDK: https://learn.microsoft.com/microsoftteams/platform/agents-in-teams/overview\n- Build your first agent: https://learn.microsoft.com/microsoftteams/platform/agents-in-teams/build-first-agent\n- Build bots: https://learn.microsoft.com/microsoftteams/platform/bots/overview\n- Build tabs: https://learn.microsoft.com/microsoftteams/platform/tabs/what-are-tabs\n- Message extensions: https://learn.microsoft.com/microsoftteams/platform/messaging-extensions/what-are-messaging-extensions\n- API-based message extensions: https://learn.microsoft.com/microsoftteams/platform/messaging-extensions/api-based-overview\n- Apps for meetings: https://learn.microsoft.com/microsoftteams/platform/apps-in-teams-meetings/teams-apps-in-meetings\n- Adaptive Cards: https://learn.microsoft.com/microsoftteams/platform/task-modules-and-cards/what-are-cards\n- App manifest schema: https://learn.microsoft.com/microsoftteams/platform/resources/schema/manifest-schema\n- Authentication (SSO): https://learn.microsoft.com/microsoftteams/platform/concepts/authentication/authentication\n- Extend across Microsoft 365: https://learn.microsoft.com/microsoftteams/platform/m365-apps/overview\n- MCP server connectors for agents: https://learn.microsoft.com/microsoftteams/platform/m365-apps/agent-connectors\n\n## Microsoft 365 Agents Toolkit\nThe toolkit for building, debugging, and deploying Microsoft 365 agents and apps.\n- Overview: https://learn.microsoft.com/microsoftteams/platform/toolkit/overview-agents-toolkit\n- Agents Toolkit for VS Code: https://learn.microsoft.com/microsoftteams/platform/toolkit/agents-toolkit-fundamentals\n- Install: https://learn.microsoft.com/microsoftteams/platform/toolkit/install-agents-toolkit\n- Create new project: https://learn.microsoft.com/microsoftteams/platform/toolkit/create-new-project\n- Debug overview: https://learn.microsoft.com/microsoftteams/platform/toolkit/debug-overview\n- Debug with Agents Playground: https://learn.microsoft.com/microsoftteams/platform/toolkit/debug-your-agents-playground\n- Provision cloud resources: https://learn.microsoft.com/microsoftteams/platform/toolkit/provision\n- Deploy to cloud: https://learn.microsoft.com/microsoftteams/platform/toolkit/deploy\n- Publish: https://learn.microsoft.com/microsoftteams/platform/toolkit/publish\n- CI/CD pipelines: https://learn.microsoft.com/microsoftteams/platform/toolkit/use-CICD-template\n- CLI: https://learn.microsoft.com/microsoftteams/platform/toolkit/microsoft-365-agents-toolkit-CLI\n\n## Microsoft 365 Agents SDK\nBuild custom engine agents with multi-language SDK support.\n- Overview: https://learn.microsoft.com/microsoft-365-copilot/extensibility/m365-agents-sdk\n- Create and deploy: https://learn.microsoft.com/microsoft-365-copilot/extensibility/create-deploy-agents-sdk\n\n## Other Key Resources\n- Microsoft Graph API: https://learn.microsoft.com/graph/\n- Bot Framework SDK: https://learn.microsoft.com/azure/bot-service/\n- Adaptive Cards: https://learn.microsoft.com/adaptive-cards/\n- Office Add-ins: https://learn.microsoft.com/office/dev/add-ins/overview/office-add-ins\n- Teams Store validation: https://learn.microsoft.com/microsoftteams/platform/concepts/deploy-and-publish/appsource/prepare/teams-store-validation-guidelines\n- Copilot validation guidelines: https://learn.microsoft.com/microsoftteams/platform/concepts/deploy-and-publish/appsource/prepare/review-copilot-validation-guidelines',samples:'To find code samples for Microsoft 365 agents and apps development, use the Learn MCP server (https://learn.microsoft.com/api/mcp).\n\nRecommended workflow:\n1. Use the "microsoft_code_sample_search" tool to search for official Microsoft code samples. You can optionally filter by language (e.g., "typescript", "csharp", "python").\n2. Use the "microsoft_docs_fetch" tool to fetch full sample details from a specific URL when needed.\n\nKey sample resources:\n- Copilot extensibility samples: https://learn.microsoft.com/microsoft-365-copilot/extensibility/samples\n- Teams platform tutorials and code samples: https://learn.microsoft.com/microsoftteams/platform/get-started/tool-options-and-code-samples\n\nKey sample repositories:\n\n## Microsoft 365 Agents SDK\n- microsoft/Agents: M365 Agents SDK samples (multi-language, includes Node.js samples under samples/**/nodejs/). https://github.com/microsoft/Agents\n- microsoft/Agents-for-js: M365 Agents SDK for JavaScript samples. https://github.com/microsoft/Agents-for-js\n\n## Microsoft Teams Samples & SDK\n- OfficeDev/Microsoft-Teams-Samples: Official Microsoft Teams app samples covering bots, tabs, message extensions, meetings, and more (Node.js/JS/TS). https://github.com/OfficeDev/Microsoft-Teams-Samples\n- microsoft/teams-ai: Teams SDK (formerly Teams AI library) JavaScript samples under js/samples/. https://github.com/microsoft/teams-ai\n\n## Microsoft 365 Agents Toolkit\n- OfficeDev/microsoft-365-agents-toolkit: Toolkit project templates (JS/TS) under templates/. https://github.com/OfficeDev/microsoft-365-agents-toolkit\n- OfficeDev/microsoft-365-agents-toolkit-samples: Scenario-focused sample apps built with the Agents Toolkit. https://github.com/OfficeDev/microsoft-365-agents-toolkit-samples',issues:'To find and troubleshoot issues related to Microsoft 365 agents and apps development, use the GitHub MCP server (https://api.githubcopilot.com/mcp/).\n\nRecommended workflow:\n1. Use the GitHub MCP server tools to search for issues in the relevant repositories listed below.\n2. Search both open and closed issues for relevant error messages or keywords.\n3. Check issue comments for workarounds and solutions.\n4. When searching, exclude issues with labels like "cherry-pick-hotfix" or "invalid" as they are not relevant.\n\nRepositories to search:\n\n## Core Toolkit & Samples\n- OfficeDev/microsoft-365-agents-toolkit: The core toolkit (VS Code extension, CLI, fx-core) for building, debugging, and deploying Microsoft 365 agents and apps. Exclude labels: cherry-pick-hotfix, invalid.\n- OfficeDev/microsoft-365-agents-toolkit-samples: Scenario-focused sample apps built with the Agents Toolkit. Exclude labels: invalid.\n- OfficeDev/Microsoft-Teams-Samples: Official Microsoft Teams app samples covering bots, tabs, message extensions, meetings, and more. Exclude labels: invalid.\n\n## Teams SDK (formerly Teams AI library)\n- microsoft/teams-sdk: Main repo for the Teams SDK with docs and cross-language issues. Exclude labels: invalid.\n- microsoft/teams.ts: Teams SDK TypeScript implementation (language-specific bugs). Exclude labels: invalid.\n- microsoft/teams.net: Teams SDK .NET implementation (language-specific bugs). Exclude labels: invalid.\n- microsoft/teams.py: Teams SDK Python implementation (language-specific bugs). Exclude labels: invalid.\n- microsoft/teams-agent-accelerator-templates: Open-source agent accelerator templates for the Teams SDK. Exclude labels: invalid.\n\n## Documentation\n- MicrosoftDocs/msteams-docs: Microsoft Teams platform documentation issues and feedback. Exclude labels: invalid.\n- MicrosoftDocs/m365copilot-docs: Microsoft 365 Copilot extensibility documentation issues. Exclude labels: invalid.\n- OfficeDev/office-js-docs-pr: Office Add-ins documentation issues. Exclude labels: invalid.\n\nAlso check these resources for known issues:\n- Copilot extensibility known issues: https://learn.microsoft.com/microsoft-365-copilot/extensibility/known-issues\n- Teams platform troubleshooting: https://learn.microsoft.com/microsoftteams/platform/resources/troubleshoot\n- Teams Toolkit FAQ: https://learn.microsoft.com/microsoftteams/platform/toolkit/faq',code:'To find code snippets and SDK usage examples for Microsoft 365 agents and apps development, use the Learn MCP server (https://learn.microsoft.com/api/mcp).\n\nRecommended workflow:\n1. Use the "microsoft_code_sample_search" tool to find implementation examples for SDKs such as @microsoft/teams-ai, @microsoft/teams-js, and botbuilder. You can optionally filter by language.\n2. Use the "microsoft_docs_search" tool to find documentation pages with embedded code examples.\n3. Use the "microsoft_docs_fetch" tool to retrieve full code examples from specific documentation URLs.\n\nKey SDKs and references:\n\n## Teams SDK (Teams AI Library)\nAI-powered Teams bot and agent development.\n- Getting started: https://learn.microsoft.com/microsoftteams/platform/teams-ai-library/welcome\n- Build your first agent: https://learn.microsoft.com/microsoftteams/platform/agents-in-teams/build-first-agent\n- TypeScript SDK reference: https://learn.microsoft.com/javascript/api/teams-sdk-typescript\n- .NET SDK reference: https://learn.microsoft.com/dotnet/api/?view=msteams-sdk-dotnet-latest\n\n## Microsoft 365 Agents SDK\nMulti-language SDK for building custom engine agents.\n- .NET SDK: https://learn.microsoft.com/dotnet/api/?view=m365-agents-sdk\n- JavaScript SDK: https://learn.microsoft.com/javascript/api/overview/agents-overview?view=agents-sdk-js-latest\n- Python SDK: https://learn.microsoft.com/python/api/agent-sdk-python/agents-overview?view=agent-sdk-python-latest\n\n## Other SDKs\n- @microsoft/teams-js (Teams JavaScript client library): https://learn.microsoft.com/microsoftteams/platform/tabs/how-to/using-teams-client-library\n- TeamsFx SDK: https://learn.microsoft.com/microsoftteams/platform/toolkit/TeamsFx-SDK\n- botbuilder (Bot Framework SDK for Node.js): https://github.com/Microsoft/botbuilder-js\n- Microsoft.Bot.Builder (Bot Framework SDK for .NET): https://github.com/Microsoft/botbuilder-dotnet\n- Microsoft Graph SDKs: https://learn.microsoft.com/graph/sdks/sdks-overview'}}},t={};function o(s){var i=t[s];if(void 0!==i)return i.exports;var n=t[s]={exports:{}};return e[s](n,n.exports,o),n.exports}(()=>{const e=o(802),t=o(589);(async function(){const o=(0,t.createServer)(),s=new e.StdioServerTransport;await o.connect(s)})().catch((e=>{console.error("Fatal error in main():",e),process.exit(1)}))})()})(); //# sourceMappingURL=index.js.map