Token导航 LogoToken导航TokenDH.com
Ivee Tech MCP logo
运维云端未说明官方级别未说明来源级核验

Ivee Tech MCP

MCP Server

基于ASP.NET Core的Model Context Protocol (MCP) HTTP服务器实现,支持工具注册、发现和执行,提供流式JSON响应。

工具数

1

提示词数

0

GitHub Stars

0

资源数

0
HTTP服务器C#VS CodeVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

ivee-tech

提供方

ivee-tech

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

MCP HTTP服务器(ASP.NET核心)

使用ASP.NET构建的模型上下文协议(MCP)HTTP服务器的示例实现。NET核心最低API。它暴露了一个 hello_world 该工具通过流友好的JSON响应演示工具注册、发现和执行。

先决条件

快速入门

# Restore dependencies
cd c:/s/AI/mcp-http-server
dotnet restore

# Run the server (HTTPS by default)
dotnet run --project src/McpHttpServer/McpHttpServer.csproj

该服务监听中定义的HTTP和HTTPS端点 Properties/launchSettings.json 并支持JSON-RPC请求 /.

工具发现

curl http://localhost:5248/tools

示例响应:

{
  "tools": [
    {
      "name": "hello_world",
      "description": "Returns a friendly greeting. Provide an optional 'name' field in the input.",
      "inputSchema": {
        "type": "object",
        "title": "HelloWorldInput",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "description": "Optional name to include in the greeting."
          }
        }
      }
    }
  ]
}

执行工具

curl https://localhost:7272/mcp/execute `
  -H "Content-Type: application/json" `
  -d '{"tool":"hello_world","input":{"name":"Azure"}}' `
  -k

服务器将JSON响应流式传输给调用者:

{"tool":"hello_world","contentType":"application/json","result":{"message":"Hello, Azure!"}}

JSON-RPC使用情况

VS Code和其他支持MCP的客户端可以通过根端点上的JSON-RPC 2.0与服务器通信:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "hello_world",
    "arguments": {
      "name": "Azure"
    }
  }
}

服务器回复:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tool": "hello_world",
    "content": [
      {
        "type": "json",
        "json": {
          "message": "Hello, Azure!"
        }
      }
    ]
  }
}

测试和格式化

# Run integration tests
dotnet test

# Format the codebase (requires dotnet-format global tool)
dotnet format

延伸

  • 通过实施注册其他MCP工具 IMcpTool 并将它们添加到DI容器中。
  • 考虑添加结构化日志记录或OpenAPI元数据作为后续增强功能。

目录标签

目录标签

HTTP服务器C#VS Code本地部署ASP.NETCoreJSON-RPC工具执行

支持客户端

VS Code

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

1

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP