Get the FREE Ultimate OpenClaw Setup Guide →

mcp -example

In this example, you host a MCP Server using SSE and use the MCP Inspector to debug/test it. There are 2 basic Tools: Azure, WhoIs and GitLab Tools

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio garrardkitchen-mcp-server-example dotnet run --project McpServerExample.csproj \
  --env GitLab:Token="your-gitlab-personal-access-token" \
  --env GitLab:Domain="https://gitlab.example.com" \
  --env ASPNETCORE_ENVIRONMENT="Development"

How to use

This MCP server is a .NET-based implementation that exposes MCP endpoints to interact with MCP clients. It includes tooling endpoints such as the MCP Inspector for testing and debugging, and it demonstrates integration patterns with external services like GitLab via user secrets for configuration. Use the MCP Inspector to connect to the server over SSE, list available prompts and tools, and exercise the endpoints that manage model-context interactions. The server also exposes a set of tools (AzureTool, WhoIsTool, ElicitationTools, SensitiveDataExampleTool, GitLabTools) which you can invoke through the MCP interface to perform actions such as listing Azure subscriptions, querying resource groups, inspecting domain ownership, eliciting structured input from users, and managing GitLab project variables with masking of sensitive values. When starting the server with dotnet run, the server will listen on a local URL (for example, http://localhost:5000) and you can point the MCP Inspector to that URL to begin testing. The included Prompts section also shows example MCP prompts you can run directly from the inspector to experiment with elicitation and response formatting.

How to install

Prerequisites:

  • .NET SDK (for example .NET 6.0+)
  • Git

Installation steps:

  1. Clone the repository: git clone https://github.com/your-org/mcp-example.git cd mcp-example

  2. Restore and build the project: dotnet restore dotnet build

  3. Run the MCP server: dotnet run

  4. (Optional) Start the MCP Inspector to test endpoints: npx @modelcontextprotocol/inspector dotnet run

  5. Configure the MCP Inspector to connect to the server URL shown in the console output (for example, http://localhost:5168 or http://localhost:5000).

Note: If you plan to use GitLab tools, configure user secrets for GitLab credentials as described in the User Secrets section of the README (GitLab:Token and GitLab:Domain).

Additional notes

Tips and notes:

  • The server relies on user secrets for sensitive configuration (e.g., GitLab credentials). Use dotnet user-secrets init and set the values as shown in the README.
  • When testing with the MCP Inspector, ensure the inspector is configured to use SSE and the correct base URL for the server. Copy the server's Http URL from the console output after running.
  • For GitLab integration, ensure you have a valid GitLab PAT and domain configured in user secrets; masking is applied to sensitive values in responses.
  • If you encounter port or binding issues, verify that the environment allows binding to the requested URL and that no other process is listening on that port.
  • This example demonstrates multiple MCP tool families (AzureTool, WhoIsTool, ElicitationTools, SensitiveDataExampleTool, GitLabTools). Each tool has specific prompts and output masking rules; refer to the README for details on usage and prompts.

Related MCP Servers

Sponsor this space

Reach thousands of developers