web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Custom connector not a...
Copilot Studio
Suggested Answer

Custom connector not able to connect with MCP Server built in C# .NET SDK

(3) ShareShare
ReportReport
Posted on by

I have created an MCP Server in .NET C# SDK and deployed via Visual Studio in Azure. However, while creating the custom connection in Power App Platform, I am not able to test the connection successfully. Kindly help with correct specification for MCP Server custom connector in C# .Net Implementation. It works with MCP Inspector, VSCode GitHub Copilot in Agent mode but just not with Copilot Studio.

This is the swagger that shows up -

```
swagger: '2.0'
info:
  title: MCP Server
  description: >-
    This MCP Server will work with Streamable HTTP and is meant to work with
    Microsoft Copilot Studio
  version: 1.0.0
host: <host>.azurewebsites.net
basePath: /
schemes:
  - https
consumes: []
produces: []
paths:
  /:
    post:
      summary: MCP Server Streamable HTTP
      x-ms-agentic-protocol: mcp-streamable-1.0
      operationId: InvokeServer
      responses: {}
definitions: {}
parameters: {}
responses: {}
securityDefinitions: {}
security: []
tags: []

```

## Program.cs

```
var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Services.AddLogging();

// Register MCP actions
builder.Services.AddScoped<AnalyzeAppInsightsAction>();
builder.Services.AddScoped<TriggerUatDeploymentAction>();

// Add MCP Server with automatic action discovery
builder.Services.AddMcpServer().WithHttpTransport().WithTools<AnalyzeAppInsightsAction>().WithTools<TriggerUatDeploymentAction>();

var app = builder.Build();

// Enable MCP endpoints
app.MapMcp();

app.UseHttpsRedirection();

await app.RunAsync();

```

## Tool/Action -

```
[McpServerToolType]
public class AnalyzeAppInsightsAction
{
[McpServerTool, Description("Analyzes Application Insights.")]
public async Task<JsonElement> AppInsightsLoad(bool input, CancellationToken cancellationToken)
{
  /// code here
}
}

```
I have the same question (0)
  • Suggested answer
    Romain The Low-Code Bearded Bear Profile Picture
    2,124 Super User 2025 Season 2 on at
    hello , did you have a look add this amazin tutorial ? Could help probably.
    How and from the custom connector there are some problem, directly try it from a copilot studio in preview mode with the official MCP mode.
     
    all source here , if it help : Community.powerplatform.com/forums/thread/?groupid=db8f53c2-767d-47d6-a1ae-fe4c828a6553
     
    :) if this post help you please click on answered it's important :)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 251 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 201 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 93 Moderator

Last 30 days Overall leaderboard