Copilot Archives -

Category Archives: Copilot

Connecting Your MCP Server to Microsoft Copilot Studio – Part 2

In Part 1, we built a simple MCP server in TypeScript that exposed a “getWeather” tool. Now, let’s take the next step: connecting our MCP server to Microsoft Copilot Studio so that Copilot agents can call it directly. This section will cover: Step 1 — Publish Your MCP Server to Azure To make your MCP server accessible to Copilot Studio, you’ll need to host it online. There are multiple ways to deploy it — Azure App Service, Azure Container Apps, or even Azure Functions if you prefer serverless. For example, using Azure App Service: Test using curl to ensure it responds with MCP-compatible JSON: Step 2 — Create a New Copilot in Copilot Studio Step 3 — Add Knowledge Sources Optionally, you can enrich your Copilot by adding: This gives your Copilot a baseline knowledge to answer broader questions, while the MCP server will handle specific tasks (like fetching live weather data). Step 4 — Create a Custom Connector in Dataverse To let Copilot Studio talk to our MCP server, we need a custom connector inside Dataverse/CRM. Step 5 — Add the Custom Connector to Copilot Studio you’ll see the MCP server in your Tools section of copilot. To test the setup, let’s ask Copilot: “What’s the current weather in Mumbai?” On the first attempt, Copilot will prompt you to establish a connection. Simply open the Connection Manager, click Connect, and authorize the link to your MCP server. Once connected, Copilot will fetch the live weather details for Mumbai directly from your MCP server. and click retry on the Test window of your copilot. And just like that, your MCP server is live and fully integrated. It can now provide real-time weather updates for any city mentioned in your conversation with Copilot. You can try out different variations of questions or phrasings — Copilot will intelligently interpret your request, extract the city name, and seamlessly call the MCP server to deliver accurate weather details. Beyond Weather: Business Integrations The same process works for enterprise systems. For example, instead of getWeather, you could expose: By publishing these tools via MCP, your Copilot becomes a true enterprise assistant, capable of pulling structured business data and triggering workflows on demand. We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfronts.com.

Share Story :

Creating an MCP Server Using TypeScript

