X

mcp-investidor10

Information

Investidor10 - MCP 服务器 该项目是 Model Context Protocol (MCP) 生态系统的一部分,提供了与外部 API 交互并管理特定领域模型的工具。它旨在演示如何构建具有外部 API 集成和数据验证功能的 MCP 服务器。 通过 Investidor10 API 查询股票市场数据(如股票价格和指标)的集成。 目录 特性 架构 安装 VSCode 中的 MCP 服务器配置 VSCode 中的 MCP 服务器输出 贡献 许可证 特性 get-acoes: 获取基本的股票信息。 使用 Zod 进行输入验证。 通过 fetch 与 Investidor10 API 集成(基础设施层)。 架构 该项目遵循受 领域驱动设计 (DDD) 模式启发的分层架构: 领域 (src/domain): 定义表示数据结构的接口和类型(例如,Investidor10)。 基础设施 (src/infrastructure): 实现外部服务,如 Investidor10ApiService,负责向 Investidor10 API 发起 HTTP 请求。 应用 (src/application): 包含业务逻辑在 Investidor10Service 中,处理和格式化来自基础设施的数据。 接口 (src/interface): 包括控制器(Investidor10ToolsController),这些控制器在 MCP 服务器中注册工具,定义验证模式,并返回结果。 入口点 (src/main.ts): 初始化 McpServer,配置传输(StdioServerTransport),实例化服务和控制器,并开始监听 stdio。 目录结构如下: src/ ├── domain/ │ └── models/ # 领域接口 ├── infrastructure/ │ └── services/ # 外部 API 实现 (Investidor10) ├── application/ │ └── services/ # 业务逻辑和数据格式化 ├── interface/ │ └── controllers/ # MCP 工具注册和验证 └── main.ts # 服务器入口点 build/ # 编译后的 JavaScript 代码 .vscode/ # 包含 mcp.json 文件,MCP 服务器配置 安装 bash git clone git@github.com/mcp-investidor10.git cd mcp-investidor10 npm install npm run build VSCode 中的 MCP 服务器配置 按 Ctrl+Shift+P 并选择 "MCP: List Servers" 选择 "stocks" 然后选择 "Start Server" VSCode 中的 MCP 服务器输出 按 Ctrl+Shift+P 并选择 "MCP: List Servers" 选择 "stocks" 然后选择 "Show Output" 贡献 欢迎提交 Pull 请求!请随时提出问题并讨论改进。 许可证 该项目采用 MIT 许可证 - 详情请参阅 LICENSE 文件。

Prompts

Reviews

Tags

Write Your Review

Detailed Ratings

ALL
Correctness
Helpfulness
Interesting
Upload Pictures and Videos

Name
Size
Type
Download
Last Modified
  • Community

Add Discussion

Upload Pictures and Videos