0M

0itsuki0/mcpdemo-typescript-

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

39 stars 12 forks 质量 50 趋势 12

0itsuki0/mcpdemo-typescript- 是从 https://github.com/0itsuki0/mcpdemo-typescript-. 导入的 MCP 服务器候选

概览

0itsuki0/mcpdemo-typescript- 是从 https://github.com/0itsuki0/mcpdemo-typescript-. 导入的 MCP 服务器候选

概述(AI 翻译)

更多细节请参见我的文章:

  • 开始使用模型上下文协议。
  • MCP服务器和客户端,支持SSE和新的可流式HTTP
  • MCP授权:全新的RS与AS分离!

目录

  • 带标准的MCP
  • 服务器
  • 带客户端托管
  • MCP 与 SSE 合作
  • 服务器
  • 客户
  • 带有可流式HTTP的MCP
  • 服务器
  • 客户
  • 带授权的MCP(可流式HTTP)
  • 授权服务器
  • MCP 资源服务器
  • MCP 客户端

本地MCP带标准

本地MCP服务器

一个向MCP主机暴露create-mcp-server-app工具的MCP服务器。

通过运行该工具,无论是在 Claude for Desktop 还是其他主机上,桌面文件夹中都会创建一个新的项目,用于创建包含必要设置和示例代码的 MCP 服务器。

示例代码将包括以下内容。

  • 创建服务器实例
  • 定义可用工具
  • 处理工具执行
  • 启动服务器

布置

  1. 运行npm install以安装必要的依赖
  2. 运行npm run build以构建项目
  3. build/index.js 服务器路径将在MCP主机中建立

用Claude测试桌面版

  1. 下载桌面版Claude

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Demo of Model Context Protocol

For more details, please refer to my article:

Table of Contents

Local MCP with stdio

Local MCP Server

An MCP server that exposes a create-mcp-server-app tool to MCP hosts.

By running this tool, either with Claude for Desktop or some other host, a new project for creating an MCP server with necessary set ups and sample code will be created in the desktop folder.

Sample Code will include the following.

  • creating a server instance
  • defining available tools
  • handling tools execution
  • starting the server

Set Up

  1. Run npm install to install necessary dependency
  2. Run npm run build to build the project
  3. build/index.js will the server path to set up in the MCP host

Test with Claude for desktop

  1. Download Claude for Desktop
  2. Open the configuration file at ~/Library/Application Support/Claude/claude_desktop_config.json
    • If the file does not exist, create one with the same name
  3. Add server configuration
{
    "mcpServers": {
        "create-mcp-app": {
            "command": "node",
            "args": [
                "/absolute-path-to/build/index.js"
            ]
        }
    }
}
  1. Save the file and restart Claude for Desktop.
  2. Enter the prompt create a new mcp server project. You should see a sample MCP Server project created at desktop directory with some responses indicating the success.

Local Host with MCP Clients

An OpenAI-chatbot host that uses MCP clients to connect to MCP servers.

Set up

  1. Set up OPENAI_API_KEY in .env.
  2. Add MCP server configurations to connect the host in server-config.json.
{
    "some-server-name-1": {
        "command": "node",
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →