Back to MCP directory
publicPublicdnsLocal runtime

mcp-client-server-host-demo

一个展示模型上下文协议(MCP)与宝可梦数据结合的演示项目,包含MCP服务端、客户端及支持LLM通过OpenRouter调用宝可梦工具的HTTP服务器。

article

README

🚀 《口袋妖怪》 MCP 演示项目

本项目是一个展示模型上下文协议(MCP)与口袋妖怪数据集成的演示项目。它将 MCP 与口袋妖怪数据相结合,提供了 MCP 服务器、客户端,还支持大语言模型通过 OpenRouter 使用口袋妖怪工具,为相关应用开发提供了很好的参考。

🚀 快速开始

📦 安装指南

使用以下命令进行项目安装:

bun install

🏃 运行项目

MCP 服务器和客户端演示

运行客户端,它会自动启动 MCP 服务器:

bun mcp_client.ts

带大语言模型集成的 HTTP 服务器

设置你的 OpenRouter API 密钥并运行 HTTP 服务器:

export OPENROUTER_API_KEY=your_api_key_here
bun http_server.ts

然后访问服务器:http://localhost:3005

  • /tools - 列出可用工具
  • /attack - 使用大语言模型执行一个随机口袋妖怪攻击

该项目使用 Bun 作为其 JavaScript 运行时环境。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client