As artificial intelligence continues to transform how we build and interact with software, AI agents are emerging as the new interface for users. Instead of clicking through menus or filling out forms, users can simply instruct agents to fetch reports, analyze datasets, or trigger workflows. The challenge is: how do these agents access external tools, APIs, or enterprise systems in a secure and standardized way? This is where the Model Context Protocol (MCP) comes into play. MCP is a protocol designed to connect AI agents to tools in a structured, consistent manner. Instead of building ad-hoc integrations for each agent and each tool, developers can expose their tools once via MCP — making them discoverable and callable by any MCP-compliant AI agent. In this article, we’ll explore: What an MCP server is and how it works a) How MCP uses JSON-RPC 2.0 as its communication layer b) How MCP solves the M×N integration problem c) How to implement a simple Weather Data MCP server in TypeScript d) How to test it locally using Postman or cURL What is an MCP Server? An MCP server is an HTTP or WebSocket endpoint that follows the Model Context Protocol, allowing AI systems to query, interact with, and call tools hosted by developers. MCP consists of several components: -Base Protocol – Core JSON-RPC message types -Lifecycle Management – Connection initialization, capability negotiation, and session handling -Server Features – Resources, prompts, and tools exposed by servers -Client Features – Sampling and root directory lists provided by clients -Utilities – Cross-cutting features such as logging or argument completion All MCP implementations must support the Base Protocol and Lifecycle Management. Other features are optional depending on the use case. Architecture: JSON-RPC 2.0 in MCP MCP messages follow the JSON-RPC 2.0 specification — a stateless, lightweight remote procedure call protocol that uses JSON for request and response payloads. Request format: json Copy Edit {   “jsonrpc”: “2.0”,   “id”: 1,   “method”: “methodName”,   “params”: {     “key”: “value”   } } id is required, must be a string or number, and must be unique within the session. method specifies the operation. params contains the method arguments. Response format: json Copy Edit {   “jsonrpc”: “2.0”,   “id”: 1,   “result”: {     “key”: “value”   } } Or, if an error occurs: json Copy Edit {   “jsonrpc”: “2.0”,   “id”: 1,   “error”: {     “code”: -32603,     “message”: “Internal error”   } } The ID must match the request it is responding to. The M×N Problem and How MCP Solves It. Without MCP, connecting M AI agents to N tools requires M×N separate integrations. This is inefficient and unscalable. With MCP, each agent implements a single MCP client, and each tool implements a single MCP server. Agents and tools can then communicate through a shared protocol, reducing integration effort from M×N to M+N. Project Setup Create the project directory: mkdir weather-mcp-sdk cd weather-mcp-sdk npm init -y Install dependencies: npm install @modelcontextprotocol/sdk zod axios express npm install –save-dev typescript ts-node @types/node @types/express npx tsc –init Implementing the Weather MCP Server We’ll use the WeatherAPI to fetch real-time weather data for a given city and expose it via MCP as a getWeather tool. src/index.ts import express from “express”; import axios from “axios”; import { McpServer } from “@modelcontextprotocol/sdk/server/mcp.js”; import { StreamableHTTPServerTransport } from “@modelcontextprotocol/sdk/server/streamableHttp.js”; import { z } from “zod”; const API_KEY = “YOUR_WEATHER_API_KEY”; // replace with your API key function getServer() {   const server = new McpServer({     name: “Weather MCP Server”,     version: “1.0.0”,   });   server.tool(     “getWeather”,     { city: z.string() },     async ({ city }) => {       const res = await axios.get(“http://api.weatherapi.com/v1/current.json”, {         params: { key: API_KEY, q: city, aqi: “no” },       });       const data = res.data;       return {         content: [           {             type: “text”,             text: `Weather in ${data.location.name}, ${data.location.country}: ${data.current.temp_c}°C, ${data.current.condition.text}`,           },         ],       };     }   );   return server; } const app = express(); app.use(express.json()); app.post(“/mcp”, async (req, res) => {   try {     const server = getServer();     const transport = new StreamableHTTPServerTransport({});     res.on(“close”, () => {       transport.close();       server.close();     });     await server.connect(transport);     await transport.handleRequest(req, res, req.body);   } catch (error) {     if (!res.headersSent) {       res.status(500).json({         jsonrpc: “2.0”,         error: { code: -32603, message: “Internal server error” },         id: null,       });     }   } }); const PORT = 3000; app.listen(PORT, () => {   console.log(`MCP Stateless HTTP Server running at http://localhost:${PORT}/mcp`); }); Testing the MCP Server Since MCP requires specific request formats and content negotiation, use Content-Type: application/json and Accept: application/json, text/event-stream headers. Step 1 — Initialize curl -X POST http://localhost:3000/mcp \   -H “Content-Type: application/json” \   -H “Accept: application/json, text/event-stream” \   -d ‘{     “jsonrpc”: “2.0”,     “id”: 1,     “method”: “initialize”,     “params”: {       “protocolVersion”: “2025-06-18”,       “capabilities”: { “elicitation”: {} },       “clientInfo”: { “name”: “example-client”, “version”: “1.0.0” }     }   }’ Example response: {   “jsonrpc”: “2.0”,   “id”: 1,   “result”: {     “protocolVersion”: “2025-06-18”,     “capabilities”: { “tools”: { “listChanged”: true } },     “serverInfo”: { “name”: “Weather MCP Server”, “version”: “1.0.0” }   } } Step 2 — Call the getWeather Tool curl -X POST http://localhost:3000/mcp \   -H “Content-Type: application/json” \   -H “Accept: application/json, text/event-stream” \   -d ‘{     “jsonrpc”: “2.0”,     “id”: 2,     “method”: “tools/call”,     “params”: {       “name”: “getWeather”,       “arguments”: { “city”: “London” }     }   }’ Example response: {   “jsonrpc”: “2.0”,   “id”: 2,   “result”: {     “content”: [       {         “type”: “text”,         “text”: “Weather in London, United Kingdom: 21°C, Partly cloudy”       }     ]   } } To conclude, we have built an MCP-compliant server in TypeScript that exposes a weather-fetching tool over HTTP. This simple implementation demonstrates: How to define and register tools with MCP How JSON-RPC 2.0 structures communication, and how to make your server compatible with any MCP-compliant AI agent. From here, you … Continue reading Creating an MCP Server Using TypeScript

Share Story :

How We Built Smart Pitch — and What We Learned Along the Way

