m365-atk-mcp-server
Version:
MCP server for Microsoft 365 Agents Toolkit
3 lines • 9.29 kB
JavaScript
(()=>{"use strict";var e={569:e=>{e.exports=require("zod")},737:e=>{e.exports=require("@modelcontextprotocol/sdk/server/mcp.js")},802:e=>{e.exports=require("@modelcontextprotocol/sdk/server/stdio.js")},997:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createServer=void 0;const a=o(737),n=o(569);t.createServer=function(){const e=new a.McpServer({name:"atk-cli-mcp",version:"0.1.0"});return e.tool("create_template","Guide users on how to create Microsoft 365 applications and agents using the Microsoft 365 Agents Toolkit CLI. Provides step-by-step instructions for using 'atk new' command with various template options.",{capability:n.z.enum(["declarative-agent","basic-custom-engine-agent","weather-agent","custom-copilot-basic","custom-copilot-rag","custom-copilot-agent","bot","notification","command-bot","workflow-bot","tab-non-sso","sso-launch-page","dashboard-tab","tab-spfx","search-app","collect-form-message-extension","link-unfurling","wxp-json-taskpane","outlook-json-taskpane"]).describe("App feature/capability to create. Use 'atk list templates' to see all available options."),programming_language:n.z.enum(["javascript","typescript","csharp"]).optional().describe("Programming language preference (default: javascript)"),bot_host_type_trigger:n.z.enum(["http-express","http-webapi","http-and-timer-functions"]).optional().describe("Trigger for Chat Notification Message app template (default: http-express)"),spfx_solution:n.z.enum(["new","import"]).optional().describe("Create new or import existing SharePoint Framework solution (default: new)"),spfx_framework_type:n.z.enum(["react","minimal","none"]).optional().describe("SharePoint Framework type (default: react)"),spfx_webpart_name:n.z.string().optional().describe("Name for SharePoint Framework Web Part (default: helloworld)"),me_architecture:n.z.enum(["new-api","api-spec","bot"]).optional().describe("Architecture of Search Based Message Extension (default: new-api)"),with_plugin:n.z.enum(["no","yes"]).optional().describe("Whether to add API plugin for declarative Copilot (default: no)"),api_plugin_type:n.z.enum(["new-api","api-spec","existing-plugin"]).optional().describe("API plugin type (default: new-api)"),api_auth:n.z.enum(["none","api-key","bearer-token"]).optional().describe("Authentication type for the API (default: none)"),custom_copilot_rag:n.z.enum(["custom-copilot-rag-customize","custom-copilot-rag-azureAISearch","custom-copilot-rag-customApi"]).optional().describe("Chat With Your Data option (default: custom-copilot-rag-customize)"),custom_copilot_agent:n.z.enum(["custom-copilot-agent-new","custom-copilot-agent-assistants-api"]).optional().describe("AI Agent option (default: custom-copilot-agent-new)"),llm_service:n.z.enum(["llm-service-azure-openai","llm-service-openai"]).optional().describe("Service for Large Language Model (default: llm-service-azure-openai)"),app_name:n.z.string().describe("Application name (required)"),folder:n.z.string().optional().describe("Directory where the project folder will be created (default: ./)")},async({capability:e,programming_language:t="javascript",bot_host_type_trigger:o="http-express",spfx_solution:a="new",spfx_framework_type:n="react",spfx_webpart_name:i="helloworld",me_architecture:r="new-api",with_plugin:s="no",api_plugin_type:l="new-api",api_auth:c="none",custom_copilot_rag:p="custom-copilot-rag-customize",custom_copilot_agent:m="custom-copilot-agent-new",llm_service:u="llm-service-azure-openai",app_name:g,folder:d="./"})=>{let f=`atk new -c ${e} -l ${t} -n ${g} -i false`;switch("./"!==d&&(f+=` -f "${d}"`),e){case"declarative-agent":"yes"===s&&(f+=` --with-plugin yes --api-plugin-type ${l}`,"none"!==c&&(f+=` --api-auth ${c}`));break;case"basic-custom-engine-agent":case"weather-agent":case"custom-copilot-basic":f+=` --llm-service ${u}`;break;case"custom-copilot-rag":f+=` --custom-copilot-rag ${p} --llm-service ${u}`;break;case"custom-copilot-agent":f+=` --custom-copilot-agent ${m} --llm-service ${u}`;break;case"notification":f+=` -t ${o}`;break;case"tab-spfx":f+=` -s ${a} -k ${n}`,"helloworld"!==i&&(f+=` -w ${i}`);break;case"search-app":case"collect-form-message-extension":f+=` -m ${r}`}return{content:[{type:"text",text:`To create a ${e} application named "${g}", run the following command:\n\n\`\`\`\n${f}\n\`\`\`\n\nThis command will create a new Microsoft 365 application with the following configuration:\n- Capability: ${e}\n- Programming Language: ${t}\n- Application Name: ${g}\n- Target Directory: ${d}${"declarative-agent"===e&&"yes"===s?`\n- With API Plugin: ${l}`:""}${["basic-custom-engine-agent","weather-agent","custom-copilot-basic","custom-copilot-rag","custom-copilot-agent"].includes(e)?`\n- LLM Service: ${u}`:""}${"custom-copilot-rag"===e?`\n- RAG Type: ${p}`:""}${"custom-copilot-agent"===e?`\n- Agent Type: ${m}`:""}${"notification"===e?`\n- Host Type: ${o}`:""}${"tab-spfx"===e?`\n- SPFx Solution: ${a}\n- Framework Type: ${n}`:""}${["search-app","collect-form-message-extension"].includes(e)?`\n- Architecture: ${r}`:""}\n\nMake sure you have the Microsoft 365 Agents Toolkit CLI installed before running this command.`}]}}),e.tool("create_sample","Guide users on how to create Microsoft 365 applications from existing samples using the Microsoft 365 Agents Toolkit CLI. Provides instructions for using 'atk sample' command.",{sample_name:n.z.string().describe("Name of the sample to create from"),app_name:n.z.string().describe("Application name (required)"),programming_language:n.z.enum(["javascript","typescript","csharp"]).optional().describe("Programming language preference (default: javascript)"),folder:n.z.string().optional().describe("Directory where the project folder will be created (default: ./)")},async({sample_name:e,app_name:t,programming_language:o="javascript",folder:a="./"})=>{let n=`atk sample ${e} -n ${t} -l ${o} -i false`;return"./"!==a&&(n+=` -f "${a}"`),{content:[{type:"text",text:`To create an application named "${t}" from the "${e}" sample, run the following command:\n\n\`\`\`\n${n}\n\`\`\`\n\nThis command will create a new Microsoft 365 application with the following configuration:\n- Sample: ${e}\n- Application Name: ${t}\n- Programming Language: ${o}\n- Target Directory: ${a}\n\nMake sure you have the Microsoft 365 Agents Toolkit CLI installed before running this command. You can use 'atk list samples' to see all available samples.`}]}}),e.tool("list_templates_and_samples","Get information about available templates and samples in the Microsoft 365 Agents Toolkit CLI.",{list_type:n.z.enum(["templates","samples","both"]).describe("What to list: templates, samples, or both")},async({list_type:e})=>{let t="",o="";switch(e){case"templates":t="atk list templates",o="To list all available templates, run:";break;case"samples":t="atk list samples",o="To list all available samples, run:";break;case"both":t="atk list templates && atk list samples",o="To list all available templates and samples, run:"}return{content:[{type:"text",text:`${o}\n\n\`\`\`\n${t}\n\`\`\`\n\nThis will show you all available ${e} that you can use with the Microsoft 365 Agents Toolkit CLI.\n\nMake sure you have the Microsoft 365 Agents Toolkit CLI installed before running this command.`}]}}),e.tool("preview_app","Guide users on how to preview and test their Microsoft 365 applications and agents using the Microsoft 365 Agents Toolkit CLI. Provides instructions for local and remote preview options.",{environment:n.z.enum(["local","remote"]).describe("Environment to preview the app in (local development or remote/cloud)"),host_app:n.z.enum(["teams","outlook","office"]).optional().describe("Microsoft 365 host application to preview in (default: teams)"),browser:n.z.enum(["chrome","edge","default"]).optional().describe("Browser to use for preview (default: default)"),desktop_client:n.z.boolean().optional().describe("Use desktop client instead of web client (default: false)")},async({environment:e,host_app:t="teams",browser:o="default",desktop_client:a=!1})=>{let n=`atk preview --env ${e}`;return"teams"!==t&&(n+=` --m365-host ${t}`),"default"!==o&&(n+=` --browser ${o}`),a&&(n+=" --desktop"),{content:[{type:"text",text:`To preview your Microsoft 365 application in the ${e} environment, run the following command:\n\n\`\`\`\n${n}\n\`\`\`\n\nThis command will start the preview with the following configuration:\n- Environment: ${e}\n- Host Application: ${t}\n- Browser: ${o}${a?"\n- Client Type: Desktop":"\n- Client Type: Web"}\n\n${"local"===e?"For local development, this will start your application and open it in the specified Microsoft 365 host. Make sure your development server is ready to run.":"For remote preview, this will open your deployed application in the specified Microsoft 365 host."}\n\nMake sure you have the Microsoft 365 Agents Toolkit CLI installed and your application is properly configured before running this command.`}]}}),e}}},t={};function o(a){var n=t[a];if(void 0!==n)return n.exports;var i=t[a]={exports:{}};return e[a](i,i.exports,o),i.exports}(()=>{const e=o(802),t=o(997);(async function(){const o=(0,t.createServer)(),a=new e.StdioServerTransport;await o.connect(a)})().catch(e=>{console.error("Fatal error in main():",e),process.exit(1)})})()})();
//# sourceMappingURL=index.js.map