@microsoft/m365agentstoolkit-mcp
Version:
MCP server for Microsoft 365 Agents Toolkit
3 lines • 4.85 kB
JavaScript
(()=>{"use strict";var e={292:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.fetchSchema=t.clearSchemaCache=t.SchemaTypeEnum=void 0;const s=o(569);t.SchemaTypeEnum=s.z.enum(["app_manifest","declarative_agent_manifest","api_plugin_manifest","m365_agents_yaml"]);const r={app_manifest:{baseUrl:"https://developer.microsoft.com/json-schemas/teams/{{version}}/MicrosoftTeams.schema.json",latestVersion:"v1.22"},declarative_agent_manifest:{baseUrl:"https://developer.microsoft.com/json-schemas/copilot/declarative-agent/{{version}}/schema.json",latestVersion:"v1.4"},api_plugin_manifest:{baseUrl:"https://developer.microsoft.com/json-schemas/copilot/plugin/{{version}}/schema.json",latestVersion:"v2.3"},m365_agents_yaml:{baseUrl:"https://aka.ms/teams-toolkit/{{version}}/yaml.schema.json",latestVersion:"v1.8"}},n={};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=r[e];if(!s)return`Unknown schema name: ${e}`;try{"latest"===t&&(t=s.latestVersion);const e=s.baseUrl.replace("{{version}}",t),r=await fetch(e);if(!r.ok)throw new Error(`HTTP error with status: ${r.status}`);const a=await r.json(),i=JSON.stringify({schema_url:e,content:a});return n[o]=i,i}catch(e){return`Failed fetching schema at version: ${t}, error: ${e instanceof Error?e.message:String(e)}. Try different version.`}}},373:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.retrieveResource=t.ResourceTypeEnum=void 0;const s=o(569);t.ResourceTypeEnum=s.z.enum(["documents","samples","issues","code"]),t.retrieveResource=async function(e,t){try{const o=process.env.RETRIEVER_API_ENDPOINT||Buffer.from("aHR0cHM6Ly9hZmQtd20zZGg1amM2NzU1cy1wcm9kLWhrZndnYmJqYjVhN2hyYnUuYjAxLmF6dXJlZmQubmV0L3JldHJpZXZlcg==","base64").toString("utf-8"),s=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({resource_type:e,question:t})});if(!s.ok)return`Fail to retrieve resource, ${s.status}: ${s.statusText}`;return(await s.json()).data}catch(e){return`Error retrieving resource: ${e instanceof Error?e.message:"Unknown error occurred"}`}}},569:e=>{e.exports=require("zod")},737:e=>{e.exports=require("@modelcontextprotocol/sdk/server/mcp.js")},752:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createServer=void 0;const s=o(737),r=o(569),n=o(292),a=o(373);t.createServer=function(){const e=new s.McpServer({name:"m365agentstoolkit-mcp",version:"0.1.0"});return e.tool("get_schema",'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.',{schema_name:n.SchemaTypeEnum.describe("name of schema"),schema_version:r.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.tool("get_knowledge","Access comprehensive knowledge about Microsoft 365 and Microsoft 365 Copilot development. Use this tool everytime for questions related to Microsoft 365 and Microsoft 365 Copilot.",{question:r.z.string().describe("Question to use for knowledge retrieval")},(async({question:e})=>({content:[{type:"text",text:await(0,a.retrieveResource)("documents",e)}]}))),e.tool("get_code_snippets","Access templates and code snippets for Microsoft 365 and Microsoft 365 Copilot development, focusing on SDKs such as **@microsoft/teams-ai**, **@microsoft/teams-js**, and **botbuilder**. Use this tool when looking for implementation examples, starter templates, or SDK usage patterns.",{question:r.z.string().describe("Query to find relevant code snippets related to Microsoft 365 app or agent SDKs")},(async({question:e})=>({content:[{type:"text",text:await(0,a.retrieveResource)("code",e)}]}))),e.tool("troubleshoot","Access troubleshooting solutions for common Microsoft 365 and Microsoft 365 Copilot development issues. Use this tool when encountering errors, unexpected behaviors, or implementation challenges.",{question:r.z.string().describe("Description of the issue or error you're experiencing")},(async({question:e})=>({content:[{type:"text",text:await(0,a.retrieveResource)("issues",e)}]}))),e}},802:e=>{e.exports=require("@modelcontextprotocol/sdk/server/stdio.js")}},t={};function o(s){var r=t[s];if(void 0!==r)return r.exports;var n=t[s]={exports:{}};return e[s](n,n.exports,o),n.exports}(()=>{const e=o(802),t=o(752);(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