In today’s world, AI is no longer a luxury—it’s a necessity for driving smarter decisions, faster innovation, and personalized experiences. We have come up with our requirements for AI to support the conversion from MQL (Marketing Qualified Lead) to SQL (Sales Qualified Lead). How did the idea originate? In our organization, whenever a prospect reaches out to us, we search for company information like company size, revenue, location, industry type, contact person details, designation, decision-maker, and LinkedIn profile. This information helps the Sales team prepare better and deliver a stronger pitch by understanding the customer before the call. Also, during the MQL to SQL stage, we look for things like: This information helps the Sales team convert the prospect into a client and increases our chances of winning the deal. Earlier, this entire process was manual and time-consuming. So, we decided to automate it with an AI agent that can gather this information for us in just a few minutes. Implementation approach After the project was approved internally, we started exploring how to make it happen. Initially, we didn’t know where or how to start. During our research, we came across Copilot Studio, which allows us to build custom agents from scratch based on our needs. We learned about Copilot Studio’s and began building our agent. We named it Elevator Pitch. Version 1 Highlights: This feedback led to the idea for Version 2, which would automate more steps and also pull information from the internet. Version 2 Enhancements: Version 2 Features: Company & Contact information with a single click on MQL to SQL, the agent now generates the document within minutes—something that earlier used to take hours or even a full day. Live demo in Zurich & New York On 22nd May 2025, we had an event scheduled at the Microsoft office in Zurich with one of our clients, where we shared the Buchi journey with CloudFronts. We discussed how we collaborated to connect their multiple systems and prepared their data for insights and AI initiatives. At the same event, we had the opportunity to demonstrate our Smart Pitch product, which caught the audience’s attention. It was a proud moment for us to showcase our first AI product at the Microsoft office—delivered within just a few months of hard work. Our second opportunity came on 06 June 2025 in New York, at the AI Community Conference, where we presented again in front of a global audience. What Next in Version 3: So far, we have built this solution using Microsoft’s inbuilt Knowledge Center, ChatGPT API, SharePoint, company websites, and Dataverse. Since we were working with both structured and unstructured data, we faced some inconsistencies and performance issues. This led us to reflect and identify the need for Version 3 (V3), which will include: The development of Smart Pitch V3 is currently in progress. We’ll share our thoughts once it goes live. A demo video has also been shared, so you can see how smart and fast our Agent is at delivering useful insights. Delivering Answers in Minutes—Thanks to Smart Pitch I’d also like to share a quick story. One day, our Practice Manager was on leave, and we received a prospect inquiry about Project Operations to Business Central (PO-BC) pricing. I wasn’t sure where that information was stored, and suddenly our CEO asked me for the details. I was a bit stressed, unsure where to search or how to respond. Then I decided to ask our Smart Pitch agent the same question. To my surprise, the agent quickly gave me the exact information I needed. It was a big relief, and I was able to share the details with our CEO in just a few minutes—without even knowing where the document was uploaded. We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfonts.com.

Share Story :

Transforming Development: How Copilot is Revolutionizing Developer Productivity

