MCP.so
ログイン

MCP Server Example

@garrardkitchen

基本情報

カテゴリ

その他

ライセンス

MIT

トランスポート

stdio

作者

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

MCP Server Example の設定

以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。

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

MCP Server Example のツール

ツール一覧はまだありません

この掲載には表示できるツール一覧がまだありません。サーバーにツールがないという意味ではありません。対応機能はプロジェクトのドキュメントをご確認ください。

ツールは 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.

よくある質問

1

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.

2

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>`.

3

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.

4

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.

5

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.

コメント

「その他」の他のコンテンツ