MCP.so
登录

MCP Server Example

@garrardkitchen

关于 MCP Server Example

In this example, you host a MCP Server using HTTP Transport and use the MCP Explorer to debug/test it. There are few basic Tools: Azure, WhoIs and GitLab Tools, including 2x elicitations examples too

基本信息

分类

其他

许可证

MIT

运行时

c#

传输方式

stdio

发布者

garrardkitchen

配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "mcp-server-example-garrardkitchen": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-it",
        "\\"
      ]
    }
  }
}

工具

未检测到工具

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is MCP Server Example?

MCP Server Example is a basic implementation of an MCP (Model Context Protocol) server built with .NET. It provides tools, resources, and prompts for interacting with MCP clients, and demonstrates integration with external services like Azure and GitLab. It is intended for developers who want to test, debug, or extend an MCP server.

How to use MCP Server Example?

Build and run the server with dotnet build and dotnet run. It listens on a local HTTP URL (e.g., http://localhost:5168). Connect via MCP Explorer X or the MCP Inspector using Streamable HTTP transport. For GitLab tools, configure a Personal Access Token (PAT) and domain using .NET user secrets with dotnet user-secrets set "GitLab:Token" and dotnet user-secrets set "GitLab:Domain".

Key features of MCP Server Example

  • Middleware that logs HTTP User-Agent headers for all requests.
  • Azure tools for listing subscriptions, resource groups, VMs, and resource properties.
  • WhoIs tool for domain registration lookups.
  • Elicitation tools demonstrating user input requests (e.g., GuessTheNumber, BrowseAzure Resources).
  • Sensitive data handling with automatic masking of secrets and API keys.
  • GitLab tools for searching groups, projects, variables, and adding Azure budgets.

Use cases of MCP Server Example

  • Interact with Azure resources (subscriptions, VMs, resource groups) via MCP.
  • Manage GitLab projects and CI/CD variables through MCP tools.
  • Test elicitation workflows that require structured user input.
  • Learn best practices for handling sensitive data in MCP responses.
  • Debug and inspect MCP server features using MCP Explorer X or the Inspector.

FAQ from MCP Server Example

How do I run the server?

Run dotnet build followed by dotnet run. The server starts on a local HTTP URL (e.g., http://localhost:5168). Use the URL to connect an MCP client or test tool.

How do I configure GitLab integration?

Set a GitLab Personal Access Token and domain using .NET user secrets: dotnet user-secrets set "GitLab:Token" <token> and dotnet user-secrets set "GitLab:Domain" <domain>.

How can I test the server without GitLab?

You can skip GitLab configuration; only the GitLab tools will be unavailable. All other tools, resources, and prompts work without it.

How do I test with MCP Explorer X?

Run the MCP Explorer X Docker container (instructions provided for macOS, Linux, Windows) and add the server as a connection using the local URL (Streamable HTTP). Then browse and invoke tools from the browser UI.

Does the server support authentication?

No explicit authentication is built into the server itself. Azure tools rely on your local Azure CLI credentials mounted into the container, and GitLab tools use a manually configured PAT.

评论

其他 分类下的更多 MCP 服务器