Software development has been around since the 1940s.We started with punch cards, then machine language, followed by assembly, high-level programming languages, low code, no code, and now AI-assisted coding. Along the way, several tools have been developed to make programmers’ jobs easier, from card sorters and verifiers to debuggers and IDEs. Now, with the advent of AI, we have large language models (LLMs) writing code for us, but I don’t think it’s quite there yet. In this article we’ll see how AI assists developers, what it can do for us today, its limitations, and where it’s headed. The concept of AI began in the 1950s when researchers tried to imbue machines with the magic to think. Early systems followed set rules, but as computers improved and data became more available, smarter methods emerged, such as machine learning, natural language processing, and neural networks. Large Language Models (LLMs) grew from these advances, using huge amounts of data and computing power to understand and create language. This marked a shift from fixed rules to models that learn on their own. By 2025, AI has taken root in most fields, even in places we might not have expected.For example, robotic bees — tiny drones designed to mimic bee behavior, are now being used to assist with pollination in areas where natural bee populations are struggling. These drones combine machine learning and computer vision for navigation, flight control, pollination strategies, and swarm intelligence. Usage Copilot is integrated with both Visual Studio Code and Visual Studio, and it comes with a few LLMs built in by default.Currently, these include Claude Sonnet 3.5, GPT-4o, o3-mini, and Gemini Flash 2.0.If you want to add more models, you’ll need a subscription for Copilot Pro. We can use Copilot Chat to prompt these models directly in the sidebar chat, whether to generate a specific functionality or create an entirely new file. Here, I asked it to create a simple sales order.Notably, it kept the key details — Customer, Item, and Quantity — as parameters without requiring any input. From here, we can click a button to apply the changes to the open file. At the bottom, we can see which file Copilot is currently using as a reference.If we want to stop Copilot from referencing that file, we can click the eye button. We can also ask it to make changes to the generated code. Now, I noticed that while it has parameterized the “Customer No.” for the sales order, it hasn’t actually used it anywhere in the code. If I point this out to Copilot… Instead of using Copilot Chat, we can also get recommendations directly within the file.Here, I’m trying to write a function to delete a sales order based on the given SO No. I can just tab my way into writing the method. One common way I’ve used copilot is to add Guard clauses to methods that I’ve written. For instance –  Here, it is referring to Customer and Item record variables, which don’t exist yet. But if I go to the variables section then it knows what I’m trying to do and suggests the same. Now, if I were to make it handle something complex, that’s when the cracks start to show. For example, pulling data from an API and creating customers would require several steps — authenticating with the API, fetching the data, parsing it, handling errors or logging, and finally creating the customers. We get the following as an output – Here, we can see that while it has a surface-level understanding of the code structure and the steps needed to achieve the goal, it struggles with the details. This could be because, unlike open-source languages like Java, Python, or C++, there isn’t as much publicly available source code for AL. I believe Microsoft Documentation would have helped to some degree, but instead, it tends to guess what the correct methods or fields should be. To its credit, the generated code isn’t far off from being functional, especially considering the simplicity of the input prompt. The structure it provides is still a solid starting point and much better than writing everything from scratch. Another example of these “hallucinations” is when it suggests methods that don’t actually exist, like this- However, once you show it what the correct method is, it suggests that –  To go one step further, I asked the different models to create an entire project based on the below prompt –  Findings: o3-mini 1. The objects it generated had the fewest errors.2. It was the simplest and closest to compiling successfully.3. It returned all the text in a single response, so I had to manually create files from it. GPT-4o 1. Created a Readme.md with project requirement details.2. Automatically generated the necessary project files.3. Farthest from compiling successfully, with most requirements missed.4. There were plenty of hallucinations, including methods that don’t exist in AL at all – like this example below. Gemini Flash 2.0 1. Created a Readme.md with project requirement details.2. Automatically generated the necessary project files.3. Added launch.json, settings.json, and app.json.4. Didn’t meet all requirements but managed to lay some groundwork.5. Struggled with code structure in several places, though still significantly better than GPT-4o.6. Had at least a couple of pages with zero errors. Claude Sonnet 3.5 1. Created a Readme.md with project requirement details.2. Automatically generated the necessary project files.3. Added launch.json and app.json.4. Included a test codeunit, though it had errors.5. Created a permission set for the objects generated.6. All files had one or more errors. In my opinion, Claude and o3-mini are the most useful for coding assistance. HumanEval is a test developed by OpenAI to assess how well language models can write code.It includes 164 programming problems where the model must generate accurate and functional Python code. The HumanEval leaderboard aligns with my assessment as well. Pricing While all these models offer a free trial with a limited set of tokens, they can become quite expensive if you don’t monitor your usage. Below … Continue reading Transforming Development: How Copilot is Revolutionizing Developer Productivity

Share Story :

PowerApps Copilot: Transforming Formula Creation with New Features

Posted On January 28, 2025 by Ethan Rebello Posted in Tagged in ,

Introduction PowerApps continues to evolve with new features that simplify formula creation and make app development more accessible for everyone. The recent updates bring innovative tools like natural language-based Power Fx formula generation and enhanced formula explanations. In this blog, we’ll explore these new features and provide actionable tips and tricks to help you leverage them effectively in your apps. 1. Generate Power Fx Formulas Using Natural Language One of the standout updates is the ability to create Power Fx formulas using natural language instructions. This feature is perfect for both beginners and experienced developers looking to save time. How It Works: Practical Tip: Use natural language for complex formulas that are hard to write manually, such as: This approach accelerates formula creation, reduces errors, and lowers the learning curve for new users. 2. Enhanced Formula Explanation for Better Understanding Have you ever been puzzled by a long or intricate formula? The enhanced formula explanation feature can help by providing plain language explanations for selected parts of a formula. How It Works: Practical Tip: 3. Multi-Language Support in Formula Generation With the growing global adoption of PowerApps, formula generation now supports multiple languages. This feature ensures that users can work comfortably in their preferred language. How It Works: Practical Tip: Use this feature when collaborating with teams across regions. It allows contributors to describe actions in their native language, making formula generation inclusive and efficient. 4. Speed Up App Development with AI Assistance AI-based suggestions in the formula bar aren’t just for natural language inputs. They can help optimize existing formulas and suggest best practices as you build. How It Works: Practical Tip: Examples below Hope this helps Conclusion The latest PowerApps formula updates are game changers for app developers. From generating formulas with natural language to debugging them with enhanced explanations, these features simplify app development and make PowerApps more accessible to users of all skill levels. We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfonts.com.

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange